vgrabbj-0.9.6移植过程中得问题


因为项目的需要,本来只是做测量平台,后来因为导师要求,要加上摄像头来监控,于是查了一上午的文档,不想自己写驱动,也没有必要写驱动,所以,就找万能驱动最后找到gscape,在现在的内核上本来就由支持,所以,不需要自己下载源码包了,在编译内核的时候自己选择上就可以了,如果在编译选项里面没有,那么你就要修改kconfig和makefile文件添加上就可以了,现在再说抓图软件,就是涉及到图像的v4l系列的变成,我网上查了下,发现vgrabbj-0.9.6是个不错了抓图软件,在交叉编译的时候遇到不少麻烦,现在将遇到的问题集中下,以防下次再次出现:

问题一:

  1. arm-none-linux-gnueabi-gcc -DHAVE_CONFIG_H -I. -I. -I. -g -O2 -Wall -c vgrabbj.c  
  2. vgrabbj.c: In function 'read_image':  
  3. vgrabbj.c:287: warning: pointer targets in return differ in signedness  
  4. vgrabbj.c: In function 'conv_image':  
  5. vgrabbj.c:302: warning: pointer targets in assignment differ in signedness  
  6. vgrabbj.c:333: warning: pointer targets in assignment differ in signedness  
  7. vgrabbj.c:336: warning: pointer targets in return differ in signedness  
  8. vgrabbj.c: In function 'main':  
  9. vgrabbj.c:359: warning: pointer targets in assignment differ in signedness  
  10. vgrabbj.c:360: warning: pointer targets in assignment differ in signedness  
  11. vgrabbj.c:363: warning: pointer targets in assignment differ in signedness  
  12. vgrabbj.c:366: warning: pointer targets in assignment differ in signedness  
  13. arm-none-linux-gnueabi-gcc -DHAVE_CONFIG_H -I. -I. -I. -g -O2 -Wall -c v_config.c  
  14. In file included from v_config.h:28,  
  15. from v_config.c:26:  
  16. v_options.h:26: error: static declaration of 'l_opt' follows non-static declaration  
  17. vgrabbj.h:307: error: previous declaration of 'l_opt' was here  
  18. v_config.c: In function 'init_defaults':  
  19. v_config.c:186: error: lvalue required as unary '&' operand  
  20. v_config.c:187: error: lvalue required as unary '&' operand  
  21. v_config.c:188: error: lvalue required as unary '&' operand  
  22. v_config.c:190: error: lvalue required as unary '&' operand  
  23. v_config.c:194: error: lvalue required as unary '&' operand  
  24. v_config.c:200: error: lvalue required as unary '&' operand  
  25. v_config.c:201: error: lvalue required as unary '&' operand  
  26. v_config.c:242: error: lvalue required as unary '&' operand  
  27. v_config.c:244: error: lvalue required as unary '&' operand  
  28. v_config.c:246: error: lvalue required as unary '&' operand  
  29. v_config.c:248: error: lvalue required as unary '&' operand  
  30. v_config.c:250: error: lvalue required as unary '&' operand  
  31. v_config.c: In function 'decode_options':  
  32. v_config.c:490: error: lvalue required as left operand of assignment  
  33. make: *** [v_config.o] Error 1  
开始找原因了,百谷了下,问这样的问题的人多,但是,回答的没多少,没办法,只能去国外网站上查啊,发现有个对应的补丁文件,如是下载下来,看能否问题有好转,

下载下来,打上补丁:patch -p1 < vgrabbj_0.9.6-3.1.diff 

再次编译,出现问题二:

问题二:

  1. WARNING: `automake-1.4' is needed, and you do not seem to have it handy on your  
  2.          system.  You might have modified some files without having the  
  3.          proper tools for further handling them.  Check the `README' file,  
  4.          it often tells you about the needed prerequirements for installing  
  5.          this package.  You may also peek at any GNU archive site, in case  
  6.          some other package would contain this missing `automake-1.4' program.  
  7. make: *** [Makefile.in] Error 1  

很明显的提示:automake-1.4,我查看我的版本是1-11,看来太新了也不行,果断卸载重装1.4,然后编译,顺利通过。

运行是的问题:

交叉编译过后,就下载在ARM板上运行,提示错误很多,修改了配置文件,等原因,还是有问题,回到源代码,对比信息,发现是设置图像属性是出问题,即IOCTL函数出问题,也找了一天,研究代码,最后确定问题在内核,重新编译内核,在USB选项下也要选择对应的选项,最后成功了,运行时错误信息记录在实验室电脑上,没在寝室电脑上,就不记录了,欢迎和大家交流。

相关内容