尝试编译时 ZMQ 的 poller.ipp 中出现错误
Error in ZMQ's poller.ipp when trying to compile
尝试编译我的C 项目时,编译器在ZMQ的Poller.ipp中带有错误的编译器退出。我在做错什么吗,我需要其他编译器标志或其他内容吗?
我已经使用brew install czmqpp
系统: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
相关文章:
- 警告处理为错误这里有什么问题
- "error: no matching function for call to"构造函数错误
- boost::进程间消息队列引发错误
- C++,OpenCV,尝试显示图像时"OpenCV(4.3.0) Error: Assertion failed (size.width>0 && size.height>0)"此错误
- 有关插入适配器的错误。[错误]请求从 'back_insert_iterator<vector<>>' 类型转换为非标量类型
- QT在错误的班级中寻找空位
- vector.resize()中的分配错误
- 代码在main()中运行,但在函数中出现错误
- 释放错误后堆使用
- (C++)分析树以计算返回错误值的简单算术表达式
- Project Euler问题4的错误解决方案
- 我的字符计数代码计算错误.为什么
- 从"int*"强制转换为"unsigned int"会丢失精度错误
- 尝试导入pybind-opencv模块时出现libgtk错误
- CMake项目Boost库错误:Boost/config/compiler/gcc.hpp:165:10:致命错误:cs
- 在某些循环内使用vector.push_back时出现分段错误
- MSVC多行宏编译器错误
- 静态数据成员的问题-修复链接错误会导致编译器错误
- 为什么在运行时没有向我们提供有关分段错误的更多信息?
- 尝试编译时 ZMQ 的 poller.ipp 中出现错误