Score:0

Ubuntu 23.04 - While compiling a program (gpx2video), the linker gives me various errors with libraries (incompatible, not found,...)

us flag

While compiling a program (gpx2video), the linker gives me various errors with libraries (incompatible, not found)

CMake Error at /usr/share/cmake-3.25/Modules/CMakeTestCCompiler.cmake:70 (message):
   The C compiler

     "/usr/bin/cc"

   is not able to compile a simple test program.

   It fails with the following output:

     Change Dir: /media/DATA_G_Ext4/Gopro/gpx2video/gpx2video/build/CMakeFiles/CMakeScratch/TryCompile-lKh0gb
    
     Run Build Command(s):/usr/bin/gmake -f Makefile cmTC_f5b91/fast && /usr/bin/gmake -f CMakeFiles/cmTC_f5b91.dir/build.make CMakeFiles/cmTC_f5b91.dir/build
     gmake[1]: entry into directory «/media/DATI_G_Ext4/Gopro/gpx2video/gpx2video/build/CMakeFiles/CMakeScratch/TryCompile-lKh0gb»
     Building C object CMakeFiles/cmTC_f5b91.dir/testCCompiler.c.o
     /usr/bin/cc -o CMakeFiles/cmTC_f5b91.dir/testCCompiler.c.o -c /media/DATA_G_Ext4/Gopro/gpx2video/gpx2video/build/CMakeFiles/CMakeScratch/TryCompile-lKh0gb/testCCompiler.c
     Linking C executable cmTC_f5b91
     /usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_f5b91.dir/link.txt --verbose=1
     /usr/bin/cc -rdynamic CMakeFiles/cmTC_f5b91.dir/testCCompiler.c.o -o cmTC_f5b91
     /usr/local/bin/ld: warning: /usr/lib/gcc/x86_64-linux-gnu/12/../../../x86_64-linux-gnu/Scrt1.o: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0008002
     /usr/local/bin/ld: warning: /lib/x86_64-linux-gnu/libc.so.6: unsupported GNU_PROPERTY_TYPE (5) type: 0xc0008002
     /usr/local/bin/ld: /lib/x86_64-linux-gnu/libc.so.6: unknown type [0x13] section `.relr.dyn'
     /usr/local/bin/ld: skipped incompatible /lib/x86_64-linux-gnu/libc.so.6 when searching for /lib/x86_64-linux-gnu/libc.so.6
     /usr/local/bin/ld: cannot find /lib/x86_64-linux-gnu/libc.so.6
     /usr/local/bin/ld: /lib64/ld-linux-x86-64.so.2: unknown type [0x13] section `.relr.dyn'
     /usr/local/bin/ld: skipped incompatible /lib64/ld-linux-x86-64.so.2 when searching for /lib64/ld-linux-x86-64.so.2
     /usr/local/bin/ld: cannot find /lib64/ld-linux-x86-64.so.2
     collect2: error: ld returned 1 exit status
     gmake[1]: *** [CMakeFiles/cmTC_f5b91.dir/build.make:99: cmTC_f5b91] Error 1
     gmake[1]: output from directory «/media/DATA_G_Ext4/Gopro/gpx2video/gpx2video/build/CMakeFiles/CMakeScratch/TryCompile-lKh0gb»
     gmake: *** [Makefile:127: cmTC_f5b91/fast] Error 2
hr flag
It looks like you have a non-compatible `ld` program in `/usr/local` (which is found first, due to `$PATH` order) - everything in the standard Ubuntu toolchain would be in `/usr`
vimo58 avatar
us flag
So, what can I do? I had already reinstalled binutils
hr flag
There's a bunch of things you can try - (1) defining your `PATH` such that `/usr/bin` precedes `/usr/local/bin` (2) using the available `CMAKE` variables to specify the correct linker e.g. you could try re-running `cmake` with `-DCMAKE_C_FLAGS="-fuse-ld=/usr/bin/ld"` or (3) removing the incompatible toolchain (if it serves no purpose). See for example [CMake: use a custom linker](https://stackoverflow.com/questions/1867745/cmake-use-a-custom-linker).
vimo58 avatar
us flag
Tried both of your suggested solutions to no avail. The error is always there.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.