关于cmake is not able to compile a simple test program
来源:互联网 发布:二胡软件 编辑:程序博客网 时间:2024/06/05 16:46
指定了交叉编译
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_FIND_ROOT_PATH "/opt/mips/eldk4.1/usr/bin")
set(CMAKE_C_COMPILER "${CMAKE_FIND_ROOT_PATH}/mips_4KC-gcc")
但报错compile tools can not be able to build a simple program
如下可解决
You don't have to write a toolchain file for every piece of software you want to build, the toolchain files are per target platform, i.e. if you are building several software packages all for the same target platform, you have to write only one toolchain file and you can use this for all packages.
If your compiler is not able to build a simple program by default without special flags or files (e.g. linker scripts or memory layout files), the toolchain file as shown above doesn't work. Then you have to force the compiler:
INCLUDE(CMakeForceCompiler)# this one is importantSET(CMAKE_SYSTEM_NAME eCos)# specify the cross compilerCMAKE_FORCE_C_COMPILER(arm-elf-gcc GNU)CMAKE_FORCE_CXX_COMPILER(arm-elf-g++ GNU)# where is the target environment SET(CMAKE_FIND_ROOT_PATH /home/alex/src/ecos/install )# search for programs in the build host directoriesSET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)# for libraries and headers in the target directoriesSET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
- 关于cmake is not able to compile a simple test program
- CMake broken --is not able to compile a simple test program
- win7 vs2010 ogre1.72(1)cmake的问题compiler "cl" is not able to compile a simple test program.
- win7 vs2010 ogre1.72(1)cmake的问题compiler "cl" is not able to compile a simple test program.
- cmake编译ITK报错:The C compiler is not able to compile a simple test program
- compiler "cl" is not able to compile a simple test program.
- cmake not able to find pkg-config 、openssl
- redis学习记录-关于MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist
- How to write a simple shell program
- cocoapods was not able to update the 'master' repo.if it is a unexpected issue and persists you can
- CocoaPods问题: CocoaPods was not able to update the `master` repo.if it is a unexpected issue and
- How to compile a APR test script
- A program to check if a binary tree is BST or not
- community declares a dependency from configuration 'compile' to configuration 'default' which is not
- app declares a dependency from configuration 'compile' to configuration 'default' which is not decla
- Program is not a recognized executable
- The Linker Is not a Magical Program
- The Linker Is Not a Magical Program
- JavaScript闭包中的this
- springMVC (五) annotation-driven
- java之九 基本输入输出流
- 山东省第六届ACM大学生程序设计竞赛-Lowest Unique Price(桶排序)
- Java中Vector ArrayList LinkedList之间的区别与联系
- 关于cmake is not able to compile a simple test program
- SpringMVC的表单验证方式
- (C++)int,char,string之间的一些转换
- C++中的STL中map用法详解(1)
- Hbase 1.2.1 Java API简单demo
- Android多用户模式的特性
- 六角幻方(DFS)
- O2O、C2C、B2B、B2C的区别
- javassist 学习笔记