[SOLVED] QT and boost : cannot find -llibboost_filesystem...
-
You can try adding
DEFINES += BOOST_THREAD_USE_LIB
-
@SGaist :
I just added your code, unfortunately it has no effect on the errors.
-
I checked my boost lib dir and I do have a libboost_thread-mgw... .dll and .lib so maybe you investigate the build of the boost libraries.
I downloaded and built boost 1.58.
This time I do have '.a', '.dll' and '.dll.a' for libbost_thread...
But it does not change anythingI don't recall doing anything in particular but the errors about 'thread' are not the same anymore.
They were like :
undefined reference to _imp___ZN5boost6threadC1Ev'
undefined reference to _imp___ZN5boost6thread4joinEv'And now :
undefined reference to boost::thread::thread()'
undefined reference to boost::thread::joinable() const'I just noticed that I have another error :
cc1plus.exe:-1: erreur : note: initialized from here
file not found : cc1plus.exe -
I have MinGW installed in C:/MinGW
And also the one that comes with Qt Creator.In my PATH I have set "C:\Qt\qtcreator-2.4.1\mingw\bin"
Nevermind, this error appeared because I changed the MinGW to use in Project options.
If I select the MinGW that comes with Qt Creator this error disappears. -
I may have an idea why it's not working.
I did not see, but I had Strawberry perl installed and it has mingw.
In my path I had "C:\Strawberry\c\bin" set, so I built boost using this mingw (v4.8.1) and the mingw that comes with Qt creator is v4.4.0I removed strawberry from the path.
I am currently rebuilding boost with the correct mingw, will update tomorrow. -
Never modify PATH when you are developing (it should also be avoided as much as possible the rest of the time), it's in the same category as developing as root on linux ;)
More seriously, having MinGW or the Qt bin path in your PATH is an open door to a world of problem since you will be thing you are using one version of a library while in fact using another one. Also, MinGW isn't always compatible between two versions of their compiler. That's probably why you had problem in the first place since you where using two different versions.
In any case, one rule that you should apply on Windows: Use the same compiler for all your code and dependencies. It's not always possible but it will greatly simplify your life.
-
That was it, it works fine now !
@SGaist : I did not notice in the first place that I was using two versions of MinGW.
When I installed Strawberry some weeks ago he added himself his path to the environement variable PATH.
So I thought I was compiling boost with the MinGW from Qt Creator, I did not pay enough attention to the 'mg48' in librairies' name that should have been 'mg44'.How do I make this subject "solved" ?
-
Windows can be tricky for that
IF you don't have the option in the Topic Tools menu, just edit the thread title and prepend [solved]
-
OK, thank you all for your help :)