The C compiler "/usr/bin/cc" is not able to compile a simple test program.

Hi I was triying to install asepire by source i followed this tutorial: How to Compile Aseprite on Ubuntu Linux - YouTube on Linux Mint 19.3 its my first time trying to install something from source and using Cmake so Iam just copieng and pasting. When i was trying to run that command:
cmake
-DCMAKE_BUILD_TYPE=RelWithDebInfo
-DCMAKE_CXX_FLAGS:STRING=-stdlib=libc++
-DCMAKE_EXE_LINKER_FLAGS:STRING=-stdlib=libc++
-DLAF_BACKEND=skia
-DSKIA_DIR=$HOME/programme/deps/skia
-DSKIA_LIBRARY_DIR=$HOME/programme/deps/skia/out/Release-x64
-DSKIA_LIBRARY=$HOME/programme/deps/skia/out/Release-x64/libskia.a
-G Ninja

I got this Error:

– Detecting C compiler ABI info - failed
– Check for working C compiler: /usr/bin/cc
– Check for working C compiler: /usr/bin/cc - broken
CMake Error at /usr/local/share/cmake-3.24/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/karl/programme/aseprite/build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/ninja cmTC_04eaa && [1/2] Building C object CMakeFiles/cmTC_04eaa.dir/testCCompiler.c.o
[2/2] Linking C executable cmTC_04eaa
FAILED: cmTC_04eaa 
: && /usr/bin/cc  -stdlib=libc++ CMakeFiles/cmTC_04eaa.dir/testCCompiler.c.o -o cmTC_04eaa   && :
cc: error: unrecognized command line option ‘-stdlib=libc++’
ninja: build stopped: subcommand failed.

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

Hope you can help me with this thank you.

That video is one year old. It doesn’t match the current instructions. You should read aseprite/INSTALL.md at main · aseprite/aseprite · GitHub for the latest instructions.

Thanks for your reply. I used the commands from the current instruction cant see where it is different from the video to the point i got.

Those command line options are for clang, not gcc.
According to that manual you need to export CC/CXX envvars first and set them to clang.
If you did that, you probably don’t have clang installed.

1 Like

as in the instruction i did those two commands export CC=clang and export CXX=clang++ before that one which gibes me the error so i installed clang and it gives me still an error.

Have you removed your build directory before trying again with clang installed?
CMake caches some information, like the compiler found. GCC was already found previously, so it probably still tries GCC.

1 Like

Thank you so much, it worked.