Unable to locate SimpleAmqpClient library for the C++ project on OSX -


i try use simpleamqpclient library build multi-agent environment simulation. have installed library after cloning sources, making them:

make sudo make install 

after that, created

main.cpp

file:

#include <iostream> #include <simpleamqpclient/simpleamqpclient.h> using namespace std;  int main() {     cout << "hello, world!" << endl;     return 0; } 

just try out.

also, have following

cmakelists.txt:

cmake_minimum_required(version 3.3) project(sampleproject) include_directories('/usr/local/include/')  find_package(libsimpleamqpclient required) include_directories(${libsimpleamqpclient++_include_dirs}) set(libs ${libs} ${libsimpleamqpclient++_libraries})  set(cmake_cxx_flags "${cmake_cxx_flags} -std=c++11")  set(source_files main.cpp) add_executable(sampleproject ${source_files}) 

so, question is: how find , link library.

you need include line

target_link_libraries(sampleproject ${libs}) 

after line

add_executable(sampleproject ${source_files}) 

this imbues target sampleproject properties tell generator generate linker command reference libraries need.


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -