我有一个链接到testA lib的应用程序,后者又链接到testB lib。构建我的应用程序时出现波纹管链接错误。我无法弄清楚为什么会这样。
更多信息,checkConnection(),reqGetReference()和test_register_app()都来自testB lib,那么为什么错误只是前两个函数
element.on('mousedown', function(e) {
e.stopPropagation();
});
任何人都可以帮助我吗?提前谢谢!
回复答案,我在这里补充其他信息
我使用libtool和automake,这是我的Makefile
test-pc$ make CXXFLAGS='-g -O0 -frtti -fexceptions'
../libtestA/.libs/libtestA.so: undefined reference to `test_namespace::checkConnection()'
../libtestA/.libs/libtestA.so: undefined reference to `test_namespace::reqGetReference(char const*)'
collect2: error: ld returned 1 exit status
make: *** [tf_app] Error 1
test-pc$ nm -D ../libtestA/.libs/libtestA.so | grep checkConnection
U _ZN15test_namespace15checkConnectionEv
test-pc$ nm -D ../libtestA/.libs/libtestA.so | grep reqGetReference
U _ZN15test_namespace15reqGetReferenceEPKc
test-pc$ nm -D ../libtestA/.libs/libtestA.so | grep test_register
U _ZN15test_namespace24test_register_appEPKcPFbPcS2_ES4_S4_S4_PFbS2_ES6_PFbS2_llEPFbS2_lllESA_S6_
test-pc$ nm -D ../libtestB/.libs/libtestB.so | grep checkConnection
0000000000016f5d T _ZN15test_namespace15checkConnectionEv
test-pc$ nm -D ../libtestB/.libs/libtestB.so | grep reqGetReference
0000000000016b9a T _ZN15test_namespace15reqGetReferenceEPKc
test-pc$ nm -D ../libtestB/.libs/libtestB.so | grep test_register
0000000000015c2a T _ZN15test_namespace24test_register_appEPKcPFbPcS2_ES4_S4_S4_PFbS2_ES6_PFbS2_llEPFbS2_lllESA_S6_
test-pc$ ldd ../libtestA/.libs/libtestA.so
linux-vdso.so.1 => (0x00007ffd659d2000)
libtestB.so.1 => libtestB/.libs/libtestB.so.1 (0x00007f994172b000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f994150d000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f9941209000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f9940e44000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f9940c2e000)
libpt.so.2.10.7 => /usr/local/lib/libpt.so.2.10.7 (0x00007f99406af000)
/lib64/ld-linux-x86-64.so.2 (0x00007f9942701000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f99403a9000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f99401a1000)
libcrypto.so.1.0.0 => /lib/x86_64-linux-gnu/libcrypto.so.1.0.0 (0x00007f993fb67000)
libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1 (0x00007f993f93d000)
libodbc.so.1 => /usr/lib/x86_64-linux-gnu/libodbc.so.1 (0x00007f993f6d6000)
libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2 (0x00007f993f4bb000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f993f2b7000)
libltdl.so.7 => /usr/lib/x86_64-linux-gnu/libltdl.so.7 (0x00007f993f0ad000)
另外,它只适用于Centos,但不适用于我的Ubuntu。