Problem when boost enabled


12-03-2013 21:02:03

I did a clean build of MyGUI today and gave it my boost path, thinking this was what I normally did. It caused a bunch of problems... all the editor/demo projects are giving linker errors like:Performing Pre-Link Event...
LINK : fatal error LNK1104: cannot open file 'libboost_thread-vc90-mt-1_44.lib'
The funny thing is, I can find NO reference to 'libboost_thread-vc90-mt-1_44.lib' in the .vcproj file.

My research suggests this is due to "boost autolinking" and I saw Ogre defines BOOST_ALL_NO_LIB which according to StackOverflow is the answer. But I don't really understand what's going on. I looked at my old MyGUI builds and I never enabled boost after all, even though Ogre is using boost, so I guess I should just do that. But then I get an error like:

3>c:\programming\ogre3d\ogre_src_v1-8-1\build\sdk\include\ogre\threading\OgreThreadHeadersBoost.h(37) : fatal error C1083: Cannot open include file: 'boost/thread/tss.hpp': No such file or directory


12-03-2013 22:18:21

(Altren answered in original thread where I asked another question)...

We are not using boost in MyGUI and the only reason why it exist in CMake is that Ogre use and OgrePlatform won't compile without includes.
I can try to reproduce problem on my computer, but now I have only few guesses - it could come from Ogre's header and directive in code, or it could come from findOgre.cmake script.

I seem to have found a fix by adding this to CMakeLists.txt:
Index: CMakeLists.txt
--- CMakeLists.txt (revision 5198)
+++ CMakeLists.txt (working copy)
@@ -205,6 +205,11 @@

+ add_definitions(/wd4251)
+ add_definitions(/wd4661)
+ add_definitions(/wd4275)
+ add_definitions("-DBOOST_ALL_NO_LIB")
# Use the highest warning level for visual studio.
The warnings are for my own convenience, add_definitions("-DBOOST_ALL_NO_LIB") is the fix. I don't know if you permit other people commit access (if so how?) so would you consider making this change? It maybe should be somewhere else, like after checking of boost is found, but it works well for me.


13-03-2013 20:14:55

Thank you for info and solution. I commited change, that fix this problem.

What about svn access - we usually permit this for those who request it, but review first few commits carefully before allowing to commit freely.