Hi,
I am wondering if any of you boost gurus can help with this problem.
I have compiled and installed boost using gcc 2.95.3 on a linux redhat 7
machine. The install actually fails on some targets. I get this
message at the end of the install:
...failed updating 24 targets...
...skipped 48 targets...
...updated 2343 targets...
But I am guessing that this is expected behavior for an old compiler.
Anyway, I am interested in the filesystem library at this time, and so I
tried compiling the simple_ls.cpp example. When I compile using the
default linking (which uses shared objects), the program works fine, but
when I compile using the -static flag to limit to static linking, I get
a lot of undefined reference errors (see below). Unfortunately, I
haven't been able to figure out why this would happen.
Any suggestions on how to debug this or as to what might be going wrong
would be greatly appreciated.
Sincerely,
Daniel
/tmp/ccU0ehTU.o: In function `main':
/tmp/ccU0ehTU.o(.text+0xc): undefined reference to
`boost::filesystem::initial_path(void)'
/tmp/ccU0ehTU.o(.text+0x2c): undefined reference to
`boost::filesystem::native(basic_string > const &)'
/tmp/ccU0ehTU.o(.text+0x3e): undefined reference to
`boost::filesystem::path::path(char const *, bool (*)(basic_string > const &))'
/tmp/ccU0ehTU.o(.text+0x50): undefined reference to
`boost::filesystem::system_complete(boost::filesystem::path const &)'
/tmp/ccU0ehTU.o(.text+0xe8): undefined reference to
`boost::filesystem::exists(boost::filesystem::path const &)'
/tmp/ccU0ehTU.o(.text+0x10d): undefined reference to
`boost::filesystem::path::native_file_string(void) const'
/tmp/ccU0ehTU.o(.text+0x188): undefined reference to
`boost::filesystem::is_directory(boost::filesystem::path const &)'
/tmp/ccU0ehTU.o(.text+0x1ad): undefined reference to
`boost::filesystem::path::native_directory_string(void) const'
/tmp/ccU0ehTU.o(.text+0x257): undefined reference to
`boost::filesystem::is_directory(boost::filesystem::path const &)'
/tmp/ccU0ehTU.o(.text+0x289): undefined reference to
`boost::filesystem::path::leaf(void) const'
/tmp/ccU0ehTU.o(.text+0x2f5): undefined reference to
`boost::filesystem::path::leaf(void) const'
/tmp/ccU0ehTU.o(.text+0x427): undefined reference to
`boost::filesystem::path::native_file_string(void) const'
/tmp/ccU0ehTU.o(.text+0x5ab): undefined reference to
`boost::filesystem::path::leaf(void) const'
/tmp/ccU0ehTU.o: In function
`boost::filesystem::directory_iterator::directory_iterator(boost::filesystem::path
const &)':
/tmp/ccU0ehTU.o(.boost::filesystem::directory_iterator::gnu.linkonce.t.(boost::filesystem::path
const &)+0x26): undefined reference to
`boost::filesystem::detail::dir_itr_init(boost::shared_ptrboost::filesystem::detail::dir_itr_imp
&, boost::filesystem::path const &)'
/tmp/ccU0ehTU.o: In function
`boost::filesystem::directory_iterator::dereference(void) const':
/tmp/ccU0ehTU.o(.boost::filesystem::directory_iterator::gnu.linkonce.t.dereference(void)
const+0x12): undefined reference to
`boost::filesystem::detail::dir_itr_dereference(boost::shared_ptrboost::filesystem::detail::dir_itr_imp
const &)'
/tmp/ccU0ehTU.o: In function
`boost::filesystem::directory_iterator::increment(void)':
/tmp/ccU0ehTU.o(.boost::filesystem::directory_iterator::gnu.linkonce.t.increment(void)+0x12):
undefined reference to
`boost::filesystem::detail::dir_itr_increment(boost::shared_ptrboost::filesystem::detail::dir_itr_imp
&)'
collect2: ld returned 1 exit status