Hello again:<br>For some reason when I try to compile a simple C++ program, it takes the wrong compiler, even though I am setting the appropriate one in the Toolchain file; I am working on Cygwin, and I am trying to compile for a LInux environment using g++-linux compiler, which I tested it and works correctly. <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 CXX)<br>    #States that CMake required version must be &gt;= 2.6<br>
    CMAKE_MINIMUM_REQUIRED(VERSION 2.6)<br>    #File to build and executable:<br>    ADD_EXECUTABLE(hello.o hello.cpp)<br><br>My Toolchain file (named Toolchain-linuxcpp.cmake) contains:<br>   SET(CMAKE_SYSTEM_NAME Linux)<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><div id=":dx"><br>But when building, CMake looks for a compiler, and takes  /usr/bin/c++.exe instead of /bin/g++-linux.<br>
<br>I tried also using CMAKE_FORCE_CXX_COMPILER, but I got the same results. Is there any way of<br>make it take the compiler from /bin, instead of from /usr/bin ?<br><br>Thanks<br><br>Best Regards<br><br>Enrique<br></div>
<br>