Я клонировал репозиторий activemq-cpp https://github.com/apache/activemq-cpp и выполнил его все инструкции по установке на мою машину.
Я создал оболочку .cpp, которая позволяет мне импортировать ее с помощью Go, которую я могу успешно вызвать.
Вот обертка
Код: Выделить всё
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
extern "C" {
// Initialize ActiveMQ library
void ActiveMQCPPInitializeLibrary() {
activemq::library::ActiveMQCPP::initializeLibrary();
}
// Shutdown ActiveMQ library
void ActiveMQCPPShutdownLibrary() {
activemq::library::ActiveMQCPP::shutdownLibrary();
}
// Create a connection to ActiveMQ
void* CreateConnection(const char* brokerURI) {
try {
decaf::lang::System::setProperty( "decaf.net.ssl.disablePeerVerification", "true" );
auto factory = std::make_unique(brokerURI);
cms::Connection* connection = factory->createConnection();
return (void*)connection;
} catch (const cms::CMSException& e) {
std::cerr
Подробнее здесь: [url]https://stackoverflow.com/questions/79342003/error-apr-pool-t-does-not-name-a-type-did-you-mean-aprpool[/url]