Hello,<br><br>I am new to CMake and following a few examples, I am now trying to cross-compile a C++ program from Cygwin to Linux, and I got the following errors:<br><br>CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.<br>
Missing variable is:<br>CMAKE_C++_COMPILER_ENV_VAR<br>CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.<br>Missing variable is:<br>
CMAKE_C++_COMPILER<br>:<br><br><br>I have a folder named helloC++-linux, where I have all my stuff:<br>A simple hello.cpp program<br>My CMakeLists.txt contains:<br>    #CMakeLists.txt :  CMake configuration file<br>    PROJECT(helloC++-linux C++)<br>
<br>    #States that CMake required version must be &gt;= 2.6<br>    CMAKE_MINIMUM_REQUIRED(VERSION 2.6)<br><br>    #File to build and executable:<br>    ADD_EXECUTABLE(hello.o hello.cpp)<br><br>My Toolchain file (named Toolchain-linuxcpp.cmake) contains:<br>
   INCLUDE (CMakeForceCompiler)<br>   SET(CMAKE_SYSTEM_NAME Linux)<br><br>   #specify the cross-compiler<br>   SET(CMAKE_CXX_COMPILER /bin/g++-linux)<br><br><br>and I tried to build it using following command:<br>cmake -DCMAKE_TOOLACHAIN_FILE=./Toolchain-linuxcpp.cmake .<br>
<br><br>Before this, I tried it compiling a simple C program, using gcc-linux compiler and setting CMAKE_C_COMPILER variable, and it worked correctly, but once that I am trying to do it with C++ I got these errors. I couldn&#39;t find anything about this on the web. Could you help me please?<br>
<br>Thanks<br><br>Enrique<br><br>