First off, I'm not sure I can actually answer your headline question. I can install Rhtslib fine on Windows, but get the same error you do when trying to build link2Rhtslib. However I think I can at least get your package to load on Windows.
If you want to use zlibbioc then I think you should link against the pre-compiled static library on Windows. It looks like you got some decent advice on StackOverflow, and the error LoadLibrary failure: The specified module could not be found
is a result of linking against the shared library during compilation, and its location can't be resolved when you then try to load scPipe.dll
You can fix this by using zlibbioc::pkgconfig("PKG_LIBS_static")
in your Makevars.win
However, I think this will lead to a new set of problems, and I'm not sure you should use zlibbioc at all. In my experience I find the interaction between zlibbioc and other packages that are also ship pre-compiled Windows binaries (like Rhtslib) pretty baffling, and when I've tried to use it, I've ended up just resorting to using system versions of zlib.
In your case Rhtslib already links against a version of zlib, and includes -lz
in it's compilation flags, which will probably be a system version of zlib since no path is specified. If you also include zlibbioc I think there's a good chance your compiler will complain of multiple definitions of the same functions and fail.
If you remove any reference to zlibbioc (in Makevars.win
and DESCRIPTION
) then your code will link to the system library. I understand the desire to use stable library versions that don't require external installation, but zlib is pretty ubiquitous and I'm not sure Rhtslib will work without it anyway, so I think that's a safe option here.
Yes that `zlibVersion` was a typo, wasn't logged into bioconductor on my Windows testing laptop so I typed out the error message. Thanks for the help, I'll try it out once I'm infant of a Windows laptop again.
Thanks so much Martin, the necessary code was to add `import(Rhtslib)` to the `NAMESPACE`, which I did via ROxygen's `@import` for consistency. I still needed the `zlibbioc::pkgconfig()` code because I actually reference `zlib` directly in some of my c++. I'll post these to the dev mailing list in the future, it was just too tempting to use the nice formatting facilities of this site.