error: undefined reference to ‘charge_read(unsigned char)‘ | collect2: error: ld returned 1 exit

atfwd_daemon.cpp:264: error: undefined reference to 'charge_read(unsigned char)' | collect2: error: ld returned 1 exit status | make[1]: *** [atfwd_daemon] Error 1 | make[1]: Leaving directory `/home/pytool/apps_proc/poky/build/tmp-glibc/work/mdm9607-oe-linux-gnueabi/demo/1.0-r1/demo' | make: *** [all] Error 2 | ERROR: oe_runmake failed | ERROR: Function failed: do_compile (log file is located at /home/pytool/apps_proc/poky/build/tmp-glibc/work/mdm9607-oe-linux-gnueabi/demo/1.0-r1/temp/log.do_compile.19578) ERROR: Task 789 (/home/pytool/apps_proc/poky/meta-qti-bsp-prop/recipes-bsp/demo/demo.bb, do_compile) failed with exit code '1' NOTE: Tasks Summary: Attempted 3002 tasks of which 3001 didn't need to be rerun and 1 failed. No currently running tasks (1800 of 3013) Summary: 1 task failed:   /home/pytool/apps_proc/poky/meta-qti-bsp-prop/recipes-bsp/demo/demo.bb, do_compile Summary: There were 2 ERROR messages shown, returning a non-zero exit code.

解决方式:

这种情况是采用了 C和C++混合代码,在相互调用的时候是不兼容的,需要通过使用extern C 做兼容处理,

还有另外一种方式就是将C代码都改为cpp 进行编译!

猜你喜欢

转载自blog.csdn.net/star871016/article/details/108673234