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. <br><br>1. On Ubuntu. <br> ADD_EXECUTABLE(hello main.c) <br>Fatal error: C3900U: Unrecognized option '-rdynamic'. <br><br>
ADD_EXECUTABLE(hello SHARED main.c) <br>
Fatal error: C3900U: Unrecognized option '-fPIC'. <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>cmake -G "Unix Makefiles" VERBOSE=1 .. && 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. 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. 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 $ENV{RVCT40BIN})<br>set(RVCT40INC $ENV{RVCT40INC})<br>set(RVCT40LIB $ENV{RVCT40LIB})<br><br>SET (CMAKE_SYSTEM_PROCESSOR arm)<br>SET (CMAKE_CROSSCOMPILING 1)<br><br>SET(CMAKE_C_COMPILER ${RVCT40BIN}/armcc)<br>SET(CMAKE_CXX_COMPILER ${CMAKE_C_COMPILER}) <br><br>SET (CMAKE_C_FLAGS "--thumb --cpp -c --cpu ARM9TDMI --apcs /noropi/interwork/norwpi --littleend --split_sections --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 "<CMAKE_AR> --create -cr <LINK_FLAGS> <TARGET> <OBJECTS>")<br>SET (CMAKE_CXX_CREATE_STATIC_LIBRARY "<CMAKE_AR> --create -cr <LINK_FLAGS> <TARGET> <OBJECTS>")<br><br>INCLUDE_DIRECTORIES(${RVCT40INC})<br>LINK_DIRECTORIES(${RVCT40LIB}/armlib ${RVCT40LIB}/cpplib)<br>ADD_EXECUTABLE(hello main.c)<br><br>
<br><br><span title="neteasefooter"><span id="netease_mail_footer"></span></span>