Closed sanglier91 closed 6 years ago
I can take a look but note first that you do not need Boost to open gzip'ed file. R already does it via all of read.table()
and variants, and you can also do it in plain C/C++ code via gzopen()
-- which should also "just work" because R is always built wiith that library.
As for "I can solve it this" that is indeed correct, but your package now becomes less portable as all users would have to have these libraries available "and visible". Unlikely on Windows. In short, this is the difference between using Boost as header-only (as BH) or using Boost full-fledged with linking. Some libraries and components only work in the latter way. It is up to you balance those costs and benefits.
I didn't know about gzopen()
. I'm going to change my code in order to use it. Thank you. Please let me know if you find the reason of the error.
Yes, gzopen()
is gold. Been using it for decades (!!).
I told you the error. The way Boost implements this requires linking with Boost.
Hi,
First of all thank you for this very useful package. I would like to use it inside a package to read a gzip file. At the end of the compilation, I get the following error message:
I believe the error come from the header file <boost/iostreams/filter/gzip.hpp> that I need. It uses the zlib.hpp file that declare the following variable:
BOOST_IOSTREAMS_DECL extern const int deflated;
My DESCRIPTION file declare BH under the LinkingTo section.
I use other functions from BH without any problem.
I can solve the problem by adding the following line to my Makevars file but I guess this is not the right way to do:
PKG_LIBS = -L/usr/lib/x86_64-linux-gnu/ -lboost_iostreams -lboost_filesystem
Wilfried