【问题】
之前已经折腾完毕:
【记录】Ubuntu下使用Eclipse编译一个基于makefile的C项目
期间,也解决过类似的N多问题:
【已解决】Eclipse通过Makefile调用交叉编译器交叉编译C项目出错:Type ‘FILE’ could not be resolved
【已解决】Eclipse中交叉编译C项目出错:Symbol ‘SETVAL’ could not be resolved
【已解决】Ubuntu下Eclipse中交叉编译C项目出错:Symbol ‘NULL’ could not be resolved
【已解决】Ubuntu下Eclipse中交叉编译C项目出错:Symbol ‘off’ could not be resolved
以及:
【已解决】Ubuntu下Eclipse中交叉编译一个C项目出错:Type ‘immap_t’ could not be resolved
但是此处,还是有个宏定义没找到:
Description Resource Path Location Type |
【解决过程】
1.很明显,此处是.c依赖第三方的xmlrpc的库。
我之前已经是交叉编译好的。
2.所以,去找找XMLRPC_CLIENT_NO_FLAGS是在哪个头文件里面的。
然后参考:
而知:
#define XMLRPC_CLIENT_NO_FLAGS (0) |
所以,应该是把xmlrpc_client.h所在路径,加到Eclipse的include中去。
3.然后就去找,此处的xmlrpc_client.h所在路径是啥:
crifan@ubuntu:Build$ find /opt/crosscompile/xmlrpc/ -name xml*.h /opt/crosscompile/xmlrpc/include/xmlrpc_client.h /opt/crosscompile/xmlrpc/include/xmlrpc_server_w32httpsys.h /opt/crosscompile/xmlrpc/include/xmlrpc_cgi.h /opt/crosscompile/xmlrpc/include/xmlrpc_abyss.h /opt/crosscompile/xmlrpc/include/xmlrpc_server.h /opt/crosscompile/xmlrpc/include/xmlrpc.h
很明显是:
/opt/crosscompile/xmlrpc/include |
4.所以去添加上:
5.然后再去刷新,重新build index试试:
然后就可以看到,可以找到此宏的定义了:
6.有点奇怪的是,不是在xmlrpc_client.h ,而是在client_global.h中
所以去确认了一下,后来发现果然是:
crifan@ubuntu:Build$ ls /opt/crosscompile/xmlrpc/include/ -lha total 12K drwxrwxr-x 3 crifan crifan 4.0K Aug 9 02:56 . drwxrwxr-x 5 crifan crifan 4.0K Aug 8 21:45 .. lrwxrwxrwx 1 crifan crifan 23 Aug 9 02:56 xmlrpc_abyss.h -> xmlrpc-c/server_abyss.h drwxrwxr-x 2 crifan crifan 4.0K Aug 9 02:56 xmlrpc-c lrwxrwxrwx 1 crifan crifan 21 Aug 9 02:56 xmlrpc_cgi.h -> xmlrpc-c/server_cgi.h lrwxrwxrwx 1 crifan crifan 17 Aug 9 02:56 xmlrpc_client.h -> xmlrpc-c/client.h lrwxrwxrwx 1 crifan crifan 26 Aug 9 02:56 XmlRpcCpp.h -> xmlrpc-c/oldcppwrapper.hpp lrwxrwxrwx 1 crifan crifan 20 Aug 9 02:56 xmlrpc.h -> xmlrpc-c/oldxmlrpc.h lrwxrwxrwx 1 crifan crifan 17 Aug 9 02:56 xmlrpc_server.h -> xmlrpc-c/server.h lrwxrwxrwx 1 crifan crifan 28 Aug 9 02:56 xmlrpc_server_w32httpsys.h -> xmlrpc-c/server_w32httpsys.h crifan@ubuntu:Build$ ls /opt/crosscompile/xmlrpc/include/xmlrpc-c/ -lha total 196K drwxrwxr-x 2 crifan crifan 4.0K Aug 9 02:56 . drwxrwxr-x 3 crifan crifan 4.0K Aug 9 02:56 .. -rw-r--r-- 1 crifan crifan 15K Aug 9 02:56 abyss.h -rw-r--r-- 1 crifan crifan 22K Aug 9 02:56 base.h -rw-r--r-- 1 crifan crifan 7.7K Aug 9 02:56 base.hpp -rw-r--r-- 1 crifan crifan 5.7K Aug 9 02:56 client_global.h -rw-r--r-- 1 crifan crifan 9.5K Aug 9 02:56 client.h -rw-r--r-- 1 crifan crifan 7.8K Aug 9 02:56 client.hpp -rw-r--r-- 1 crifan crifan 834 Aug 9 02:56 client_simple.hpp -rw-r--r-- 1 crifan crifan 9.8K Aug 9 02:56 client_transport.hpp -rw-r--r-- 1 crifan crifan 28 Aug 9 02:56 config.h -rw-r--r-- 1 crifan crifan 510 Aug 9 02:56 girerr.hpp -rw-r--r-- 1 crifan crifan 1.6K Aug 9 02:56 girmem.hpp -rw-r--r-- 1 crifan crifan 14K Aug 9 02:56 oldcppwrapper.hpp -rw-r--r-- 1 crifan crifan 56 Aug 9 02:56 oldxmlrpc.h -rw-r--r-- 1 crifan crifan 4.3K Aug 9 02:56 registry.hpp -rw-r--r-- 1 crifan crifan 8.5K Aug 9 02:56 server_abyss.h -rw-r--r-- 1 crifan crifan 3.8K Aug 9 02:56 server_abyss.hpp -rw-r--r-- 1 crifan crifan 1.1K Aug 9 02:56 server_cgi.h -rw-r--r-- 1 crifan crifan 5.2K Aug 9 02:56 server.h -rw-r--r-- 1 crifan crifan 4.0K Aug 9 02:56 server_w32httpsys.h -rw-r--r-- 1 crifan crifan 303 Aug 9 02:56 timeout.hpp -rw-r--r-- 1 crifan crifan 2.7K Aug 9 02:56 transport.h -rw-r--r-- 1 crifan crifan 11K Aug 9 02:56 util.h -rw-r--r-- 1 crifan crifan 640 Aug 9 02:56 xml.hpp crifan@ubuntu:Build$ gedit /opt/crosscompile/xmlrpc/include/xmlrpc-c/client_global.h crifan@ubuntu:Build$
【总结】
此处在Eclipse中用交叉编译器编译C项目,出错:
Symbol ‘XMLRPC_CLIENT_NO_FLAGS’ could not be resolved
的原因是:
.c文件中用到了第三方(交叉编译后的库)xmlrpc中的xmlrpc_client.h
解决办法:
把xmlrpc的include文件夹(/opt/crosscompile/xmlrpc/include)添加到项目的include路径中即可。
转载请注明:在路上 » 【已解决】Ubuntu下Eclipse中交叉编译一个C项目出错:Symbol ‘XMLRPC_CLIENT_NO_FLAGS’ could not be resolved