Problem with CMake

Question:
Hey guys, ho are you all?? Hope well. I’m getting an error when I try to execute a c file. Let me put it here:


 sh -c cmake --log-level=WARNING -B/tmp/build . && make -s -C /tmp/build
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/build
[  0%] Built target copy-compile-commands
CMakeFiles/main.dir/depend.make:10: *** target pattern contains no '%'.  Stop.
make[1]: *** [CMakeFiles/Makefile2:123: CMakeFiles/main.dir/all] Error 2
make: *** [Makefile:103: all] Error 2
exit status 2

Does anyone knows how to fix this problem??? I have no idea. I tried google search and also stackoverflow, but not very meaningfull infos. Any help will b very appreciated! Bellow I going to post the link to the repo. Thanks in advance!!

Repl link/Link to where the bug appears:
https://replit.com/@DeusielCunha/C-Bootcamp-Udemy

Your directory structure must always matches your CMake configuration, so:

  • Your header files must be inside an include directory.
  • Your source files must be inside a src directory.

Fix your directory structure first and try again.

2 Likes

Another thing I noticed is that the paths you use in headers.h contain spaces. Avoid this or you will have a headache later on.

1 Like