- This topic has 5 replies, 2 voices, and was last updated 3 years, 7 months ago by .
Viewing 6 posts - 1 through 6 (of 6 total)
Viewing 6 posts - 1 through 6 (of 6 total)
- You must be logged in to reply to this topic.
Home › Forum › SOFA › Building SOFA › Unable to build main.cpp in SofaPhysicsAPI
Tagged: GCC, Linux_ubuntu, SOFA_2012, SofaPhysicsAPI
I added the line add_executable(App main.cpp)
to applications/projects/SofaPhysicsAPI/CMakeLists.txt and reconfigured sofa using the UI. Here is the resulting error:
In file included from /home/Olumide/Downloads/src/sofa-src/sofa/src/applications/projects/SofaPhysicsAPI/main.cpp:22:0:
/home/Olumide/Downloads/src/sofa-src/sofa/src/applications/projects/SofaPhysicsAPI/SofaPhysicsAPI.h:25:10: fatal error: SofaGeneral/config.h: No such file or directory
#include <SofaGeneral/config.h>
^~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
applications/projects/SofaPhysicsAPI/CMakeFiles/Test.dir/build.make:81: recipe for target 'applications/projects/SofaPhysicsAPI/CMakeFiles/Test.dir/main.cpp.o' failed
make[2]: *** [applications/projects/SofaPhysicsAPI/CMakeFiles/Test.dir/main.cpp.o] Error 1
Hi @olumide
What are you changing the SofaPhysicsAPI from a library to an executable project? I am not sure to follow you.
Regarding SofaGeneral, it is also a deprecated collection (see #1596). It must be replaced by the appropriate package (e.g. SofaGeneralEngine, SofaGeneralDeformable etc.) depending on which is needed. These needed SofaGeneralEngine*.so should be explicit in the CMakeLists.txt (find_package + add_library).
Best,
Hugo
Hi @hugo,
I did not change SofaPhysicsAPI from a library to an executable project. I merely added an option to also compile an executable (from main.cpp) in addition to the library. It was just a test though, I’ll remove it.
I’m not sure that I understand the changes that I’m supposed to make regarding SofaGeneral. I’m going to have to study the project structure of sofa some more.
Regards,
– Olumide
Hi @olumide
You make me think that we should provide more insight about the CMake package organization (e.g. knowing which code is located in which package). We will work on this.
Best,
Hugo
Please see here @olumide : https://www.sofa-framework.org/community/doc/programming-with-sofa/sofa-packages/
Best
Hugo
WARNING
The forum has been moved to GitHub Discussions.
Old topics and replies are kept here as an archive.