Try cross compiling using CMAKE, target tool chain is ARM RVCT4, got errors on both Windows and Ubuntu. <br><br>Please help, thanks in advance.&nbsp; <br><br>1. On Ubuntu. <br>&nbsp;ADD_EXECUTABLE(hello main.c)&nbsp;&nbsp; <br>Fatal error: C3900U: Unrecognized option '-rdynamic'.&nbsp;&nbsp;&nbsp; <br><br>
ADD_EXECUTABLE(hello SHARED main.c)&nbsp;&nbsp; <br>
Fatal error: C3900U: Unrecognized option '-fPIC'.&nbsp;&nbsp;&nbsp; <br><br>My question:<br>I don't know why such compiling options have been added automatically by CMAKE? armcc doesn't recognize it. <br><br>2. On Windows XP. <br>My Question:<br>I have set CMAKE_C_COMPILER already, why does it still can't find it? <br><br>G:\t2\build&gt;cmake -G "Unix Makefiles"&nbsp; VERBOSE=1 .. &amp;&amp; make VERBOSE=1<br>-- The C compiler identification is unknown<br>-- The CXX compiler identification is unknown<br>CMake Error: your C compiler: "CMAKE_C_COMPILER-NOTFOUND" was not found.&nbsp;&nbsp; Please set CMAKE_C_COMPILER to a valid compiler path or name.<br>CMake Error: your CXX compiler: "CMAKE_CXX_COMPILER-NOTFOUND" was not found.&nbsp;&nbsp; Please set CMAKE_CXX_COMPILER to a valid compiler path or name.<br><br><br>CMakeLists:<br><br>cmake_minimum_required(VERSION 2.8)<br>PROJECT (HELLO)<br><br>set(RVCT40BIN&nbsp; $ENV{RVCT40BIN})<br>set(RVCT40INC&nbsp; $ENV{RVCT40INC})<br>set(RVCT40LIB&nbsp; $ENV{RVCT40LIB})<br><br>SET (CMAKE_SYSTEM_PROCESSOR arm)<br>SET (CMAKE_CROSSCOMPILING 1)<br><br>SET(CMAKE_C_COMPILER&nbsp; ${RVCT40BIN}/armcc)<br>SET(CMAKE_CXX_COMPILER&nbsp; ${CMAKE_C_COMPILER})&nbsp;&nbsp;&nbsp; <br><br>SET (CMAKE_C_FLAGS&nbsp; "--thumb --cpp -c --cpu ARM9TDMI --apcs /noropi/interwork/norwpi --littleend --split_sections&nbsp;&nbsp; --diag_suppress 177,1165,997,611,68,161,2548 --fpu=softvfp -Ospace -O2")<br>SET (CMAKE_CXX_FLAGS ${CMAKE_C_FLAGS})<br><br>SET (CMAKE_C_CREATE_STATIC_LIBRARY "&lt;CMAKE_AR&gt; --create -cr &lt;LINK_FLAGS&gt; &lt;TARGET&gt; &lt;OBJECTS&gt;")<br>SET (CMAKE_CXX_CREATE_STATIC_LIBRARY "&lt;CMAKE_AR&gt; --create -cr &lt;LINK_FLAGS&gt; &lt;TARGET&gt; &lt;OBJECTS&gt;")<br><br>INCLUDE_DIRECTORIES(${RVCT40INC})<br>LINK_DIRECTORIES(${RVCT40LIB}/armlib&nbsp; ${RVCT40LIB}/cpplib)<br>ADD_EXECUTABLE(hello main.c)<br><br>        
<br><br><span title="neteasefooter"><span id="netease_mail_footer"></span></span>