trayres
trayres

Reputation: 532

Checking Boost install with MinGW

I used the MinGW installation at http://nuwen.net/mingw.html

I ran the second.cpp test found at: http://tabreziqbal.wordpress.com/2006/03/16/how-to-test-c-boost-installation/ (I used the correct commands to run from the comments, which was g++ -o second second.cpp -lboost_filesystem)

I get the following error:

C:\Users\user\Projects\Programming\C++\boostTest2>g++ -o second second.cpp -lboost_filesystem C:\Users\user\AppData\Local\Temp\ccDlbKGy.o:second.cpp:(.text+0x102): undefined reference to boost::system::generic_cat egory()' C:\Users\user\AppData\Local\Temp\ccDlbKGy.o:second.cpp:(.text+0x10c): undefined reference toboost::system::generic_cat egory()' C:\Users\user\AppData\Local\Temp\ccDlbKGy.o:second.cpp:(.text+0x116): undefined reference to boost::system::system_cate gory()' C:\MinGW\bin/ld.exe: C:\Users\user\AppData\Local\Temp\ccDlbKGy.o: bad reloc address 0xe in section.text$_ZN5boost6syst em14error_categoryD1Ev[__ZN5boost6system14error_categoryD1Ev]' C:\MinGW\bin/ld.exe: final link failed: Invalid operation collect2.exe: error: ld returned 1 exit status

I know there's an installation test feature of boost that I found on http://gcc.gnu.org/testing/testing-boost.html but those files aren't included with the distribution from nuwen.net (so I'd have to do it myself).

And help is appreciated - I figure I'm just screwing up something minor (I hope anyway).

Thanks all!

Upvotes: 0

Views: 552

Answers (1)

ForEveR
ForEveR

Reputation: 55897

It's not correct command, you should link boost::system too (errors are undefined references to boost::system::system_category). Correct command will be g++ -o second second.cpp -lboost_system -lboost_filesystem

Upvotes: 3

Related Questions