16 May 2019 at 17 h 55 min #13487
Hi, my problem is related a bit with this other one, but couldn’t manage to make it works.
I’m using VS2017, QT 5.1.2 and boost 1.66 for x64.
Main error is: LNK1104 cannot open file ‘boost_program_options-vc141-mt-x64-1_66.lib’ in “SofaHelper”. Figured that in CMAKE I had used the ‘libboost_program_options-vc141-mt-x64-1_66.lib’ file, but don’t know how to change the filename.
The other errors are related to not existent libraries in specific files but maybe is due to previous error.
Full link to errors: https://docs.google.com/document/d/1W_aRAEEID4H_2SAyRvdJhvw2_4Z6XrrUSo8MlOkvJfk/edit?usp=sharing
Thanks for your time!
Alberto16 May 2019 at 18 h 35 min #13488
I’m working under Windows as well (using VS2015 and Boost 1.62).
If everything is going well during the CMake configuration, Boost should be detected automatically, and the name of the corresponding libraries (such as boost_program_options-vc141-mt-x64-1_66.lib) should be filled automatically as well by CMake. To check what the real name of the library is, you can explore directly the Boost installation directory, where you should find the libraries in “lib64-msvc-14.1/”.
What can happen is that Boost is not automatically detected by CMake. In this case, you can add an entry in CMake containing the path of your Boost installation folder. The procedure is detailed here:
Running “Configure” again should then set up the library files with the correct names.
Does this correspond to your problem?
Camille17 May 2019 at 12 h 04 min #13489
I think I did that part ok. Here is a screenshot of the build
I’m trying to build SOFA with boost 1.70, since the compiler said that it found boost 1.66 an older version. But the problem still persists:
Error LNK1104 cannot open file ‘boost_program_options-vc141-mt-x64-1_70.lib’ SofaHelper
Is curious, if I go to SOFA –> Properties –> Linker –> Input and see Additional Dependences, it’s looking for libboost_… and not for boost_….
Update: if I duplicate the .lib and change the name into boost_… and also change the input path to locate the boost_… … it seems to work! but now it also fails with the filesystem . Do I have to manually change every library path? :S
Update2: Didn’t work for boost_date_time lib.
Alberto17 May 2019 at 16 h 27 min #13502
Thanks for the additional details. I’m no specialist, but I’m puzzled by the values that CMake gives to the Boost library directories in the screenshot you sent:
Boost_LIBRARY_DIR_DEBUG = “C:/Program Files/boost/boost_1_66_0/stage/lib”
Boost_LIBRARY_DIR_RELEASE = “C:/Program Files/boost/boost_1_66_0/stage/lib”
In my Boost installation directory, there is no ‘stage’ directory mentioned above. And so my variables in CMake look like:
Boost_LIBRARY_DIR_DEBUG = “C:/dev/boost/boost_1_66_0/lib64-msvc-14.1”
Boost_LIBRARY_DIR_RELEASE = “C:/dev/boost/boost_1_66_0/lib64-msvc-14.1”
Regarding your updates, if I’m not mistaking, the problem is that the libboost_xxx.lib files are the static versions of the boost libraries, while VS is trying to link dynamic libraries (of the form boost_xxx.lib). If so, changing the name of the library won’t change the fact that it is static, which doesn’t correspond to what the linker is looking for.
What you can try is to locate the dynamic boost libraries (such as boost_program_options-vc141-mt-x64-1_66.lib) in your Boost installation directory and manually change the CMake variables accordingly. That is:
– go in C:/Program Files/boost/boost_1_66_0/ and check whether you find the “lib64-msvc-14.1/” directory there;
– if you do, check that you find the dynamic libraries inside (boost_xxx.lib);
– if everything is there, you can try to manually change the values of CMake as:
Boost_LIBRARY_DIR_DEBUG = “C:/Program Files/boost/boost_1_66_0/lib64-msvc-14.1”
Boost_LIBRARY_DIR_RELEASE = “C:/Program Files/boost/boost_1_66_0/lib64-msvc-14.1”
and run Configure again, to see if CMake finds the dynamic libraries or goes back to the libboost_xxx.lib version.
Tell me how it goes.
Camille17 May 2019 at 17 h 36 min #13516
Maybe you downloaded the precompiled version of boost for visual studio 14.1, right? I downloaded the general version and built it. Still, I don’t know why I don’t have any directory called “/lib64-msvc-14.1”.
I’m downloading the prebuilt version, so let me try and see what happens with this one :). I’ll tell you any updates as soon as I have them!
Thank you a lot!
Alberto17 May 2019 at 18 h 12 min #13517
Indeed I used the pre-built Windows binaries! (which I got here, just in case)
I’ve never tried to build Boost from the source code to then use the libraries in SOFA, but if the installation directory is not the same, I guess it can cause some issues with SOFA CMakefiles.
I hope it works fine with the binaries!
Camille22 May 2019 at 16 h 12 min #13523
It worked! Thank you very much!
Sorry for the delay with the answer 🙂
Alberto23 May 2019 at 10 h 03 min #13526
No problem, the most important is that you could solve your problem 🙂
Glad it worked!
- You must be logged in to reply to this topic.