Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
817 views
in Technique[技术] by (71.8m points)

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

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: Parse 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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...