g++ default #include's

N

Nafai

Hello. I'm using a recent version of g++ compiler. It isn't necessary to
type some #include's with this compiler. But sometimes I have to use
older versions of g++ and I get a lot of errors because of not having
typed those #include's. Is there any option for g++ not to put
#include's itself?

Thanks.
 
M

msalters

Nafai said:
Is there any option for g++ not to put #include's itself?

That's not a C++ question, but a g++ question. Please ask
in the gnu groups. The FAQ can help you there.

HTH,
Michiel Salters
 
E

Efrat Regev

Nafai said:
Hello. I'm using a recent version of g++ compiler. It isn't necessary to
type some #include's with this compiler. But sometimes
...

The friendly folk at gnu.gcc.help might help you out
 
N

Nafai

Efrat Regev escribió:
The friendly folk at gnu.gcc.help might help you out

I can't find how to do it and I get no response in gnu.gcc.help. Can
anyone help me please?
 
S

Shezan Baig

Nafai said:
Efrat Regev escribió:

I can't find how to do it and I get no response in gnu.gcc.help. Can
anyone help me please?

Look at your compiler documentation to see whether it defines its
version. Then you can do something like:

#ifdef GCC_VERSION < 0x1234566
#include <...>
#endif

I'm not sure what the define symbol is for gcc, but you should be able
to find out from the gcc folks.

Hope this helps,
-shez-
 
S

Shezan Baig

Shezan said:
Look at your compiler documentation to see whether it defines its
version. Then you can do something like:

#ifdef GCC_VERSION < 0x1234566
#include <...>
#endif

I'm not sure what the define symbol is for gcc, but you should be able
to find out from the gcc folks.

Hope this helps,
-shez-

Correction: Use '#if' instead of '#ifdef'.

-shez-
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,431
Messages
2,571,679
Members
48,796
Latest member
Greg L.

Latest Threads

Top