Skip to content

Conversation

@pkok
Copy link
Contributor

@pkok pkok commented Jan 27, 2020

When running CMake to initialize the build folder, the following error
occured:

-- Looking for include file inttypes.h
CMake Error at /usr/share/cmake-3.10/Modules/CheckIncludeFiles.cmake:69 (try_compile):
  Unknown extension ".c" for file

    /home/pkok/cpp-serializers/build/CMakeFiles/CMakeTmp/CheckIncludeFiles.c

  try_compile() works only for enabled languages.  Currently these are:

    CXX

  See project() command to enable other languages.
Call Stack (most recent call first):
  CMakeLists.txt:23 (CHECK_INCLUDE_FILES)

-- Looking for include file inttypes.h - not found
-- Looking for include file netinet/in.h
CMake Error at /usr/share/cmake-3.10/Modules/CheckIncludeFiles.cmake:69 (try_compile):
  Unknown extension ".c" for file

    /home/pkok/cpp-serializers/build/CMakeFiles/CMakeTmp/CheckIncludeFiles.c

  try_compile() works only for enabled languages.  Currently these are:

    CXX

  See project() command to enable other languages.
Call Stack (most recent call first):
  CMakeLists.txt:24 (CHECK_INCLUDE_FILES)

This seems to be a common
problem
. This can be
fixed by telling CMake that you also want to use the C language in the
project. This has been done in l.2 of CMakeLists.txt.

When running CMake to initialize the build folder, the following error
occured:

```
-- Looking for include file inttypes.h
CMake Error at /usr/share/cmake-3.10/Modules/CheckIncludeFiles.cmake:69 (try_compile):
  Unknown extension ".c" for file

    /home/pkok/cpp-serializers/build/CMakeFiles/CMakeTmp/CheckIncludeFiles.c

  try_compile() works only for enabled languages.  Currently these are:

    CXX

  See project() command to enable other languages.
Call Stack (most recent call first):
  CMakeLists.txt:23 (CHECK_INCLUDE_FILES)

-- Looking for include file inttypes.h - not found
-- Looking for include file netinet/in.h
CMake Error at /usr/share/cmake-3.10/Modules/CheckIncludeFiles.cmake:69 (try_compile):
  Unknown extension ".c" for file

    /home/pkok/cpp-serializers/build/CMakeFiles/CMakeTmp/CheckIncludeFiles.c

  try_compile() works only for enabled languages.  Currently these are:

    CXX

  See project() command to enable other languages.
Call Stack (most recent call first):
  CMakeLists.txt:24 (CHECK_INCLUDE_FILES)
```

This seems to be [a common
problem](http://www.grokit.ca/cnt/CMakeProblemsSolutions/).  This can be
fixed by telling CMake that you also want to use the C language in the
project.  This has been done in l.2 of `CMakeLists.txt`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant