Problems linking Boost with GCC

I am trying to build my project with MinGW and GCC (linux) and getting linker errors. I don't use MinGW/GCC on a regular basis so I may just be linking wrong.

MinGW errors:
C:\Users\Sean\AppData\Local\Temp\ccrXhQ5n.o:Bot.cpp:(.text+0x18fe): undefined re
ference to `boost::system::generic_category()'
C:\Users\Sean\AppData\Local\Temp\ccrXhQ5n.o:Bot.cpp:(.text+0x1908): undefined re
ference to `boost::system::generic_category()'
C:\Users\Sean\AppData\Local\Temp\ccrXhQ5n.o:Bot.cpp:(.text+0x1912): undefined re
ference to `boost::system::system_category()'
C:\MinGW\bin/ld.exe: C:\Users\Sean\AppData\Local\Temp\ccrXhQ5n.o: bad reloc addr
ess 0x16 in section `.text$_ZStoRRSt13_Ios_FmtflagsS_[__ZStoRRSt13_Ios_FmtflagsS
C:\MinGW\bin/ld.exe: final link failed: Invalid operation
collect2.exe: error: ld returned 1 exit status

This is nuwen MinGW that comes with GCC-4.8 and boost built in

GCC errors:
This was on Ubuntu 13.04 GCC-4.7.3 and boost1.53 from the repo.

It builds and links with clang (although I get a regex_error)

Here is how I am compiling and linking
g++ -std=c++11 -Iinclude -lboost_system -lboost_filesystem -lboost_date_time src/Bot.cpp src/main.cpp

Any ideas are appreciated.
src/Bot.cpp: In member function ‘std::string sv::Bot::receive()’:
src/Bot.cpp:60:61: error: no matching function for call to ‘std::exception::exception(const char [35])’
After fixing that it builds fine

gcc version 4.8.1 (GCC)
boost version 1.54

Use `nm' to check which library defines those functions (boost_system here)
I thought I pushed the fix for that already, updated the repo.

Can I assume my command looks fine?
Thank you, worked perfectly.

Edit: Had to add -lWs2_32 for MinGW
Last edited on
Topic archived. No new replies allowed.