How to include header file through make file

I know that there is a flag that can be used in the makefile to include the header file in all files that are compiled, just as there is a -D flag to include the definition. Which flag is intended to include header files. I don’t remember, I know.

+5
source share
2 answers

In your compilation command, you can use the option -include:

gcc -o main -include hello.h main.cpp 
+8
source

something like this maybe? include_directories ($ {CMAKE_CURRENT_SOURCE_DIR} / enable)

0
source

All Articles