Home › Forum › SOFA › Building SOFA › Unable to build main.cpp in SofaPhysicsAPI
Tagged: GCC, Linux_ubuntu, SOFA_2012, SofaPhysicsAPI
- This topic has 5 replies, 2 voices, and was last updated 4 years, 7 months ago by
Hugo.
-
AuthorPosts
-
11 April 2021 at 03:16 #19130
Olumide
BlockedI 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 112 April 2021 at 13:17 #19144Hugo
KeymasterHi @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
13 April 2021 at 03:23 #19148Olumide
BlockedHi @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
13 April 2021 at 18:45 #19155Hugo
KeymasterHi @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
14 April 2021 at 01:37 #1916014 April 2021 at 12:45 #19162Hugo
KeymasterPlease see here @olumide : https://www.sofa-framework.org/community/doc/programming-with-sofa/sofa-packages/
Best
Hugo
-
AuthorPosts
- You must be logged in to reply to this topic.
