【C/C++】公共接口调用:aaa.so: undefined reference to `GetXXX‘

运行错误:

libtest.so: undefined reference to `GetXXX'
collect2: error: ld returned 1 exit status
Makefile:273: recipe for target 'XXX_example' failed
make: *** [XXX_example] Error 1

问题查找:

arm-linux-gnueabihf-readelf -a ~/xxx/libtest.so  |grep GetXXX
0x1e88 : @0xdd30
   183: 00001e88  1276 FUNC    LOCAL  DEFAULT   11 GetXXX

解决: 

接口定位为外部可访问接口:

arm-linux-gnueabihf-readelf -a ~/xxx/libtest.so  |grep GetXXX
0x1e88 : @0xdd30
   183: 00001e88  1276 FUNC    GLOBAL DEFAULT   11 GetXXX

你可能感兴趣的:(c++,C,公共接口,外部调用,readelf)