CLION cross compiler example fails on link

已完成

CLion fails to build a file which builds properly from the command line.

In trying to understand how cmake works, I have created a very simple CMakeLists.txt file and a simple test program.  I am building the application on Ubuntu 18.04. 

My goal is to cross-compile an application using CLion for use on an older target system.

When I create my CMakeLists.txt file, I specify the cross-compiler.  However, the CLion build fails in the linking process.  If I run the same build from the command line, the link succeeds.  If I remove the cross-compiler command from the CMakeLists.txt file, then CLion is able to build and link.

It seems that CLion is calling either a different program, a the linker in a different way than the command line calls the same programs.

I have included first the failed linking from CLion with the link failure in bold.  I have then included the successful command line build. Any suggestions are appreciated.

CMakeLists.txt:

set (CMAKE_VERBOSE_MAKEFILE 1)

cmake_minimum_required(VERSION 3.3)
project(todo)

# Set system variables
set(CMAKE_SYSTEM_NAME      Linux)
set(CMAKE_SYSTEM_VERSION   gcc5.3.0)
set(CMAKE_SYSTEM_PROCESSOR x86_64)

set(CMAKE_VERBOSE_MAKEFILE 1 )

# Set compiler
set(CMAKE_C_COMPILER   "/software/gnu/gcc/5.3.0/x86_64linux2.6.32/bin/gcc")
set(CMAKE_CXX_COMPILER "/software/gnu/gcc/5.3.0/x86_64linux2.6.32/bin/g++")

# Set compiler options
set(CMAKE_C_FLAGS   "-m64")
set(CMAKE_CXX_FLAGS "-m64 -Wall")

add_executable(todo main.cpp )

Failing CLion build:

/software/doxygen/cmake/3.3.1/linux-x86_64/bin/cmake --build /home/jwmurray/todo2/cmake-build-debug --target todo -- -j 1
/software/doxygen/cmake/3.3.1/linux-x86_64/bin/cmake -H/home/jwmurray/todo2 -B/home/jwmurray/todo2/cmake-build-debug --check-build-system CMakeFiles/Makefile.cmake 0
/usr/bin/make -f CMakeFiles/Makefile2 todo
make[1]: Entering directory '/home/jwmurray/todo2/cmake-build-debug'
/software/doxygen/cmake/3.3.1/linux-x86_64/bin/cmake -H/home/jwmurray/todo2 -B/home/jwmurray/todo2/cmake-build-debug --check-build-system CMakeFiles/Makefile.cmake 0
/software/doxygen/cmake/3.3.1/linux-x86_64/bin/cmake -E cmake_progress_start /home/jwmurray/todo2/cmake-build-debug/CMakeFiles 2
/usr/bin/make -f CMakeFiles/Makefile2 CMakeFiles/todo.dir/all
make[2]: Entering directory '/home/jwmurray/todo2/cmake-build-debug'
/usr/bin/make -f CMakeFiles/todo.dir/build.make CMakeFiles/todo.dir/depend
make[3]: Entering directory '/home/jwmurray/todo2/cmake-build-debug'
cd /home/jwmurray/todo2/cmake-build-debug && /software/doxygen/cmake/3.3.1/linux-x86_64/bin/cmake -E cmake_depends "Unix Makefiles" /home/jwmurray/todo2 /home/jwmurray/todo2 /home/jwmurray/todo2/cmake-build-debug /home/jwmurray/todo2/cmake-build-debug /home/jwmurray/todo2/cmake-build-debug/CMakeFiles/todo.dir/DependInfo.cmake --color=
Scanning dependencies of target todo
make[3]: Leaving directory '/home/jwmurray/todo2/cmake-build-debug'
/usr/bin/make -f CMakeFiles/todo.dir/build.make CMakeFiles/todo.dir/build
make[3]: Entering directory '/home/jwmurray/todo2/cmake-build-debug'
[ 50%] Building CXX object CMakeFiles/todo.dir/main.cpp.o
/software/gnu/gcc/5.3.0/x86_64linux2.6.32/bin/g++    -m64 -Wall -g   -o CMakeFiles/todo.dir/main.cpp.o -c /home/jwmurray/todo2/main.cpp
[100%] Linking CXX executable todo
/software/doxygen/cmake/3.3.1/linux-x86_64/bin/cmake -E cmake_link_script CMakeFiles/todo.dir/link.txt --verbose=1
/software/gnu/gcc/5.3.0/x86_64linux2.6.32/bin/g++   -m64 -Wall -g   CMakeFiles/todo.dir/main.cpp.o  -o todo -rdynamic
/usr/bin/ld: cannot find crt1.o: No such file or directory
/usr/bin/ld: cannot find crti.o: No such file or directory
collect2: error: ld returned 1 exit status
CMakeFiles/todo.dir/build.make:97: recipe for target 'todo' failed
make[3]: *** [todo] Error 1
make[3]: Leaving directory '/home/jwmurray/todo2/cmake-build-debug'
CMakeFiles/Makefile2:70: recipe for target 'CMakeFiles/todo.dir/all' failed
make[2]: *** [CMakeFiles/todo.dir/all] Error 2
make[2]: Leaving directory '/home/jwmurray/todo2/cmake-build-debug'
CMakeFiles/Makefile2:82: recipe for target 'CMakeFiles/todo.dir/rule' failed
make[1]: *** [CMakeFiles/todo.dir/rule] Error 2
make[1]: Leaving directory '/home/jwmurray/todo2/cmake-build-debug'
Makefile:121: recipe for target 'todo' failed
make: *** [todo] Error 2

Successful command line build:

jwmurray@beaver:build$ cmake ..
-- The C compiler identification is GNU 7.3.0
-- The CXX compiler identification is GNU 7.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /home/jwmurray/todo2/build
jwmurray@beaver:build$ make
/software/doxygen/cmake/3.3.1/linux-x86_64/bin/cmake -H/home/jwmurray/todo2 -B/home/jwmurray/todo2/build --check-build-system CMakeFiles/Makefile.cmake 0
/software/doxygen/cmake/3.3.1/linux-x86_64/bin/cmake -E cmake_progress_start /home/jwmurray/todo2/build/CMakeFiles /home/jwmurray/todo2/build/CMakeFiles/progress.marks
make -f CMakeFiles/Makefile2 all
make[1]: Entering directory '/home/jwmurray/todo2/build'
make -f CMakeFiles/todo.dir/build.make CMakeFiles/todo.dir/depend
make[2]: Entering directory '/home/jwmurray/todo2/build'
cd /home/jwmurray/todo2/build && /software/doxygen/cmake/3.3.1/linux-x86_64/bin/cmake -E cmake_depends "Unix Makefiles" /home/jwmurray/todo2 /home/jwmurray/todo2 /home/jwmurray/todo2/build /home/jwmurray/todo2/build /home/jwmurray/todo2/build/CMakeFiles/todo.dir/DependInfo.cmake --color=
Scanning dependencies of target todo
make[2]: Leaving directory '/home/jwmurray/todo2/build'
make -f CMakeFiles/todo.dir/build.make CMakeFiles/todo.dir/build
make[2]: Entering directory '/home/jwmurray/todo2/build'
[ 50%] Building CXX object CMakeFiles/todo.dir/main.cpp.o
/software/gnu/gcc/5.3.0/x86_64linux2.6.32/bin/g++    -m64 -Wall   -o CMakeFiles/todo.dir/main.cpp.o -c /home/jwmurray/todo2/main.cpp
[100%] Linking CXX executable todo
/software/doxygen/cmake/3.3.1/linux-x86_64/bin/cmake -E cmake_link_script CMakeFiles/todo.dir/link.txt --verbose=1
/software/gnu/gcc/5.3.0/x86_64linux2.6.32/bin/g++   -m64 -Wall   CMakeFiles/todo.dir/main.cpp.o  -o todo -rdynamic
make[2]: Leaving directory '/home/jwmurray/todo2/build'
[100%] Built target todo
make[1]: Leaving directory '/home/jwmurray/todo2/build'
/software/doxygen/cmake/3.3.1/linux-x86_64/bin/cmake -E cmake_progress_start /home/jwmurray/todo2/build/CMakeFiles 0
jwmurray@beaver:build$

 

 

 

0

Hello!

make from the command line builds the "all" target, but CLion automatically builds the "todo" target. Could you please try to build the "todo" target from the command line and the "all" target in CLion (you can choose "Build All" in the run/debug configuration selector)? What are the results?

0

Anna, thank you for your response!

My results are the same.  if I issue make clean; make todo from the comandline, I get a clean build.  If I run a make all from CLion, I get the same error where it cannot locate the crtl.o file.

 

Here is the build from CLion with build all:

/software/doxygen/cmake/3.3.1/linux-x86_64/bin/cmake --build /home/jwmurray/todo2/cmake-build-debug --target all -- -j 1
/software/doxygen/cmake/3.3.1/linux-x86_64/bin/cmake -H/home/jwmurray/todo2 -B/home/jwmurray/todo2/cmake-build-debug --check-build-system CMakeFiles/Makefile.cmake 0
/software/doxygen/cmake/3.3.1/linux-x86_64/bin/cmake -E cmake_progress_start /home/jwmurray/todo2/cmake-build-debug/CMakeFiles /home/jwmurray/todo2/cmake-build-debug/CMakeFiles/progress.marks
/usr/bin/make -f CMakeFiles/Makefile2 all
make[1]: Entering directory '/home/jwmurray/todo2/cmake-build-debug'
/usr/bin/make -f CMakeFiles/todo.dir/build.make CMakeFiles/todo.dir/depend
make[2]: Entering directory '/home/jwmurray/todo2/cmake-build-debug'
cd /home/jwmurray/todo2/cmake-build-debug && /software/doxygen/cmake/3.3.1/linux-x86_64/bin/cmake -E cmake_depends "Unix Makefiles" /home/jwmurray/todo2 /home/jwmurray/todo2 /home/jwmurray/todo2/cmake-build-debug /home/jwmurray/todo2/cmake-build-debug /home/jwmurray/todo2/cmake-build-debug/CMakeFiles/todo.dir/DependInfo.cmake --color=
make[2]: Leaving directory '/home/jwmurray/todo2/cmake-build-debug'
/usr/bin/make -f CMakeFiles/todo.dir/build.make CMakeFiles/todo.dir/build
make[2]: Entering directory '/home/jwmurray/todo2/cmake-build-debug'
[ 50%] Building CXX object CMakeFiles/todo.dir/main.cpp.o
/software/gnu/gcc/5.3.0/x86_64linux2.6.32/bin/g++    -m64 -Wall -g   -o CMakeFiles/todo.dir/main.cpp.o -c /home/jwmurray/todo2/main.cpp
[100%] Linking CXX executable todo
/software/doxygen/cmake/3.3.1/linux-x86_64/bin/cmake -E cmake_link_script CMakeFiles/todo.dir/link.txt --verbose=1
/software/gnu/gcc/5.3.0/x86_64linux2.6.32/bin/g++   -m64 -Wall -g   CMakeFiles/todo.dir/main.cpp.o  -o todo -rdynamic
/usr/bin/ld: cannot find crt1.o: No such file or directory
/usr/bin/ld: cannot find crti.o: No such file or directory
collect2: error: ld returned 1 exit status
CMakeFiles/todo.dir/build.make:97: recipe for target 'todo' failed
make[2]: *** [todo] Error 1
make[2]: Leaving directory '/home/jwmurray/todo2/cmake-build-debug'
CMakeFiles/Makefile2:70: recipe for target 'CMakeFiles/todo.dir/all' failed
make[1]: *** [CMakeFiles/todo.dir/all] Error 2
make[1]: Leaving directory '/home/jwmurray/todo2/cmake-build-debug'
Makefile:86: recipe for target 'all' failed
make: *** [all] Error 2

Here is the build from the command line with make todo:

jwmurray@beaver:build$ make clean todo
make -f CMakeFiles/Makefile2 clean
make[1]: Entering directory '/home/jwmurray/todo2/build'
make -f CMakeFiles/todo.dir/build.make CMakeFiles/todo.dir/clean
make[2]: Entering directory '/home/jwmurray/todo2/build'
/software/doxygen/cmake/3.3.1/linux-x86_64/bin/cmake -P CMakeFiles/todo.dir/cmake_clean.cmake
make[2]: Leaving directory '/home/jwmurray/todo2/build'
make[1]: Leaving directory '/home/jwmurray/todo2/build'
/software/doxygen/cmake/3.3.1/linux-x86_64/bin/cmake -H/home/jwmurray/todo2 -B/home/jwmurray/todo2/build --check-build-system CMakeFiles/Makefile.cmake 0
make -f CMakeFiles/Makefile2 todo
make[1]: Entering directory '/home/jwmurray/todo2/build'
/software/doxygen/cmake/3.3.1/linux-x86_64/bin/cmake -H/home/jwmurray/todo2 -B/home/jwmurray/todo2/build --check-build-system CMakeFiles/Makefile.cmake 0
/software/doxygen/cmake/3.3.1/linux-x86_64/bin/cmake -E cmake_progress_start /home/jwmurray/todo2/build/CMakeFiles 2
make -f CMakeFiles/Makefile2 CMakeFiles/todo.dir/all
make[2]: Entering directory '/home/jwmurray/todo2/build'
make -f CMakeFiles/todo.dir/build.make CMakeFiles/todo.dir/depend
make[3]: Entering directory '/home/jwmurray/todo2/build'
cd /home/jwmurray/todo2/build && /software/doxygen/cmake/3.3.1/linux-x86_64/bin/cmake -E cmake_depends "Unix Makefiles" /home/jwmurray/todo2 /home/jwmurray/todo2 /home/jwmurray/todo2/build /home/jwmurray/todo2/build /home/jwmurray/todo2/build/CMakeFiles/todo.dir/DependInfo.cmake --color=
make[3]: Leaving directory '/home/jwmurray/todo2/build'
make -f CMakeFiles/todo.dir/build.make CMakeFiles/todo.dir/build
make[3]: Entering directory '/home/jwmurray/todo2/build'
[ 50%] Building CXX object CMakeFiles/todo.dir/main.cpp.o
/software/gnu/gcc/5.3.0/x86_64linux2.6.32/bin/g++    -m64 -Wall   -o CMakeFiles/todo.dir/main.cpp.o -c /home/jwmurray/todo2/main.cpp
[100%] Linking CXX executable todo
/software/doxygen/cmake/3.3.1/linux-x86_64/bin/cmake -E cmake_link_script CMakeFiles/todo.dir/link.txt --verbose=1
/software/gnu/gcc/5.3.0/x86_64linux2.6.32/bin/g++   -m64 -Wall   CMakeFiles/todo.dir/main.cpp.o  -o todo -rdynamic
make[3]: Leaving directory '/home/jwmurray/todo2/build'
[100%] Built target todo
make[2]: Leaving directory '/home/jwmurray/todo2/build'
/software/doxygen/cmake/3.3.1/linux-x86_64/bin/cmake -E cmake_progress_start /home/jwmurray/todo2/build/CMakeFiles 0
make[1]: Leaving directory '/home/jwmurray/todo2/build'
jwmurray@beaver:build$

 

0

Here is a copy of the test file I am trying to build:

#include <iostream>

int main(int argc, char **argv) {
  std::cout << "Testing Clion cross-compile\n";
  return 0;
}

0

As an experiment, in CLion please do the following:

1. Remove lines about CMAKE_C_COMPILER/CMAKE_CXX_COMPILER from CMakeLists.txt.

2. Specify compilers in File | Settings | Build, Execution, Deployment | Toolchains.

3. Do Tools | CMake | Reset Cache and Reload Project.

4. Try to build the project.

Does the issue still happen?

0

The cmake simple test program file fails

/usr/local/clion-2018.2/bin/cmake/linux/bin/cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=/software/gnu/gcc/5.3.0/x86_64linux2.6.32/bin/gcc -DCMAKE_CXX_COMPILER=/software/gnu/gcc/5.3.0/x86_64linux2.6.32/bin/g++ -G "CodeBlocks - Unix Makefiles" /home/jwmurray/todo2
-- The C compiler identification is GNU 5.3.0
-- The CXX compiler identification is GNU 5.3.0
-- Check for working C compiler: /software/gnu/gcc/5.3.0/x86_64linux2.6.32/bin/gcc
-- Check for working C compiler: /software/gnu/gcc/5.3.0/x86_64linux2.6.32/bin/gcc -- broken
CMake Error at /usr/local/clion-2018.2/bin/cmake/linux/share/cmake-3.12/Modules/CMakeTestCCompiler.cmake:52 (message):
  The C compiler

    "/software/gnu/gcc/5.3.0/x86_64linux2.6.32/bin/gcc"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: /home/jwmurray/todo2/cmake-build-debug/CMakeFiles/CMakeTmp
   
    Run Build Command:"/usr/bin/make" "cmTC_c3c5b/fast"
    /usr/bin/make -f CMakeFiles/cmTC_c3c5b.dir/build.make CMakeFiles/cmTC_c3c5b.dir/build
    make[1]: Entering directory '/home/jwmurray/todo2/cmake-build-debug/CMakeFiles/CMakeTmp'
    Building C object CMakeFiles/cmTC_c3c5b.dir/testCCompiler.c.o
    /software/gnu/gcc/5.3.0/x86_64linux2.6.32/bin/gcc    -o CMakeFiles/cmTC_c3c5b.dir/testCCompiler.c.o   -c /home/jwmurray/todo2/cmake-build-debug/CMakeFiles/CMakeTmp/testCCompiler.c
    Linking C executable cmTC_c3c5b
    /usr/local/clion-2018.2/bin/cmake/linux/bin/cmake -E cmake_link_script CMakeFiles/cmTC_c3c5b.dir/link.txt --verbose=1
    /software/gnu/gcc/5.3.0/x86_64linux2.6.32/bin/gcc      -rdynamic CMakeFiles/cmTC_c3c5b.dir/testCCompiler.c.o  -o cmTC_c3c5b
    /usr/bin/ld: cannot find crt1.o: No such file or directory
    /usr/bin/ld: cannot find crti.o: No such file or directory
    collect2: error: ld returned 1 exit status
    CMakeFiles/cmTC_c3c5b.dir/build.make:86: recipe for target 'cmTC_c3c5b' failed
    make[1]: *** [cmTC_c3c5b] Error 1
    make[1]: Leaving directory '/home/jwmurray/todo2/cmake-build-debug/CMakeFiles/CMakeTmp'
    Makefile:121: recipe for target 'cmTC_c3c5b/fast' failed
    make: *** [cmTC_c3c5b/fast] Error 2
   

 

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


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

[Failed to reload]

 

0

I tried this using the bundled cmake (version 3.12) and with the version that comes with my toolchain, (version 3.3.1) and got the same failures to locate the linking object file.

0

John, thank you for your patience. I kindly ask you to try using a toolchain file. There is a tutorial for cross-compiling: https://gitlab.kitware.com/cmake/community/wikis/doc/cmake/CrossCompiling. Please create a toolchain file as described in tutorial, remove all toolchain information from CMakeLists.txt file, and provide the toolchain file using -DCMAKE_TOOLCHAIN_FILE in File | Settings | Build, Execution, Deployment | CMake | CMake Options. Does it help or does the issue still occur?

0

This seems to be a bug in cmake.  When the Compiler settings are set in the CMakeLists.txt file, CMake uses the local compiler to build a simple test program and then compiles using the cross compiler.

However, when cmake is explicitly given a toolchain file, cmake will use the toolchain for compiling the simple test program.

Clion seems to fail because somehow, it is passing the toolchain file to cmake, even though I did create a toolchain file.

I wish Clion would just call cmake the same way I do from the command line and not try to scan for the cross-compiler flags and pass those to cmake as a toolchain under the covers--or at least that is what appears to be happening based on the experiment.

I am trying to convince my company that we can use CLion as a development and debugging environment.  Any suggested workarounds?

Anyway, here is the output of the experiment:

jwmurray@beaver:myb$ cmake -DCMAKE_TOOLCHAIN_FILE=~/todo2/Toolchain-gcc-5.3.0.cmake  ..
-- The C compiler identification is GNU 5.3.0
-- The CXX compiler identification is GNU 5.3.0
-- Check for working C compiler: /software/gnu/gcc/5.3.0/x86_64linux2.6.32/bin/gcc
-- Check for working C compiler: /software/gnu/gcc/5.3.0/x86_64linux2.6.32/bin/gcc -- broken
CMake Error at /software/doxygen/cmake/3.3.1/linux-x86_64/share/cmake-3.3/Modules/CMakeTestCCompiler.cmake:61 (message):
  The C compiler "/software/gnu/gcc/5.3.0/x86_64linux2.6.32/bin/gcc" is not
  able to compile a simple test program.

  It fails with the following output:

   Change Dir: /home/jwmurray/todo2/myb/CMakeFiles/CMakeTmp

 

  Run Build Command:"/usr/bin/make" "cmTC_7b2a6/fast"

  /usr/bin/make -f CMakeFiles/cmTC_7b2a6.dir/build.make
  CMakeFiles/cmTC_7b2a6.dir/build

  make[1]: Entering directory '/home/jwmurray/todo2/myb/CMakeFiles/CMakeTmp'

  Building C object CMakeFiles/cmTC_7b2a6.dir/testCCompiler.c.o

  /software/gnu/gcc/5.3.0/x86_64linux2.6.32/bin/gcc -o
  CMakeFiles/cmTC_7b2a6.dir/testCCompiler.c.o -c
  /home/jwmurray/todo2/myb/CMakeFiles/CMakeTmp/testCCompiler.c

  Linking C executable cmTC_7b2a6

  /software/doxygen/cmake/3.3.1/linux-x86_64/bin/cmake -E cmake_link_script
  CMakeFiles/cmTC_7b2a6.dir/link.txt --verbose=1

  /software/gnu/gcc/5.3.0/x86_64linux2.6.32/bin/gcc
  CMakeFiles/cmTC_7b2a6.dir/testCCompiler.c.o -o cmTC_7b2a6 -rdynamic

  /usr/bin/ld: cannot find crt1.o: No such file or directory

  /usr/bin/ld: cannot find crti.o: No such file or directory

  collect2: error: ld returned 1 exit status

  CMakeFiles/cmTC_7b2a6.dir/build.make:97: recipe for target 'cmTC_7b2a6'
  failed

  make[1]: Leaving directory '/home/jwmurray/todo2/myb/CMakeFiles/CMakeTmp'

  Makefile:126: recipe for target 'cmTC_7b2a6/fast' failed

  make[1]: *** [cmTC_7b2a6] Error 1

  make: *** [cmTC_7b2a6/fast] Error 2

 

 

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


-- Configuring incomplete, errors occurred!
See also "/home/jwmurray/todo2/myb/CMakeFiles/CMakeOutput.log".
See also "/home/jwmurray/todo2/myb/CMakeFiles/CMakeError.log".
jwmurray@beaver:myb$

 

0

Thank you!  Your help was incredible!

Again, this is a cmake bug where cmake requires the installation of a library in order to compile their test program.

This stackexchange article talks about it:

     https://stackoverflow.com/questions/6329887/compiling-problems-cannot-find-crt1-o

I actually had all the files installed on my system.  By issuing the following command, the problem was solved for Ubuntu 18.04:

     sudo ln -s /usr/lib/x86_64-linux-gnu /usr/lib64

According to the post, this has something to do with 32 bit and 64 bit compilers/libs.

Thank you for your help!  Again, it is a surprise to me that a CMakeLists.txt file that works from the command line did not work in CLion.  I now see why.  I wish CLion would change that, but I can see why CLion would claim the bug is in cmake and that it should not have worked from the commandline as written.

Incidentally, I tested this from a CentOS7 system and did not hit this bug.

1

John, I'm so glad to hear that you've solved the issue! And thanks a lot for sharing the solution here.

1

Hello John and Anna.

first of all I want to let you know that I am fairly new to CMake, CLion, C++.

I am running arch linux with a debian jessie chroot in which the project is built.

I'm experiencing the exact same issue when compiling a cmake project in CLion. As John I was able to build the project perfectly fine from inside the chroot in the command line but failed to build the project inside CLion. I tried removing the toolchain completely so the main CMakeLists.txt file would set all the variables but the linker error persisted.

I will try John's suggestion and report back on the results. I will further try to comprehend how this issue arises.

0

Hi, @Sbeat! Have you managed to resolve the issue?

0

请先登录再写评论。