Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed "Unknown extension"-problem during CMake init. #31

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant