I don't have experience with C++, and only need to make a small adjustment to a C++ application to do a HTTP request to authenticate a user.
Curlpp is an option, but when including the libraries I get an error on building:
Undefined symbols for architecture x86_64:
"curlpp::OptionBase::OptionBase(CURLoption)", referenced from:
app_idomsconnector::RTMPAppProtocolHandler::GetAuthPassword(std::string) in libidomsconnector.a(rtmpappprotocolhandler.cpp.o)
curlpp::OptionTrait<std::string, (CURLoption)10002>::clone() const in libidomsconnector.a(rtmpappprotocolhandler.cpp.o)
As I understand I need to add/link the library in the CMAKELists.txt file. Can anybody tell me what exactly I need to add? (running OSX 10.8) As I mentioned, I have no experience with C++, as I use Java most of the time.
a. This "cmake and make" stuffs actually use g++ / gcc in its implementation.
Visual Studio's native support for CMake enables you to edit, build, and debug CMake projects on Windows, the Windows Subsystem for Linux (WSL), and remote systems from the same instance of Visual Studio. CMake project files (such as CMakeLists.
In the C/C++ ecosystem, the best tool for project configuration is CMake. CMake allows you to specify the build of a project, in files named CMakeLists. txt, with a simple syntax (much simpler than writing Makefiles).
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:
(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)
If you already have a target_link_libraries()
line for the MyExecutable
target, just add curlpp
to the others libraries.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With