0

OK, so I have been following this tutorial.

I set up everything as told (double checked everything), only thing I changed is (step 10), from

${OGRE_HOME}\boost_1_44

to

${OGRE_HOME}\boost

since in my Ogre SDK version (1.81), there is no boost_1_44 folder, only boost folder.

Anyhow, as I said, when I try to compile my program, I get this three errors :

undefined reference to boost::system::generic_category() 
undefined reference to boost::system::generic_category() 
undefined reference to boost::system::system_category() 

I have tried adding this : -lboost_system to my Project. I went to Properties > C/C++ Build > Settings > GCC C++ Compiler > Miscellaneous and added it to the existing flags, but no luck.

I googled, and apparently that is the only solution possible. So, I ask you, if someone could explain me (as simple as possible please, step by step) how to fix this compiler errors.

EDIT : I'm using MinGW as a compiler (I use it with MSYS).

TheGhost
  • 301
  • 4
  • 12
  • 1
    Do you have `libboost_system.a` on the linker path? – Igor R. Jul 23 '13 at 08:09
  • I added it in Properties > C/C++ Build > Settings > MinGW C++ Linker > Libraries > Libraries (-l); but I get an error, saying : "cannot find -libboost_system.a". – TheGhost Jul 23 '13 at 09:01
  • Again, "do you have libboost_system.a on the linker path"? Do you *see* such a file? Does a file named "libboost_system.a" exist where it's expected to be? – Igor R. Jul 23 '13 at 09:03
  • I don't see it, but again, I'm totally new to Eclipse IDE, so I might be looking in the wrong place... – TheGhost Jul 23 '13 at 09:14
  • It's unrelated to Eclipse. If you haven't built Boost, then Boost.System static library doesn't exist. You should first build boost (see "Getting started" manual: http://www.boost.org/doc/libs/1_54_0/more/getting_started/windows.html). – Igor R. Jul 23 '13 at 09:29
  • I have downloaded OGRE SDK, which has pre-built boost. I downloaded this : http://sourceforge.net/projects/ogre/files/ogre/1.8/1.8.1/OgreSDK_MinGW_v1-8-1.exe/download. You can download it and see for yourself, but everything is built already. – TheGhost Jul 23 '13 at 09:40
  • Go to `OgreSDK_MinGW_v1-8-1\boost\lib` and see the correct library names. – Igor R. Jul 23 '13 at 12:05
  • I have "libboost_system-mgw47-mt-d-1_51.a" and "libboost_system-mgw47-mt-d-1_51.a". What do I add then to Properties > C/C++ Build > Settings > MinGW C++ Linker > Libraries > Libraries (-l)? – TheGhost Jul 23 '13 at 15:38
  • UPDATE : I tried adding boost_system to my Properties > C/C++ Build > Settings > MinGW C++ Linker > Libraries > Libraries (-l), but no luck. I also tried adding "boost_system-mgw47-mt-d-1_51.a" and "libboost_system-mgw47-mt-d-1_51.a" (not in the same time, of course) in my Debug (Active) in the same place (Properties > C/C++ Build > Settings > MinGW C++ Linker > Libraries > Libraries (-l)), but no luck again. – TheGhost Jul 23 '13 at 15:56
  • The former is import lib, the latter is static lib. According to their names, this is Boost 1.51, so you should include headers from the same version. – Igor R. Jul 23 '13 at 16:51
  • let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/34001/discussion-between-theghost-and-igor-r) – TheGhost Jul 23 '13 at 17:28
  • I'm afraid I can't be helpful with regards to your specific issue (Eclipse settings). I just wanted to highlight the boost-related points. – Igor R. Jul 23 '13 at 17:59
  • OK, just hoping someone will tell me what to do in Eclipse... Thanks anyway. :) – TheGhost Jul 23 '13 at 18:09

1 Answers1

5

I have had similar problems compiling in linux using CMake and clang. I fixed it by adding the flag

-DBOOST_SYSTEM_NO_DEPRECATED

This "comments" out the lines causing the problem. I don't know if this will fix your errors but it did fix mine.

(If you use ./configure also add CPPFLAGS='-DBOOST_SYSTEM_NO_DEPRECATED' as a parameter).

Sergei Lodyagin
  • 171
  • 1
  • 8
David
  • 329
  • 2
  • 5