Rolf Eike Beer wrote: >> Rolf Eike Beer wrote: >> >>>> I'm not certain that's correct though. Those flags don't seem to be >>>> used >>>> when I build. I also don't know what those flags do. >>>> >>>> Linking CXX executable exec >>>> /home/stephen/dev/qt48/kde/bin/cmake -E cmake_link_script >>>> CMakeFiles/exec.dir/link.txt --verbose=1 >>>> /usr/lib/icecc/bin/c++ CMakeFiles/exec.dir/main.cpp.o -o exec - >>>> rdynamic lib/liblibC.so >>>> -Wl,-rpath,/home/stephen/cmaketest/test19/build/lib >>>> -Wl,-rpath-link,/home/stephen/cmaketest/test19/build/lib >>>> CMakeFiles/exec.dir/main.cpp.o:main.cpp:function main: error: undefined >>>> reference to 'classB::classB()' >>>> collect2: ld returned 1 exit status >>>> make[2]: *** [exec] Error 1 >>>> make[2]: Leaving directory `/home/stephen/cmaketest/test19/build' >>> >>> Maybe this is just the default setting for your binutils. Try >>> LDFLAGS=-Wl,--copy-dt-needed-entries,-no-as-needed and see what happens. >>> I >>> bet this will change the behavior on your system. >> >> ld now gives a new error: >> >> /usr/bin/ld: error: --copy-dt-needed-entries is not supported but is >> required for liblibA.so in lib/liblibC.so >> >> Here's a more complete fragment: >> >> Linking CXX executable exec >> /home/stephen/dev/qt48/kde/bin/cmake -E cmake_link_script >> CMakeFiles/exec.dir/link.txt --verbose=1 >> /usr/lib/icecc/bin/c++ -Wl,--copy-dt-needed-entries,-no-as-needed >> CMakeFiles/exec.dir/main.cpp.o -o exec -rdynamic lib/liblibC.so -Wl,- >> rpath,/home/stephen/cmaketest/test19/build/lib -Wl,-rpath- >> link,/home/stephen/cmaketest/test19/build/lib >> /usr/bin/ld: error: --copy-dt-needed-entries is not supported but is >> required for liblibA.so in lib/liblibC.so >> CMakeFiles/exec.dir/main.cpp.o:main.cpp:function main: error: undefined >> reference to 'classB::classB()' >> collect2: ld returned 1 exit status >> >> I also ran ctest -V -R target_link_librares with those flags and many >> more tests failed. >> >> I have no idea what those flags do, so I don't know if that new error is >> a lead. > > This may be new in my binutils version. Can you just try > LDFLAGS=-Wl,-no-as-needed? > > Eike
Back to what it was before now: Linking CXX executable exec /home/stephen/dev/qt48/kde/bin/cmake -E cmake_link_script CMakeFiles/exec.dir/link.txt --verbose=1 /usr/lib/icecc/bin/c++ -Wl,-no-as-needed CMakeFiles/exec.dir/main.cpp.o -o exec -rdynamic lib/liblibC.so -Wl,- rpath,/home/stephen/cmaketest/test19/build/lib -Wl,-rpath- link,/home/stephen/cmaketest/test19/build/lib CMakeFiles/exec.dir/main.cpp.o:main.cpp:function main: error: undefined reference to 'classB::classB()' I also tried running ctest -V -R target_link_libraries again, and it succeeded in all tests. Thanks, Steve. -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers