- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试使用CMake来构建将MSPGCC cross-compiler用于MSP430微 Controller 的项目。要使用它成功编译任何简单程序,我们需要传递一个指示目标处理器的编译标志,否则它将失败,如下所示:
$ msp430-gcc -o test test.c
In file included from test.c:1:0:
/usr/local/lib/gcc/msp430/4.6.3/../../../../msp430/include/msp430.h:813:2: warning: #warning Unable to identify and include MCU header, use -mmcu=MCU [-Wcpp]
/usr/local/lib/gcc/msp430/4.6.3/../../../../msp430/bin/ld: cannot open linker script file memory.x: No such file or directory
collect2: ld returned 1 exit status
-mmcu
开关指示处理器,则可以正常工作。问题是,尽管我已经在自己的
CMakeLists.txt 文件中指定了它:
cmake_minimum_required (VERSION 2.6)
project (test-project C)
set (SOURCES
test.c
)
add_executable (test-project ${SOURCES})
set (CPU_FLAG "-mmcu=msp430f148")
set (CMAKE_C_FLAGS ${CPU_FLAG})
set (CMAKE_EXE_LINKER_FLAGS ${CPU_FLAG})
-mmcu
开关的(请注意有关无法打开链接描述文件memory.x的消息):
$ cd ~/git/test-project
$ mkdir build
$ cd build
$ cmake -DCMAKE_TOOLCHAIN_FILE=../msp430.cmake ..
-- The C compiler identification is GNU 4.6.3
-- Check for working C compiler: /usr/local/bin/msp430-gcc
-- Check for working C compiler: /usr/local/bin/msp430-gcc -- broken
CMake Error at /usr/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:52 (MESSAGE):
The C compiler "/usr/local/bin/msp430-gcc" is not able to compile a simple
test program.
It fails with the following output:
Change Dir: /home/claudio/git/test-project/build/CMakeFiles/CMakeTmp
Run Build Command:/usr/bin/gmake "cmTryCompileExec2889462763/fast"
/usr/bin/gmake -f CMakeFiles/cmTryCompileExec2889462763.dir/build.make
CMakeFiles/cmTryCompileExec2889462763.dir/build
gmake[1]: Entering directory
`/home/claudio/git/test-project/build/CMakeFiles/CMakeTmp'
/usr/bin/cmake -E cmake_progress_report
/home/claudio/git/test-project/build/CMakeFiles/CMakeTmp/CMakeFiles 1
Building C object
CMakeFiles/cmTryCompileExec2889462763.dir/testCCompiler.c.o
/usr/local/bin/msp430-gcc -o
CMakeFiles/cmTryCompileExec2889462763.dir/testCCompiler.c.o -c
/home/claudio/git/test-project/build/CMakeFiles/CMakeTmp/testCCompiler.c
Linking C executable cmTryCompileExec2889462763
/usr/bin/cmake -E cmake_link_script
CMakeFiles/cmTryCompileExec2889462763.dir/link.txt --verbose=1
/usr/local/bin/msp430-gcc
CMakeFiles/cmTryCompileExec2889462763.dir/testCCompiler.c.o -o
cmTryCompileExec2889462763 -rdynamic
/usr/local/lib/gcc/msp430/4.6.3/../../../../msp430/bin/ld: cannot open
linker script file memory.x: No such file or directory
collect2: ld returned 1 exit status
gmake[1]: Leaving directory
`/home/claudio/git/test-project/build/CMakeFiles/CMakeTmp'
gmake[1]: *** [cmTryCompileExec2889462763] Error 1
gmake: *** [cmTryCompileExec2889462763/fast] Error 2
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:3 (project)
-- Configuring incomplete, errors occurred!
/usr/local/bin
处找到编译器二进制文件:
# the name of the target operating system
#SET(CMAKE_SYSTEM_NAME Linux)
# which C and C++ compiler to use
SET(CMAKE_C_COMPILER msp430-gcc)
SET(CMAKE_CXX_COMPILER msp430-g++)
# here is the target environment located
SET(CMAKE_FIND_ROOT_PATH /usr/local/msp430)
# adjust the default behaviour of the FIND_XXX() commands:
# search headers and libraries in the target environment, search
# programs in the host environment
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
-mmcu
),这样它才不会失败?
最佳答案
根据文档:
http://www.cmake.org/Wiki/CMake_Cross_Compiling#The_toolchain_file
您应该使用CMakeForceCompiler东西
INCLUDE(CMakeForceCompiler)
# this one is important
SET(CMAKE_SYSTEM_NAME eCos)
# specify the cross compiler
CMAKE_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 directories
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
# for libraries and headers in the target directories
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
关于cmake - 如何通过编译标志来进行初始编译器测试?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13012937/
我有两个维度 DimFlag 和 DimPNL 以及一个事实表 FactAmount 。我正在寻找:当 pnl 是 stat(Is Stat=1) 时:sum (Actual x FlagId)对于
我试图弄清楚登录模块标志在 JAAS 中是如何工作的(使用 JBoss 5.1 EAP),我遇到了一个令人费解的情况,我希望有人能为我澄清一下。 对于背景,我的 login-config.xml 如下
关闭。这个问题是off-topic .它目前不接受答案。 想改进这个问题吗? Update the question所以它是on-topic用于堆栈溢出。 关闭 9 年前。 Improve this
我正在通过 gradle 使用 doclet 运行 javadoc,当我运行 javadoc/doclet 任务时,我收到下一个错误: error - invalid flag: -doctitle
我尝试使用sqoop --where标志将特定的行从MySQL表导入到HDFS,但是结果不符合预期。 命令: sqoop import \ --connect "jdbc:mysql://XXXX
我有一个语言面板,其中有一个图像 (main-image),显示页面加载时的情况。我还有三个额外的图像,它们在页面加载时隐藏。 问题是当点击附加图像之一时如何切换主图像。我需要使用单击的 image
奇怪...在 StackOverflow 上有很多关于此 attr 的问题,但没有人回答我的以下问题: 我有一个span(仅作为示例),其中启用了ContentEditable。我只想保存更改的元素(
我正在使用 ChartJS 2.0 在 UI 上绘制图表。而且我能够呈现饼图。但我希望鼠标悬停时显示数据以及“%”符号。我如何追加 % 因此,如果在鼠标悬停时我得到 Rented: 93 我想看到 R
我使用的是 Servlet 3.0,我想用 HttpOnly 标志保护我的 cookie。我的 web.xml 是 true
我有一个简单的服务: public class TestService extends Service { final String LOG_TAG = "myLogs"; public void o
我正在尝试将 wget 与包含“#”符号的 url 一起使用。无论我做什么来逃避这个角色,它都不起作用。我用过\、' 和 "。但它们都不起作用。有人有什么建议吗? 谢谢! 最佳答案 如果您真的想让它有
我正在尝试创建一个数据库,但我不知道如何转义数据库名称中的 - 符号。 mysql> create database happy-face; 给我一个错误 mysql> create databa
我为我的计算机科学类(class)编写了一个程序,它读取一个文件并导入数据,然后只添加数字,但它似乎添加了一个额外的加号。 import java.io.*; //necessary for File
可能是个愚蠢的问题,但我怎样才能在与某些文本看到图像相同的行中获取图像(在本例中为标志)? 到目前为止我的 HTML 代码: FRA 最佳答案 试试这个: img { height:20px
我需要一些有关 clone() 系统调用的帮助。我试图将它与标志 CLONE_CHILD_CLEARTID 一起使用,但我看不到我指定为参数的字段值有任何变化。这是一个简单的代码: int the_c
查看 mySQL 转储时,我遇到了一些东西,想知道它们是什么。 我明白了: /*!50001 DROP TABLE IF EXISTS `xxx` */; flag 50001是什么意思,有什么意思的
是否可以传递任何 Java 编译器标志来告诉编译器不允许使用原始类型?也就是说,对于任何泛型类,让编译器强制使用参数化版本,否则抛出编译错误? 最佳答案 JDK7 (b38) 介绍 -Xlint:ra
[Flags] public enum MyEnum { None = 0, Setting1 = (1 GetAllEnums() where T : struct
我正在浏览 PackageManager API。我发现定义了以下常量: 1) GET_DISABLED_COMPONENTS 2) GET_DISABLED_UNTIL_USED_COMPONENT
我编写了一个 Go 程序来模拟按键操作。为此,我必须使用 cgo 和不同的 C 代码片段,具体取决于正在编译 Go 代码的操作系统。我编写的代码如下所示: package keyboard /* #i
我是一名优秀的程序员,十分优秀!