cmake的错误:错误的配置文件。项目文件可能无效 [英] cmake error:Error in configuration files. Project Files may be invalid

查看:6058
本文介绍了cmake的错误:错误的配置文件。项目文件可能无效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新来的CMake的。我写了一个简单的CMake文件,并在cmake的GU​​I运行它。但它显示如下:

I am new to the cmake. I wrote a simple cmake file and ran it in the cmake GUI. But it is displaying as follows

错误的配置文件。项目文件可能是无效的。

Error in configuration files. Project Files may be invalid.

,然后显示

CMake的错误:错误的CMake code。在
C:/home/temp/Tutorial/CMakeLists.txt:1:
解析错误。预计一个换行符,得到了与文本工程标识。
不完整的配置,出现的错误!

CMake Error: Error in cmake code at C:/home/temp/Tutorial/CMakeLists.txt:1: Parse error. Expected a newline, got identifier with text "project". Configuring incomplete, errors occurred!

我CmakeList.txt有以下几点:

My CmakeList.txt has following :

cmake_minimum_required (VERSION 2.6)
project (Tutorial)

add_executable (Tutorial Tutorial.c)

请帮我。

推荐答案

什么操作系统,是你吗?难道你有一种错误的换行字符的文件?

What operating system are you on? Is it possible that you have the wrong kind of newline character in your file?

在Windows(和DOS)的所有口味,新的生产线应该是回车(ASCII 13)和换行(ASCII 10)。在老的Mac,新线应该只是一个回车(ASCII 13)。在Linux和UNIX(包括Mac OS X),新线应该是一个换行符(ASCII 10)。

In all flavors of Windows (and DOS), the new line should be a carriage return (ASCII 13) and line feed (ASCII 10). On older Macs, the new line should be just a carriage return (ASCII 13). On Linux and Unix (including Mac OS X), the new line should be a line feed (ASCII 10).

这篇关于cmake的错误:错误的配置文件。项目文件可能无效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆