当尝试编译我的c ++项目时,编译器退出,并在ZMQ的poller.ipp中出现错误。我做错什么了吗,我需要其他编译器标志或其他东西吗?

我已经使用brew install czmqpp安装了c ++绑定(czmqp ++)

系统:Mac OSX 10.11.5

当我尝试使用以下命令进行编译时,这是输出:

> gcc -Wall -o HardwareHub HardwareHub.cpp

In file included from HardwareHub.cpp:4:
In file included from ./ZMQCommunicator.h:3:
In file included from /usr/local/include/czmq++/czmqpp.hpp:28:
In file included from /usr/local/include/czmq++/poller.hpp:48:
/usr/local/include/czmq++/impl/poller.ipp:29:19: error: expected expression
    auto unmask = [](socket& s)
                  ^
1 error generated.


先感谢您

最佳答案

您需要使用c ++编译器,而不是c编译器:


> gcc -Wall -o HardwareHub HardwareHub.cpp



应该

> g++ -Wall -o HardwareHub HardwareHub.cpp




如果您当前安装的GCC版本不支持当前的c ++标准使用

> g++ -std=c++11 -Wall -o HardwareHub HardwareHub.cpp

关于c++ - 尝试编译时,ZMQ的poller.ipp错误,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/37885939/

10-11 20:15