0

Can anyone tell me how an IDE like NetBeans or any for that matter gather all the standard C++ libraries? For example, I created a new Netbeans C++ application, and included iostream and it worked no problem. However, if I do a search for filename "iostream" on my MacOSX Snow Leapord, it finds it in the path

/Developer/SDKs/MacOSX10.6.sdk/System/Library/Frameworks/Kernel.framework/Versions/A/Headers/IOKit/stream

Does that mean that my IDE is using my operating system's C++ library? It's strange because all of these files are "copyright apple" - so I'm assuming that this is a C++ implementation modified by Apple?

I was under the impression that there was 1 standard C++ libary and all compilers used that. Is Netbeans somehow just gathering the same library that Xcode is bundled with?

Essentially, I'd like to view the source of some C++ headers to gather more information about their inner-workings, but I'm worried that I am using some super-heavyweight, Apple-modified core lib that may not even be legal to use because it's under some Apple liscense.

Thanks everyone

netpoetica
  • 3,375
  • 4
  • 27
  • 37
  • 1
    Mac OSX 10.6 and newer use one of two implementations of the C++ libraries - GCC 4.2.1 (forever stuck in time since GCC switched to GPL3 after that), and [Clang C++](http://clang.llvm.org/), which is a different implementation. I don't have that directory on my system (you might have a different install of software that provides the C++ libs) but Netbeans is likely using GCC 4.2.1 – wkl Sep 14 '12 at 03:44

2 Answers2

1

NetBeans is just an IDE, it doesn't come with a compiler or any C++ libraries. Since it looks like you already had Xcode installed, NetBeans automatically uses compilers and libraries associated with Xcode. I have no idea what the apple licenses are, but since you bought and own your Mac, I don't think there is a problem using those headers.

Also, to view headers, just right click the code and Go To -> C++ Declaration or Header Files.

Jesse Good
  • 50,901
  • 14
  • 124
  • 166
0

There is a place you installed g++, and your include files all come from there. You can add additional header files by using the gcc -I switch, and that is implemented in Netbeans in the build tool chain option

further information here

I don't have a mac in hand right now, but I guess the include files will be in somewhere like:

/usr/share/g++

EDIT:

You can find the code assistance pop-up include files at:

Tools -> Options -> C/C++ -> Code Assistance

Community
  • 1
  • 1
shengy
  • 9,461
  • 4
  • 37
  • 61