Multiple link errors when using boost 1.44 boost::filesystem and gcc 4.1.2 on CentOS 5.5
I have installed gcc 4.1.2 (from Cent OS 5.5 repos), boost 1.44, and built all
the libraries. I am able to link to all other libraries I try. As soon as I so
much as add the include for boost::filesystem, and attempt to build my single
.cpp file, I get the following errors:
In function `__static_initialization_and_destruction_0(int, int)':
testbuild.cpp:(.text+0xfa): undefined reference to
`boost::system::generic_category()'
testbuild.cpp:(.text+0x106): undefined reference to
`boost::system::generic_category()'
testbuild.cpp:(.text+0x112): undefined reference to
`boost::system::system_category()'
collect2: ld returned 1 exit status
The linking stage fails and despite hours of googling I see no clear solution. I
would be grateful for any advice on how to move past this, as it's the only
thing holding me back from developing with boost. To be clear again, simply
including
Potato Soup wrote:
I have installed gcc 4.1.2 (from Cent OS 5.5 repos), boost 1.44, and built all the libraries. I am able to link to all other libraries I try. As soon as I so much as add the include for boost::filesystem, and attempt to build my single .cpp file, I get the following errors:
In function `__static_initialization_and_destruction_0(int, int)': testbuild.cpp:(.text+0xfa): undefined reference to `boost::system::generic_category()' testbuild.cpp:(.text+0x106): undefined reference to `boost::system::generic_category()' testbuild.cpp:(.text+0x112): undefined reference to `boost::system::system_category()' collect2: ld returned 1 exit status
The linking stage fails and despite hours of googling I see no clear solution. I would be grateful for any advice on how to move past this, as it's the only thing holding me back from developing with boost. To be clear again, simply including
is enough to cause this when performing a link against libboost_filesystem.a.
I recommend you read http://vladimir_prus.blogspot.com/2009/06/linking-101.html which even uses this specific error as example. - Volodya
participants (2)
-
Potato Soup
-
Vladimir Prus