I am building a C++ application at the command line (using make
with an open-source library (Xerces 2.8)). One of the files includes an OSX system file,
#include <TextUtils.h>
When I type make -n
to determine the command used to compile the given file, there is no include path for the system framework files provided. Therefore, I assume that on OSX the gcc compiler looks in a default location for system include files.
I would like to know what this location is. When I search for TextUtils.h
, I see many versions of the file in different locations, including a few different possible candidates for what might be a default location.
How can I determine the default path the system uses for system include files?
What is the default PATH variable in Mac? Ideally, the shell config or profile files comprise the following as the default PATH variable in Mac: /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin, to allow you to execute various programs or commands in the terminal without specifying their absolute paths.
Show the path to a file or folder On your Mac, click the Finder icon in the Dock to open a Finder window. Choose View > Show Path Bar, or press the Option key to show the path bar momentarily. The location and nested folders that contain your file or folder are displayed near the bottom of the Finder window.
sdk . From there, usr/include holds common public headers such as the standard C headers, and various Apple headers are in frameworks under System . In /Applications/Xcode. app/Contents/Developer/Platforms , you will likely find folders for other platforms, such as iPhoneOS.
To start, open a Finder window in whatever manner you choose. Once it's open, navigate to the toolbar at the top, then click the “Go” menu. Here, scroll to the bottom and choose “Go to Folder.” In the dialog that pops up, drag and drop your file onto the path field.
Executing the following command
# echo "" | gcc -xc - -v -E
will output the buildin configuration of gcc among which are the default includes.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With