在MinGW中安装Protobuf开发库
Installing Protobuf Development Libraries in MinGW
我从github上的源代码中安装了Protobuf。
当我尝试编译我的c++程序时,我得到错误:
CMakeFiles/nxcore_interface.dir/main.cpp.o:main.cpp:(.rdata$.refptr._ZN6google8protobuf8internal13empty_string_E[.refptr._ZN6google8protobuf8internal13empty_string_E]+0x0): undefined reference to `google::protobuf::internal::empty_string_'
collect2: error: ld returned 1 exit status
我发现一些东西表明开发库不存在:
带协议缓冲区的程序不要编译MinGW-w64: "undefined reference to google::protobuf::…"
我已经包含了-lprotobuf
编译器标志。
经过一番搜索,我确定我需要使用libprotobuf-dev
,但我很难找到它。
有没有人知道在哪里得到它,或者是其他错误?
您应该使用pkg-config编译您的应用程序。
g++ my_program.cpp `pkg-config --cflags --libs protobuf`
如果您没有pkg-config,您应该找到库路径并使用-L选项设置它们。如:
g++ my_program.cpp -L/usr/local/protobuf/lib -lprotobuf
相关文章:
- 如何用RISC-V GD32VF103CBT6开发板卸载精确的ADC过采样
- 带有Protobuf序列化的C++Hazelcast:字符串不是UTF-8格式的
- 我正在开发服务器,ip作为参数传递不起作用
- Google protobuf 时间戳未声明标识符,在 Windows 上具有C++
- 如何继承 Protobuf 生成的C++类
- 如何使用 GPS 和指南针开发点移动算法
- AWS IoT 开发工具包:通过 TCP 端口 443 使用 MQTT
- 使用AAR的虚幻安卓开发
- 为什么开发人员将C / C ++用于嵌入式系统,而不是像Python这样的高级语言与C相比?
- FlatBuffers/Protobuf 中是否有支持任意 24 位有符号整数定义的可移植二进制序列化架构?
- gRPC 找不到 Protobuf 库
- protobuf C++ SQLite handle blob data
- Protobuf ShortDebugString() crash
- 开发C++/地图中的控制台角色扮演游戏
- Protobuf中重复字段的问题.使用重复字段进行序列化/反序列化的更好方法是什么?
- 测试驱动开发 c++:如何将对象添加到向量中,将歌曲添加到播放列表并对其进行测试
- CMake 在编译 Google 的 protobuf 示例时找不到 protobuf
- 使用 AWS C++ 开发工具包分段上传 S3
- 如何在可视化代码中生成用于 c++ 开发的调试器?
- 在MinGW中安装Protobuf开发库