I am trying to build my Project using cmake. With 3rd Party headerfiles and libarys. The headers are in /usr/local/include/
and the libary in /usr/local/lib/
. And I think the compiler finds the files because I get no error on the includes but when I try to compile it it doesn´t find the functions I´m calling.
/mnt/c/Users/Max/CLionProjects/Lightning_Controller/main.cpp:12: undefined reference to `ola::InitLogging(ola::log_level, ola::log_output)'
/usr/bin/ld: /mnt/c/Users/Max/CLionProjects/Lightning_Controller/main.cpp:13: undefined reference to `ola::DmxBuffer::DmxBuffer()'
/usr/bin/ld: /mnt/c/Users/Max/CLionProjects/Lightning_Controller/main.cpp:14: undefined reference to `ola::DmxBuffer::Blackout()'
/usr/bin/ld: /mnt/c/Users/Max/CLionProjects/Lightning_Controller/main.cpp:17: undefined reference to `ola::client::StreamingClient::StreamingClient(ola::client::StreamingClient::Options const&)'
/usr/bin/ld: /mnt/c/Users/Max/CLionProjects/Lightning_Controller/main.cpp:19: undefined reference to `ola::client::StreamingClient::Setup()'
/usr/bin/ld: /mnt/c/Users/Max/CLionProjects/Lightning_Controller/main.cpp:26: undefined reference to `ola::DmxBuffer::SetChannel(unsigned int, unsigned char)'
/usr/bin/ld: /mnt/c/Users/Max/CLionProjects/Lightning_Controller/main.cpp:27: undefined reference to `ola::client::StreamingClient::SendDmx(unsigned int, ola::DmxBuffer const&)'
/usr/bin/ld: /mnt/c/Users/Max/CLionProjects/Lightning_Controller/main.cpp:34: undefined reference to `ola::client::StreamingClient::~StreamingClient()'
/usr/bin/ld: /mnt/c/Users/Max/CLionProjects/Lightning_Controller/main.cpp:34: undefined reference to `ola::DmxBuffer::~DmxBuffer()'
/usr/bin/ld: /mnt/c/Users/Max/CLionProjects/Lightning_Controller/main.cpp:34: undefined reference to `ola::client::StreamingClient::~StreamingClient()'
/usr/bin/ld: /mnt/c/Users/Max/CLionProjects/Lightning_Controller/main.cpp:34: undefined reference to `ola::DmxBuffer::~DmxBuffer()'
collect2: error: ld returned 1 exit status
If I compile it with G++ and this parameters g++ main.cpp -lola -lolacommon -lprotobuf
it works.
I tried to use the Option Mentioned in this Post but it didn´t change anything.
My Question is how do i translate this from g++ to cmake ?