Solved Building Cmake Qt Project on MAC OS with Plugins fails in linker
-
Hey Guys,
I have been working on an open source application for over a year now and on linux everything is building and working as expected. But since some people at our research group are using MAC OS I am trying to build the application on that platform as well.
Sadly building on MAC OS fails with a linker error. More explicitly the building of the plugins fail, telling me that it cannot not find certain symbols which are part of the main application. Any help or pointers would be greatly appreciated. The source code of the application can be found on Github at (https://github.com/ORB-HD/rbdl-toolkit).
Kind regard,
ju6ge -
Hi and welcome to devnet,
I'd say your issue comes from the fact that you are trying to link your plugins against an application.
The correct way to do these things would rather be to have your shared code in a library that you use for both your application and your plugins.
-
Hi and welcome to devnet,
I'd say your issue comes from the fact that you are trying to link your plugins against an application.
The correct way to do these things would rather be to have your shared code in a library that you use for both your application and your plugins.
-
Just did a more or less quick test and I can confirm. Separating the sources in a library and application allows to build properly.
-
Thanks for the reply, and yea that seem like the cleaner solution. Since I did not need to do that for the linux version I had hoped that there is some flag that would make it just work for MAC as well. But then again it isn't really that much work to change it.
-
IIRC, there were three files to change for the build to work. No need to move anything around.
If I may, while working, your CMake code does not follow the latest guidelines. You might want to consider updating it at the same time.