开发者

cmake error:Error in configuration files. Project Files may be invalid

开发者 https://www.devze.com 2023-03-14 14:57 出处:网络
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

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.

and then displaying

CMake Error: Error in cmake code at C:/home/temp/Tutorial/CMakeLists.txt:1: Pa开发者_运维知识库rse error. Expected a newline, got identifier with text "project". Configuring incomplete, errors occurred!

My CmakeList.txt has following :

cmake_minimum_required (VERSION 2.6)
project (Tutorial)

add_executable (Tutorial Tutorial.c)

Please help me.


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

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).


I think that it is just as the error message reads, you need a newline after you specify the required version. Therefore your code should be like:

make_minimum_required (VERSION 2.6) 
project (Tutorial)
add_executable (Tutorial Tutorial.c)
0

精彩评论

暂无评论...
验证码 换一张
取 消