Home › Forum › SOFA › Building SOFA › [SOLVED] [Solved] Link problems
Tagged: 64_bits, SOFA_1812, VS2017, Windows_10
- This topic has 7 replies, 2 voices, and was last updated 5 years, 5 months ago by CamilleK.
-
AuthorPosts
-
16 May 2019 at 17:55 #13487StremieBlocked
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=sharingThanks for your time!
Alberto16 May 2019 at 18:35 #13488CamilleKBlockedHi Alberto,
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:
SOFA documentation
Running “Configure” again should then set up the library files with the correct names.Does this correspond to your problem?
Cheers,
Camille
17 May 2019 at 12:04 #13489StremieBlockedHi Camille,
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’ SofaHelperIs 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.
Thanks!
Alberto17 May 2019 at 16:27 #13502CamilleKBlockedHi Alberto,
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.
Cheers,
Camille
17 May 2019 at 17:36 #13516StremieBlockedMaybe 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:12 #13517CamilleKBlockedIndeed 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!
Cheers,
Camille22 May 2019 at 16:12 #13523StremieBlockedIt worked! Thank you very much!
Sorry for the delay with the answer 🙂
Alberto
23 May 2019 at 10:03 #13526CamilleKBlockedNo problem, the most important is that you could solve your problem 🙂
Glad it worked!
Camille
-
AuthorPosts
- You must be logged in to reply to this topic.