Linking Boost libs required by ASIO on Windows giving undefined reference errors
-
Ok I got it to compile, but it's not pretty at all.
Firstly, I added the preprocessor definition mentioned above and documented "here":http://www.boost.org/doc/libs/1_44_0/libs/system/doc/reference.html to my .pro file, plus I also had to add a windows library called ws2_32, so my new .pro file looks like this (ignore how it's not cross platform)
@
DEFINES += BOOST_SYSTEM_NO_DEPRECATEDwin32: LIBS += -L$$PWD/../../../libs/boost_1_44/stage/lib/ -lboost_filesystem-mgw44-mt-1_44 -lboost_system-mgw44-mt-1_44 -lws2_32
@After all that I was getting one more error
bq.
error.hpp:220: error: 'get_system_category' is not a member of 'boost::system'So I just commented that line out like so
@
inline const boost::system::error_category& get_system_category()
{
//return boost::system::get_system_category();
}
@At least it compiles. I have no idea if it runs yet or how important that line of code is. That method is defined inside an "#ifndef BOOST_SYSTEM_NO_DEPRECATED", so I don't know why that function uses a method that can potentially by ifdef'ed out.
I'm used to running in Visual Studio where all this stuff just work.
If anyone has a better way, PLEASE, let me know! Thanks for everyone's help so far.
-
bq. So I just commented that line out... At least it compiles.
I don't want this to devolve into a discussion of how to debug and patch boost, but from a general coding standpoint this doesn't seem like a very good idea at all. You now have a method that has no return value at all. While it may compile, it's just setting the stage for an unknown bug to pop up down the line if the get_system_category() method should be called somewhere down the line. At the very least, if you do go this route, you might consider putting some sort of warning debug message in that method and returning some known default value.
-
I know this is a very old post, but just for reference in case someone needs it in the future, the best way to get ASIO working with Qt is using it by itself instead of using the Boost integrated version.
Asio is a project on its own, and it doesn't need the Boost dependency in case you need to use it in something else (like Qt). Here's the project link in case someone needs it: "Think Async ASIO":http://think-async.com
I had a lot of issues until I was able to just get rid of Boost, which has things that I can already do with Qt, and in a much easier and cleaner way.
Thanks
-
Thanks a lot, i really helped me and save coutless hours of research!!!
-
[quote author="golgobot" date="1304398277"]
.....
@
#ifndef BOOST_SYSTEM_NO_DEPRECATED
#define BOOST_SYSTEM_NO_DEPRECATED 1
#endif
@Before my include. I ran the build and now I get only one error (and lots of warnings, but let's ignore those for now)
....
[/quote]
this worked for me .... thanks
also seen at "stackoverflow _ to be excluded as deprecated":http://stackoverflow.com/questions/1814548/boostsystem-category-defined-but-not-used
EDIT 1 :
Hi,
In case you are doing Ogre3D (OGRE 1.8.1 SDK for Visual C++ .Net 2010 (32-bit) ) then use QT5 32bit instead of the QT5 64bit version, it will pass.
I think it has been compiled (boost included) with 32bit thus i suppose i have to take src and recompile (using my 64bit) but thats another story where i wont go for now since OGRE 1.9 RC 1 SDK for Visual C++ .Net 2012 (64-bit) will be soon release on stable version.
Regards
EDIT 2 :
Downloaded Qt libraries 4.8.4 for Windows and configured my QT creator (the one coming with full QT5 and guess what .... Ogre3D is working like a charm when compiling on 4.8.4.
@
Qt 5.0.2 for Windows 32-bit (VS 2010, 485 MB)
Qt libraries 4.8.4 for Windows (VS 2010, 234 MB)
OGRE 1.8.1 SDK for Visual C++ .Net 2010 (32-bit)
@