Home > Article > Backend Development > How to Include Header Files from Multiple Folders in the GCC Search Path?
Including Header Files in GCC Search Path
When working with complex codebases that span multiple folders, it becomes necessary to add the appropriate search paths to your compiler to locate necessary header files. In this case, GCC can be used to include header files from various folders within a specified path.
To resolve the issue mentioned in the question, where headers are located in different folders within the "/home/me/development/skia" directory, the following steps can be taken:
Solution:
gcc -c -I/home/me/development/skia sample.c
In this command:
By following these steps, GCC will be able to locate and include the necessary header files from the specified path during the compilation process.
The above is the detailed content of How to Include Header Files from Multiple Folders in the GCC Search Path?. For more information, please follow other related articles on the PHP Chinese website!