[英]error executable compile with static library
我在此目录>> / home / mycomputer / src / lib中有一些静态库。 名称liba.a libb.a libc.a libd.ai在/ home / sugonsky / src上具有代码名称code.cpp
我一直尝试在g ++上编译它,命令是
g++ code.cpp -o myExecutable -L/home/mycomputer/src/lib/liba.a -L/home/mycomputer/src/lib/libb.a -L/home/mycomputer/src/lib/libc.a -L/home/mycomputer/src/lib/libd.a
我想说的是为什么我总是得到
/tmp/ccJLJTpi.o: In function `cv::Mat::operator()(cv::Rect_<int> const&) const':
faceDetection.cpp:(.text._ZNK2cv3MatclERKNS_5Rect_IiEE[_ZNK2cv3MatclERKNS_5Rect_IiEE]+0x27): undefined reference to `cv::Mat::Mat(cv::Mat const&, cv::Rect_<int> const&)'
collect2:错误:ld返回1退出状态
我的编译方案有什么错误的步骤吗?
-L/path/to/library/
和-lName
作为g ++选项对我-lName
。 不要在path/to/library
指定库名称。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.