[BUG] Failed to execute cmake at client_server directory. #112

Closed
opened 2026-01-29 15:03:46 +00:00 by claunia · 5 comments
Owner

Originally created by @nieyuyao on GitHub (Mar 26, 2022).

Description

An error is occurred when i execute cmake . at client_server directory.

cmake .
CMake Warning (dev) in CMakeLists.txt:
  No project() command is present.  The top-level CMakeLists.txt file must
  contain a literal, direct call to the project() command.  Add a line of
  code such as

    project(ProjectName)

  near the top of the file, but after cmake_minimum_required().

  CMake is pretending there is a "project(Project)" command on the first
  line.
This warning is for project developers.  Use -Wno-dev to suppress it.

-- The C compiler identification is AppleClang 13.0.0.13000029
-- The CXX compiler identification is AppleClang 13.0.0.13000029
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at CMakeLists.txt:4 (check_include_file):
  Unknown CMake command "check_include_file".


CMake Warning (dev) in CMakeLists.txt:
  No cmake_minimum_required command is present.  A line of code such as

    cmake_minimum_required(VERSION 3.22)

  should be added at the top of the file.  The version specified may be lower
  if you wish to support older CMake versions for this project.  For more
  information run "cmake --help-policy CMP0000".
This warning is for project developers.  Use -Wno-dev to suppress it.

Expected behavior

Generate makefile successfully

Actual behavior

Failed to generate makefile

Possible fix

No response

Steps to reproduce

  1. cd client_server
  2. cmake .

Context

I was trying to understand the implementation of tcp and udp server

Additional information

No response

Originally created by @nieyuyao on GitHub (Mar 26, 2022). ### Description An error is occurred when i execute `cmake .` at `client_server` directory. ``` cmake . CMake Warning (dev) in CMakeLists.txt: No project() command is present. The top-level CMakeLists.txt file must contain a literal, direct call to the project() command. Add a line of code such as project(ProjectName) near the top of the file, but after cmake_minimum_required(). CMake is pretending there is a "project(Project)" command on the first line. This warning is for project developers. Use -Wno-dev to suppress it. -- The C compiler identification is AppleClang 13.0.0.13000029 -- The CXX compiler identification is AppleClang 13.0.0.13000029 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done CMake Error at CMakeLists.txt:4 (check_include_file): Unknown CMake command "check_include_file". CMake Warning (dev) in CMakeLists.txt: No cmake_minimum_required command is present. A line of code such as cmake_minimum_required(VERSION 3.22) should be added at the top of the file. The version specified may be lower if you wish to support older CMake versions for this project. For more information run "cmake --help-policy CMP0000". This warning is for project developers. Use -Wno-dev to suppress it. ``` ### Expected behavior Generate makefile successfully ### Actual behavior Failed to generate makefile ### Possible fix _No response_ ### Steps to reproduce 1. `cd client_server` 2. `cmake .` ### Context I was trying to understand the implementation of tcp and udp server ### Additional information _No response_
claunia added the bugdont-close labels 2026-01-29 15:03:46 +00:00
Author
Owner

@nieyuyao commented on GitHub (Mar 26, 2022):

Executed successfully when i add include(CheckIncludeFile) to client_server/CMakeLists.

include(CheckIncludeFile)

if(WIN32)
    check_include_file(winsock2.h WINSOCK_HEADER)
else()
    check_include_file(arpa/inet.h ARPA_HEADERS)
endif()

@nieyuyao commented on GitHub (Mar 26, 2022): Executed successfully when i add `include(CheckIncludeFile)` to `client_server/CMakeLists`. ``` include(CheckIncludeFile) if(WIN32) check_include_file(winsock2.h WINSOCK_HEADER) else() check_include_file(arpa/inet.h ARPA_HEADERS) endif() ```
Author
Owner

@mucahitdemir commented on GitHub (Apr 24, 2022):

I would also advise the same way you did.

@mucahitdemir commented on GitHub (Apr 24, 2022): I would also advise the same way you did.
Author
Owner

@github-actions[bot] commented on GitHub (May 25, 2022):

This issue has been automatically marked as abandoned because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions[bot] commented on GitHub (May 25, 2022): This issue has been automatically marked as abandoned because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Author
Owner

@rbevin777 commented on GitHub (Jul 6, 2023):

Anyone mind if I take a look at this?

@rbevin777 commented on GitHub (Jul 6, 2023): Anyone mind if I take a look at this?
Author
Owner

@rbevin777 commented on GitHub (Jul 7, 2023):

PR ready for review here: https://github.com/TheAlgorithms/C/pull/1285

@rbevin777 commented on GitHub (Jul 7, 2023): PR ready for review here: https://github.com/TheAlgorithms/C/pull/1285
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/C#112