0

I am running CLion with snap on my Kali Linux virtual machine. When I am creating a new executable C Project, I get the following error that I cannot seem to solve:

CMake Error at /snap/clion/209/bin/cmake/linux/share/cmake-3.23/Modules/CMakeTestCCompiler.cmake:69 (message):
  The C compiler

    "/usr/bin/cc"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: /home/kali/CLionProjects/untitled1/cmake-build-debug/CMakeFiles/CMakeTmp
    
    Run Build Command(s):/snap/clion/209/bin/ninja/linux/ninja cmTC_17880 && [1/2] Building C object CMakeFiles/cmTC_17880.dir/testCCompiler.c.o
    [2/2] Linking C executable cmTC_17880
    FAILED: cmTC_17880 
    : && /usr/bin/cc   CMakeFiles/cmTC_17880.dir/testCCompiler.c.o -o cmTC_17880   && :
    /usr/bin/ld: /lib/x86_64-linux-gnu/libc.so.6: unknown type [0x13] section `.relr.dyn'
    /usr/bin/ld: skipping incompatible /lib/x86_64-linux-gnu/libc.so.6 when searching for /lib/x86_64-linux-gnu/libc.so.6
    /usr/bin/ld: cannot find /lib/x86_64-linux-gnu/libc.so.6
    /usr/bin/ld: /lib64/ld-linux-x86-64.so.2: unknown type [0x13] section `.relr.dyn'
    /usr/bin/ld: skipping incompatible /lib64/ld-linux-x86-64.so.2 when searching for /lib64/ld-linux-x86-64.so.2
    /usr/bin/ld: cannot find /lib64/ld-linux-x86-64.so.2
    collect2: error: ld returned 1 exit status
    ninja: build stopped: subcommand failed.

  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:2 (project)


-- Configuring incomplete, errors occurred!
See also "/home/kali/CLionProjects/untitled1/cmake-build-debug/CMakeFiles/CMakeOutput.log".
See also "/home/kali/CLionProjects/untitled1/cmake-build-debug/CMakeFiles/CMakeError.log". 

If anyone has a fix, I would really appreciate it.

starball
  • 20,030
  • 7
  • 43
  • 238
  • 4
    Development on Kali: Don't do this to yourself! Kali themselves say you should **not** be using Kali as development / day-to-day driver. See their reasoning here: https://www.kali.org/docs/introduction/should-i-use-kali-linux/ Kali *is* a special-purpose distro, and especially things like snaps and development tools are not well tested. So, honestly, since Ubuntu is so much easier to set up, I'd not worry about getting this to run on Kali. – Marcus Müller Nov 25 '22 at 17:16
  • 4
    The error indicates an incompatibility of `libc.so` library with the linker (`ld`). See e.g. [that topic](https://forum.manjaro.org/t/error-in-libc-so-6-when-updating-packages-solved-by-updating-binutils/120776). As noted by the previous commenter, even the most "standard" things (like a compiler or linker) which are easily installed on any "home" distro, could be hard on Kali. The [tag:kali-linux] tag has a reference to a [meta question](https://unix.stackexchange.com/q/399626), I would suggest to read that question before asking about Kali Linux on Stack Overflow and other SE sites. – Tsyvarev Nov 25 '22 at 21:27

1 Answers1

0

I could fix it by running apt-get update -y && apt-get upgrade -y && apt-get dist-upgrade -y.

pepe
  • 1