CMake error while binding

I have CMakeLists.txtfor my project C++that works great on Windows, using MSVCand on Linux with gcc. I am also trying to use the same file for cross-compiling on Windows for Linux.

I use Eclipse CDT4 - Unix Makefilesas a generator to create a makefile project in Eclipse. To use the cross compiler, I created the following toolchain file

set(CMAKE_SYSTEM_NAME Linux)

set(TOOL_CHAIN_ROOT "C:/mgc/embedded/codebench")

# specify the cross compiler
set(CMAKE_C_COMPILER   ${TOOL_CHAIN_ROOT}/bin/x86_64-amd-linux-gnu-gcc.exe)
set(CMAKE_CXX_COMPILER ${TOOL_CHAIN_ROOT}/bin/x86_64-amd-linux-gnu-g++.exe)
set(_ECLIPSE_VERSION "4.5")

and that’s how I generate project files

cmake -G"Eclipse CDT4 - Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=../Source/cross-tool.cmake ../Source`

I have no problem here. I can even compile the source files with

cmake --build .

The project begins to compile, but at the very end, when he tries to associate it with this error:

[100%] Linking CXX executable crossProject
x86_64-amd-linux-gnu-g++.exe: error: CMakeFiles/crossProject.dir/Path/To/ObjectFile.cpp.o: No such file or directory
make.exe[2]: *** [crossProject] Error 1
make.exe[1]: *** [CMakeFiles/crossProject.dir/all] Error 2
make.exe: *** [all] Error 2

But when I check CMakeFiles/crossProject.dir, I see an object file that it complains of which it cannot find. It is right there.

- , , . , - Eclipse CMake. -.

, x86_64-amd-linux-gnu-ld.exe <<2 → x86_64-amd-linux-gnu-g++.exe?

+4
1

- Windows, CMake. , , Windows 8192 . , 8192 . , CMake, 11353 .

. , GNU ARM Eclipse Build Tools sourceforge.

make.exe sh.exe <Installation-Path>/bin , !

, qnx - gcc - cross gcc, .

0
source

Source: https://habr.com/ru/post/1652162/


All Articles