- This topic has 1 reply, 2 voices, and was last updated 7 years ago by .
Viewing 2 posts - 1 through 2 (of 2 total)
Viewing 2 posts - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.
Home › Forum › SOFA › Using SOFA › Problem with Sofa path
Tagged: Installation error, SOFA, Windows10
I’m trying to create a new plugin in SOFA, but I get an error when I compile it.
/home/as/sofa/src/applications/plugins/SerialComunication/initSerial.cpp:22:39: fatal error: sofa/helper/system/config.h: No such file or directory
#include <sofa/helper/system/config.h>
^
In file included from /home/as/sofa/src/applications/plugins/SerialComunication/SerialDriver.cpp:1:0:
/home/as/sofa/src/applications/plugins/SerialComunication/SerialDriver.h:1:46: fatal error: sofa/core/objectmodel/BaseObject.h: No such file or directory
#include <sofa/core/objectmodel/BaseObject.h>
I followed the tutorial for creating a new plugin from the SOFA documentation. I don’t know why SOFA can’t find that path.
In advance I appreciate the help you can provide me.
Hi Wendy,
It seems the Sofa’s include directory was not added to your project compilation.
Are you using CMake to configure your plugin compilation? If that’s the case, then you should have somewhere in your CMakeLists.txt file:
find_package(SofaGeneral REQUIRED)
find_package(SofaBase REQUIRED)
That should automatically add the sofa’s include directory to your project.
Also, the installation path of sofa should be used as the cmake prefix path in order for it to find SofaGeneral and SofaBase. For example, if your Sofa’s installation path is “/home/wendy/sofa/build/install”, you would run cmake on your project with:
cmake -DCMAKE_PREFIX_PATH=/home/wendy/sofa/build/install/lib/cmake CMakeLists.txt
Let me know if that helped.
WARNING
The forum has been moved to GitHub Discussions.
Old topics and replies are kept here as an archive.