下面罗列自己遇到问题及解决办法
1. zlib libpngjpeg 装置成功后仍是犯错,显现缺失zlib libpngjpeg
此刻或许没有勾选with_zlib with_libpng with_jpeg。勾选后再configure 就不会犯错了
此刻或许没有勾选with_zlib with_libpng with_jpeg。勾选后再configure 就不会犯错了
2. “CMAKE_EXE_LINKER_FLAGS本来为空,加上-lpthread -lrt” 不好使的话
能够试试:CMAKE_EXE_LINKER_FLAGS本来为空,加上-lpthread -lrt -ldl
3. 生成文件(bin include lib share)完毕后,把本来Ubuntu 下用cmake编译opencv生成的文件掩盖(兼并?)
所以履行本来能够正常运转的指令 :g++ ADA_LKDEMO.cpp -oADA_LKDEMO`pkg-config –cflags –libs opencv` -ldl
会呈现如下过错:
/usr/local/lib/libopencv_calib3d.so: error adding symbols: 文件格局过错
collect2: error: ld returned 1 exit status
collect2: error: ld returned 1 exit status
原因是libopencv_calib3d.so不再是Linux下装备的opencv文件 而是arm环境下的了(本来的Linux文件被掩盖了)
履行:arm-linux-g++ ADA_LKDEMO.cpp -oADA_LKDEMO`pkg-config –cflags –libs opencv` -ldl
就能够编译成功了!
运用arm-linux-g++新问题又呈现:
ADA_LKDEMO.cpp:30:19: error: X11/X.h: No such file or directory
ADA_LKDEMO.cpp:31:22: error: X11/Xlib.h: No such file or directory
ADA_LKDEMO.cpp:32:23: error: X11/Xutil.h: No such file or directory
ADA_LKDEMO.cpp:31:22: error: X11/Xlib.h: No such file or directory
ADA_LKDEMO.cpp:32:23: error: X11/Xutil.h: No such file or directory
或许是X11/X.h X11/Xlib.h X11/Xutil.h 不能运转在arm平台上?(即只要在g++指令下才不犯错) 那么怎样移植到arm下呢?(即能够让arm-linux-g++编译经过???)
4. 过错:
bash: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/zbl/cmake/cmake-3.0.0/bin: 没有那个文件或目录
bash: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/opt/FriendlyARM/toolschain/4.4.3/bin: 没有那个文件或目录
将途径装备 指令写错了。(用vi ~/.bashrc装备)
过错: PATH=$PATH:/opt/FriendlyARM/toolschain/4.4.3/bin
正确: export PATH=$PATH:/opt/FriendlyARM/toolschain/4.4.3/bin
正确: export PATH=$PATH:/opt/FriendlyARM/toolschain/4.4.3/bin
5.登录管理员账户时,输入暗码后,一直在登录界面循环
ctrl+alt+f1 ,切换到tty1,输入管理员帐号和暗码
sudo rm -r .Xauthority*
sudo reboot //重启
ok
参阅:http://blog.csdn.net/wjeson/article/details/9029995
6.undefined reference to symbol XFlush
/usr/lib/i386-linux-gnu/libX11.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make: *** [freepen_drv] 过错 1
参阅http://blog.csdn.net/sukhoi27smk/article/details/18982261
7.pkg-config的用法
参阅http://blog.csdn.net/embeddedman/article/details/7294006