As I understand I need to add/link the library in the CMAKELists.txt file.
It is exactly what you have to do :)
In C++, you have two kinds of files to use when you include a library to your project:
- header files, where the names of symbols are declared (like a list of words)
- object files, where the code stands (like a dictionary where the words are actually defined)
(this is a little bit simplified but it is not important here)
The error message tells you that you do not provide the object files to the compiler, so it does not know what some words (classes and functions) you use in your project mean.
If you are building an executable named MyExecutable
, you must have a line like
add_executable(MyExecutable ...)
in your CMakeLists.txt
.
AFTER this line, try to add
target_link_libraries(MyExecutable curlpp)
I you already have a target_link_libraries()
line for the MyExecutable
target, just add curlpp
to the others libraries.