What does -include mean when using g++

109 Views Asked by At

I am trying to understand how my makefile works and have come accross the following command:

g++ -g -Wall -O3 -Wno-unused-function -Wno-unused-variable -O0 -std=c++11 runAlgo.cpp bfs.cpp Node.cpp distribution.cpp resultSet.cpp -include 8puzzle.c -o 8puzzle.bfs

What does the -include part mean?

1

There are 1 best solutions below

0
On

What does the -include part mean?

According to man gcc:

...

-include file

Process file as if "#include "file"" appeared as the first line of the primary source file.

...

So in your case content of 8puzzle.c is added at the beginning of runAlgo.cpp.

You can check it using -save-temps option and explore runAlgo.ii preprocessed file.