使用C ,未定义的参考设置OpenAlpr
Setting up OpenALPR with c++, undefined reference.
我需要将OpenAlpr库集成到我的C 程序中。不幸的是,我无法链接工作。
openalpr.lib 在c: path to alpr, alpr.h 标题c: path path to alpr include *.dll文件在带有 main 文件的目录中。系统Windows7,编译器GCC 5.3。
当前构建命令:
g++ -Wall -fexceptions -g -IC:pathtoalprinclude -c C:pathtoprojectmain.cpp -o objmain.o
g++ -LC:pathtoalpr -o bintest.exe objmain.o -lopenalpr
代码:
#include <alpr.h>
int main()
{
alpr::Alpr openalpr("us", "openalpr.conf");
return 0;
}
错误:
undefined reference to `alpr::Alpr::Alpr(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)'
等等,等等,等等,许多类似的"未定义参考"。
OpenAlpr库以二进制版本从以下方式下载:https://github.com/openalpr/openalpr/wiki/compilation-instructions-(Windows)
我应该从来源构建库吗?也许我错过了什么?预先感谢。
gcc5和c 11 abi:
依靠仍然使用旧ABI的第三方库或插件接口的用户可以使用
,这将是显而易见的。-D_GLIBCXX_USE_CXX11_ABI=0
构建其代码,并且一切都可以正常工作。在大多数情况下,由于链接器的错误抱怨涉及__cxx11
的未解决的符号。
尝试使用-D_GLIBCXX_USE_CXX11_ABI=0
。
相关文章:
- 为不同配置设置MSVC_RUNTIME_LIBRARY的正确方法是什么
- 在C++/Linux中设置单调时钟的一些技巧
- 如何在选项卡视图Qt中设置一个新项目,并保存以前的项目
- 嵌套在类中时无法设置成员数据
- 需要帮助设置在C++中使用的Potrace
- 如何在自删除后将对象设置为nullptr
- C++错误消息*成员参考.**初学者*
- 将指针设置为"nullptr"并不能防止双重删除?
- 如何在Ubuntu中使用cmake设置qt4
- ld:bind_at_load和-bitcode_bundle(Xcode设置ENABLE_bitcode=YES)不能
- 如何在boost beast http请求中设置http头
- 如何解决gcc编译器优化导致的centos双编译器设置中的分段错误
- 如何将这个C++哈希表转换为动态扩展和收缩,而不是使用硬设置的最大值
- 在决定是通过参考还是通过价值时,尺寸真的是一个问题吗
- 为什么文件名被设置为一个点,而不是在读取矢量中的文件名时
- 如何在24位SDL_Surface上设置像素的颜色
- 使用C ,未定义的参考设置OpenAlpr
- 为什么可以重新设置参考参数
- 设置参考c++
- 设置3D环境参考