I was trying to integrate it with another Cmakelists.txt and couldn't get it working, here are the codes, the commented section also generates same error:
pragma warning(push, 0)
include <SimpleAmqpClient/SimpleAmqpClient.h>
pragma warning(pop)
using namespace AmqpClient;
constexpr auto QUEUE_NAME = "hello";
//rabbitmq-cpp library
// auto channel = AmqpClient::Channel::Create();
// channel->DeclareQueue(QUEUE_NAME, false, true, false, true);
// auto message = AmqpClient::BasicMessage::Create("Hello World!");
// channel->BasicPublish("", QUEUE_NAME, message);
I get the errors undefined reference to `AmqpClient in all the instances of SimpleAmqpClient library. could someone please tell me what is wrong and how to link the library correctly? TiA
I was trying to integrate it with another Cmakelists.txt and couldn't get it working, here are the codes, the commented section also generates same error:
pragma warning(push, 0)
include <SimpleAmqpClient/SimpleAmqpClient.h>
pragma warning(pop)
using namespace AmqpClient; constexpr auto QUEUE_NAME = "hello"; //rabbitmq-cpp library // auto channel = AmqpClient::Channel::Create(); // channel->DeclareQueue(QUEUE_NAME, false, true, false, true); // auto message = AmqpClient::BasicMessage::Create("Hello World!"); // channel->BasicPublish("", QUEUE_NAME, message);
AmqpClient::Channel::ptr_t connection = AmqpClient::Channel::Create("localhost"); AmqpClient::Channel::ptr_t channel; std::string consumer_tag = channel->BasicConsume("my_queue", ""); AmqpClient::Envelope::ptr_t envelope = channel->BasicConsumeMessage(consumer_tag);
Here is the Cmakelist.txt
cmake_minimum_required(VERSION 3.19)
set (CMAKE_CXX_STANDARD 17)
project(OsqpEigen-Example) include_directories('/usr/local/include/')
find_package(OsqpEigen) find_package(Eigen3) find_library(libSimpleAmqpClient REQUIRED) include_directories(${libSimpleAmqpClient++_INCLUDE_DIRS}) set(LIBS ${LIBS} ${libSimpleAmqpClient++_LIBRARIES})
include_directories(SYSTEM ${EIGEN3_INCLUDE_DIR})
Add SimpleAMQP library headers
include_directories(/usr/local/include/SimpleAmqpClient)
Add RabbitMQ library headers
include_directories(/usr/local/include/rabbitmq-c)
MPCExample
add_executable(OsqpEigen-Example src/MPCExample.cpp) target_link_libraries(OsqpEigen-Example ${LIBS} OsqpEigen::OsqpEigen)
target_link_libraries(OsqpEigen-Example ${LIBS})
target_link_libraries(OsqpEigen-Example /usr/local/lib/librabbitmq.so)
target_link_libraries(OsqpEigen-Example /usr/local/lib/librabbitmq.so.4)
target_link_libraries(OsqpEigen-Example /usr/local/lib/librabbitmq.so.0.12.0)
target_link_libraries(OsqpEigen-Example /usr/local/lib/libSimpleAmqpClient.so.7)
target_link_libraries(OsqpEigen-Example /usr/local/lib/libSimpleAmqpClient.so.7.0.1)
I get the errors undefined reference to `AmqpClient in all the instances of SimpleAmqpClient library. could someone please tell me what is wrong and how to link the library correctly? TiA