c++ - 没有 make 运行 qpid c 示例的方法有哪些?

标签 c++ apache message-queue

有哪些方法可以在不使用 make 的情况下运行 apache qpid c++ helloworld 示例,并且通过使用 g++ 我需要创建一个 helloworld.o 目标文件如何执行这些操作?

g++ -I ./includes/-o m hello_world.cpp

/tmp/cc9Jao8f.o: In function `main':
hello_world.cpp:(.text+0x169): undefined reference to `qpid::messaging::Connection::Connection(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
hello_world.cpp:(.text+0x178): undefined reference to `qpid::messaging::Connection::open()'
hello_world.cpp:(.text+0x1a1): undefined reference to `qpid::messaging::Connection::createSession(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
hello_world.cpp:(.text+0x1e8): undefined reference to `qpid::messaging::Session::createReceiver(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
hello_world.cpp:(.text+0x205): undefined reference to `qpid::messaging::Session::createSender(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
hello_world.cpp:(.text+0x239): undefined reference to `qpid::messaging::Message::Message(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
hello_world.cpp:(.text+0x254): undefined reference to `qpid::messaging::Sender::send(qpid::messaging::Message const&, bool)'
hello_world.cpp:(.text+0x267): undefined reference to `qpid::messaging::Message::~Message()'
hello_world.cpp:(.text+0x27b): undefined reference to `qpid::messaging::Message::~Message()'
hello_world.cpp:(.text+0x2d6): undefined reference to `qpid::messaging::Duration::SECOND'
hello_world.cpp:(.text+0x2db): undefined reference to `qpid::messaging::operator*(qpid::messaging::Duration const&, unsigned long)'
hello_world.cpp:(.text+0x2f7): undefined reference to `qpid::messaging::Receiver::fetch(qpid::messaging::Duration)'
hello_world.cpp:(.text+0x30d): undefined reference to `qpid::messaging::Message::getContent() const'
hello_world.cpp:(.text+0x366): undefined reference to `qpid::messaging::Session::acknowledge(bool)'
hello_world.cpp:(.text+0x375): undefined reference to `qpid::messaging::Connection::close()'
hello_world.cpp:(.text+0x389): undefined reference to `qpid::messaging::Message::~Message()'
hello_world.cpp:(.text+0x39f): undefined reference to `qpid::messaging::Message::~Message()'
hello_world.cpp:(.text+0x3bb): undefined reference to `qpid::messaging::Sender::~Sender()'
hello_world.cpp:(.text+0x3d2): undefined reference to `qpid::messaging::Sender::~Sender()'
hello_world.cpp:(.text+0x3e8): undefined reference to `qpid::messaging::Receiver::~Receiver()'
hello_world.cpp:(.text+0x3ff): undefined reference to `qpid::messaging::Receiver::~Receiver()'
hello_world.cpp:(.text+0x415): undefined reference to `qpid::messaging::Session::~Session()'
hello_world.cpp:(.text+0x42c): undefined reference to `qpid::messaging::Session::~Session()'
hello_world.cpp:(.text+0x483): undefined reference to `qpid::messaging::Connection::close()'
hello_world.cpp:(.text+0x4b5): undefined reference to `qpid::messaging::Connection::~Connection()'
hello_world.cpp:(.text+0x4cc): undefined reference to `qpid::messaging::Connection::~Connection()'
collect2: ld returned 1 exit status

最佳答案

您只需要链接到图书馆。例如,如果库名为 libqpid.so,您可以将 -lqpid 添加到构建命令中。

关于c++ - 没有 make 运行 qpid c 示例的方法有哪些?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15568635/

相关文章:

java - org.apache.maven.archiver.MavenArchiver.getManifest(org.apache.maven.project.MavenProject,org.apache.maven.archiver.MavenArchiveConfiguration)

azure - 即使队列有数千条消息,服务总线 QueueClient 返回空代理消息

c++ - 在 C++ 中如何解决这些名称冲突?

linux - 如何复制所有 .conf 文件并在 ubuntu-apache 环境中启用它们中的每一个

c++ - 如何在 Mac 上编写 C++?

PHP 5.5.6 随机内存泄漏

Azure 由内而外的连接

.net - 了解 Azure 消息队列中的有害消息处理并在逻辑应用中使用它

c++ - 使用帧指针优化进行调试

c++ - 是否可以对容器的容器使用大括号括起来的初始化列表?