13 June 2019 at 15 h 50 min #13667
I’m trying to build Sofa in VS 2019, but get errors mainly for the glew files
On the website, I found download links for the Windows Dependency Pack for VS 2015 and VS 2017. I downloaded the one for 2017, but it still doesn’t work. I’m not sure whether it is the wrong pack or whether I copied it to the wrong directory? Is there a pack for VS 2019? I copied all three folders (include, lib and licences) directly into the sofa/src/ directory – is that what I’m supposed to do?
Update: I’ve added the include directory to the include path in VS, plus to the lib path to the additional library directories of the Linker menu, and the glew32.lib file to the Linker > Input > Additional Dependencies.
Besides, I copied the glew32.dll to my system32 path.
Update: We’ve solved some of the issues. The glew.h issue was solved by copying the files from the windows dependency pack to the build directories (include/lib), which is not mentioned in the documentation? There it says that you have to unzip it in the src directory.
Besides, some of the LINK errors (lib files) were due to privilege issues. We solved it by transferring the project to a subdirectory of C:, because we obviously do not have full privilege for C: (?).
However, some of the link errors persist. We also realized that CMake (V 3.15) cannot detect boost, and even if we enter the path manually to the variables, it will be removed as soon as we configure. We tried to install and work with V 3.9 since we’ve read that V 3.11 had problems with detecting boost and that we should downgrade to 3.9. However, this did not work at all. We therefore upgraded again to 3.15. What is the best/default location to install boost? Does anyone have an idea what the problem could be with CMake and Boost? Boost V 1.70
Thank you in advance!14 June 2019 at 18 h 52 min #13690HugoKeymaster
- SOFA Consortium
Hi @taro and welcome on the SOFA forum !
I am no big Windows user, but boost can be installed anywhere. Then, to solve Boost detection errors, click on Add Entry and add
BOOST_ROOTwith type PATH and value
C:/boost/boost_1_XX_Xmatching your Boost lib folder. Example:
BOOST_ROOT=C:/boost/boost_1_61_0and Configure again.
This is detailed in the Win documentation.
Let me know if it helps.
Hugo17 June 2019 at 7 h 15 min #13727
Thank you! We’ve followed the documentation in detail for several times, including the step with the BOOST_ROOT, but unfortunately this did not help.
Tabitha17 June 2019 at 16 h 37 min #13744
I just managed to compile it, but honestly, I’m not sure what the key was. There is another error coming up now when I try to run runSofa.exe, I will open up a new topic for that. But just in case someone has the same errors, here is what I did (as far as I remember 🙂 ):
– Install QT 4.9.1, VS 2019, Boost 1.70, the windows dependency pack linked in the documentation
– Added the variables to my path (environment variables):
in my case
– Cloned SOFA from the Git as described in the documentation
– Copied the files from the include folder from the windows dependency pack into the include directory in sofa/src/
– Opened the CMake GUI and followed the steps in the documentation, including setting the BOOST_ROOT to C:\local\boost_1_70_0\lib64-msvc-14.2 and the CMAKE_CONFIGURATION_TYPE to Release only. After configuration and generation, I also copied the files in the include folder of the Windows Dependency Pack to the sofa/build/include directory. This step is not mentioned in the documentation.
– I then opened Sofa.sln in VS 2019 and built the solution.
– Copy the lib files from the windows dependency pack to the sofa/build/bin/Release directory
I now get a Sig 22 – SIGABRT error when trying to run runSofa.exe.17 June 2019 at 17 h 16 min #13745NouraParticipant
I join Thabita clarifying the current state of configuring Sofa since that we are trying it together.
As @taro has already mentioned, the compilation is fine right now. However, a run time error happens when executing runSofa.exe, and which is probably related to the
qwindows.dllwhich can not be located! I include the complete error message:
[INFO] [GUIManager] INFO(SofaGUI): lastUsedGUI.ini not found; using default GUI. This application failed to start because it could not find or load the Qt platform plugin "windows" in "". Reinstalling the application may fix this problem. ########## SIG 22 - SIGABRT: usually caused by an abort() or assert() ##########
I noticed that a similar error was posted long time ago on the <a href=”http://www.sofa-framework.org/community/forum/topic/sofa-cannot-be-executed-modelerrunsofa/”>threqd</a>
I tried the temporary solution suggested by @guillaumeparan and placed the “plugins/platforms” copied from
Qt/5.12.3/msvc2017_64/plugins/platformsinside the sofa bin folder, but this did not unfortunately solved the issue.
However, I noticed that our Sofa project is created using visual studio 2019 to which our Qt version does not has specific dll libraries! Could this be an issue between QT and MSVS versions?
Any experinence facing similar issues is welcomed!
Noura19 June 2019 at 15 h 01 min #13783
Has anyone ever successfully compiled SOFA on Windows with VS 2019?
We’re slowly running out of ideas.
First, CMake automatically uses the QT version of Anaconda, which is version 5.9.7. We cannot update it there to the latest version (5.13), removal of QT from the environment (base(root)) is also not possible.
Second, when downloading and installing the latest QT version (5.13), there are no libraries for VS2019, we only have a folder called msvc2017_64 (and few others, but none for 2019). So we assume that even if we would get CMake to use this version of QT, it would not work with VS2019.
We also tried to compile it with VS2017 and Boost 1.64, but got some linking errors in VS which we could not resolve until now.
Every help and hint would be really appreciated, after 1 week of doing nothing else our brains are slowly going crazy. 🙂 Thank you in advance!
Tabitha19 June 2019 at 18 h 39 min #13787GuillaumeKeymaster
- SOFA Consortium
I’ll try to answer some of your questions.
The WinDepPack has to be unzipped in the sources of SOFA. It ADDS “include”, “lib” and “licenses” folders (they do not exist before).
On my machine, the only variable I need to find Boost is BOOST_ROOT. I don’t have any Boost in my PATH, I don’t have any Qt in my PATH. Thus, I don’t understand why it doesn’t work on some configurations.
Boost detection by CMake is broken at nearly every new version of Boost. It’s a pain. If your CMake cannot detect your Boost, try to upgrade your CMake or downgrade your Boost.
All needed Qt plugins should be copied to your bin directory but it may be problematic if you are using Visual Studio IDE because of its
bin/<config>file structure. Do you have the folders “iconengines”, “imageformats”, “platforms” and “styles” in your bin directory?
Indeed, there is no Qt binaries for VS2019 yet as you can see here: https://doc.qt.io/qt-5/windows.html#supported-configurations
But you still can compile your own Qt with VS2019 if you really want to use this compiler.
Hope that helps,
Guillaume.20 June 2019 at 11 h 23 min #13802
Thank you so much for your help!
We did not have the mentioned folders in the bin, so we took them from the Anaconda directory and placed them in the bin. This almost solved the problem, so we don’t get error messages anymore. The SOFA GUI is loaded, but it’s all white and not responding.
PS – We are running runSofa_d.exe (Debug mode).
Do you know this problem?
Tabitha20 June 2019 at 12 h 08 min #13818
We managed to run it!!
We built in Release mode and followed Guillaumes instructions by placing the plugin folders in the bin/Release folder and it works perfectly.
Thank you Hugo & Guillaume for your help!!20 June 2019 at 15 h 23 min #13834
- You must be logged in to reply to this topic.