[CMake] CMake: C-code and Visual Studio 2005 problem.

William A. Hoffman billlist at nycap.rr.com
Wed May 3 23:11:08 EDT 2006


At 10:29 PM 5/3/2006, Andrew Maclean wrote:
>I am having difficulty linking pure c-code using CMake and Visual Studio
>2005.
>
>I have set the following:
>PROJECT ( gpsbabel C )
>
>So in theory the compiler should be set for C code only. However this does
>not seem to be the case, because in the [properties] [C/C++] [advanced] page
>/TP is set indicating that C++ only is being compiled. If I set this to
>default or to /TC, it seems to have no effect.
>
>
>I am pretty sure that this is a CMake/Visual Studio 2005 problem because I
>converted an existing gpsbabel VS7.1 to VS8.0 and it works Ok after adding
>in some missing files to the project. 
>
>
>The CMakeLists.txt file works Ok under Linux.
>
>
>Can anyone offer some comments/help here. If so I can make available the
>CMakeLists.txt file that I am using.
>
>Thanks in advance for any help.
>
>By the way I am using CMake 2.5 - development (last Sunday's version). The
>Linux version is a slightly more recent one.
>
>Andrew
> 

So, it could be that someone changed the settings in your VS installation so
that .c files are considered C++ and not C.  What is the extension of the source
files you are compiling?   There is a test in cmake called Conly.  If you build
from source, try building that project Tests/COnly.   It should be the c compiler.

-Bill



More information about the CMake mailing list