-
I'm trying to set up a build with a 3rd party library. The overall project will be a simple NAppGui, so I've started with the basic hello world and got that to work. I now want to add a subdirectory "myLibrary" that contains a myLibrary.h and myLibrary.c file (this is a simplification, but it is a 3rd party project I want to statically link and call from my NAppGui). I've tried various combinations of CMakeLists files and functions (getting things like "CMake can not determine linker language for target: myLibrary") , as well as simply compiling the library separately and adding it as a dependency in the normal way (in the case, using the same compiler it looks like it is not generating the same decorated names in the library that the NAppGui object file is expecting, and linking fails). I can't see an example in the demos for doing this, so I'm hoping there are simple additions to the hello world CMakeLists and the correct CMakeList that needs to go into the myLibrary subdirectory that someone can point me to. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi @mdsw. Thanks for use NAppGUI-SDK. To link with external libraries you have to include the appropiates CMake commands into your app
You can also check this closed issue: #25 |
Beta Was this translation helpful? Give feedback.
Hi @mdsw. Thanks for use NAppGUI-SDK.
To link with external libraries you have to include the appropiates CMake commands into your app
CMakeLists.txt
target_link_libraries
: https://cmake.org/cmake/help/latest/command/target_link_libraries.html.target_include_directories
: https://cmake.org/cmake/help/latest/command/target_include_directories.htmlYou can also check this closed issue: #25