C++ header files not found

I have what I think is a very standard install of QNX 6.0.2 and I’ve been using it to learn ansi C - no problems, the compiler knows where to find the C header files.

Now I want to try C++. When my first very simple little program didn’t compile (error message to the effect that iostream.h couldn’t be found) I searched for iostream.h and found it in /usr/includes/g+±3. Why can’t gcc/g++ find it?

I did try a directive learned on the Amiga - #incdir /usr/includes/g+±3 - to no avail.

Any help gratefully accepted.

Care to post the code and the command line you are using that gives you errors?

there is a bug in the specs file which caused g++ command not to find the includes.
try using QCC command to compile C++ code instead.

OK. I just tried qcc but got more or less the same result. As I said, my program is very simple:

#include <iostream.h>

int main ()
cout << “Hello World!”;
return 0;

and my command line is equally simple:

qcc hello.c -o hello

Where are the specs files for the various compilers? Should I even consider making modifications to them?

hehe, this is Unix, a case sensitive world :slight_smile:
did I say qcc or QCC ?

qcc to compile c code
QCC to compile c++ code

btw, since you are learning c/c++, maybe one of the google link on the left navigation will help you :wink:

That did it. Thankyou very much. I promise to move beyond ‘hello world’ type programs as quickly as possible. :slight_smile:

Also, if you are doing C++ you should be naming the file .cc. If you had done that qcc would have probably done the right thing. ;)

Thanks again for the help guys - I’ll experiment with that file extension too. I really don’t like mixing case on the command line. ;)

Is there any way to resolve this bug in the specs file? I’m trying to compile the same c++ prog in the IDE and it wont work. The makefile i use, uses qcc:

hello: hello.cc

but when you see it complie in the C-Build view it uses g++. is there any way i can configure IDE to use QCC?


Sure - create an empty QNX C++ Project and copy in your files. Or are you using the plain CDT from eclipse.org?