Hello everyone, I’ve imported Choreonoid into QTcreator for developing my plugin. I would like to add a Qcustomplot tool to my custom Choreonoid plugin, and my cmakelist.txt for the plugin is as follows:
I have tested similiar cmakelist in a seperate project and I have worked with qcustom plot in cmake and it works, however during building this cmakelist within choreonoid I have reicived the following error:
In file included from /home/milad/software/choreonoid/choreonoid-1.6.0/sample/SURENA/Sources/qcustomplot.cpp:26:0:
/home/milad/software/choreonoid/choreonoid-1.6.0/sample/SURENA/Headers/qcustomplot.h:725:1: error: 'signals' does not name a type
signals:
As written in the link above, most standard way to avoid this problem is to disable the Qt “signal” keyword by adding “no_keyword” option to the compiler. Choreonoid CMakeList.txt is already configured to add this option (that is why you face with the compile error).
You will have to use “Q_SLOTS” macro instead of “signal” under this configuration as shown in the example below.
Thank you very much. I’ve changed emit to Q_EMITS, forearch to Q_FOREACH and signals to Q_SIGNALS and the problem solved.
I need a Qwidget to correspond the Qcustomplot to this. By this mean at a first step, I’ve tried to make a simple plugin that by clicking a button it opens new empty window however after running Choreonoid when I click on the button, the Choreonoid window will close and will exit and give the following error.
symbol lookup error: /home/milad/software/choreonoid/choreonoid-1.6.0/lib/choreonoid-1.6/libCnoidHelloWorldPlugin.so: undefined symbol: _ZN11MainWindow1C1EP7QWidget
( It just a simple code that opens the empty form by clicking a button in Choreonoid) my codes are as following: cmakelists.txt:
In your CMakeLists.txt file, I see you are trying to create two shared libraries (“CnoidHelloWorldPlugin” and “choreonoidsurena2”).
I think the reason of the error is the function MainWindow1::MainWindow1(QWidget*) only exist in “choreonoidsurena2” library and is not installed in the place where Choreonoid can find.
Suggestion: Why not compile the plugin into a single library?