对 raspicam 的未定义引用

undefined reference to raspicam

提问人:Talha Faraz 提问时间:12/21/2022 最后编辑:MarkusTalha Faraz 更新时间:12/21/2022 访问量:94

问:

我在 Geany 编译器中的相机初始化时遇到了一些错误

g++ $(pkg-config opencv4 --cflags --libs) -o g++ $(pkg-config raspicam --cflags --libs) -o cameratest cameratest.cpp (in directory: /home/pi/Desktop)
/usr/bin/ld: /tmp/cc3JiNr2.o: in function `main':
cameratest.cpp:(.[text+0x14): undefined reference to `raspicam::RaspiCam_Cv::RaspiCam_Cv()'
/usr/bin/ld: cameratest.cpp:(.text+0x3c): undefined reference to `raspicam::RaspiCam_Cv::open()'
/usr/bin/ld: cameratest.cpp:(.text+0x9c): undefined reference to `raspicam::RaspiCam_Cv::getId[abi:cxx11]() const'
/usr/bin/ld: cameratest.cpp:(.text+0xd8): undefined reference to `raspicam::RaspiCam_Cv::~RaspiCam_Cv()'
/usr/bin/ld: cameratest.cpp:(.text+0x108): undefined reference to `raspicam::RaspiCam_Cv::~RaspiCam_Cv()'
collect2: error: ld returned 1 exit status
Compilation failed.
opencv undefined-reference geany

评论

0赞 Markus 12/21/2022
请检查您的编译语句。为什么字符串会出现两次?g++
0赞 Talha Faraz 12/29/2022
我删除了它,但面临同样的错误
0赞 Markus 12/29/2022
请编辑问题以准确反映您实际使用的命令。

答: 暂无答案