Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the default path for OSX system include files when building a C++ application?

Tags:

c++

macos

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?

like image 569
Dan Nissenbaum Avatar asked Jul 16 '11 05:07

Dan Nissenbaum


People also ask

What is the default path on Mac?

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.

How do I find my application path on Mac?

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.

Where are C header files on Mac?

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.

How do you create a file path on a Mac?

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.


1 Answers

Executing the following command

# echo "" | gcc -xc - -v -E

will output the buildin configuration of gcc among which are the default includes.

like image 184
Eelke Avatar answered Sep 22 '22 07:09

Eelke