Operating System - Linux
1753585 Members
6366 Online
108796 Solutions
New Discussion юеВ

Compiler issues, while compiling using gcc

 
Chayan
New Member

Compiler issues, while compiling using gcc

I am trying to make a make file using a gcc compiler. I have attached a txt file as an attachment which contailns the error. On searching the forum for the specified error, it tells me to reload the gcc compiler with other relative files like libiconv and gettext....still i find the same error.

Any suggestions on this is welcomed.
11 REPLIES 11
Alex Lavrov.
Honored Contributor

Re: Compiler issues, while compiling using gcc

What version of gcc do you use?

Alex.
I don't give a damn for a man that can only spell a word one way. (M. Twain)
Stephen Keane
Honored Contributor

Re: Compiler issues, while compiling using gcc

Looks like gcc (version 3.4.4 ?) is getting confused as to whether a "char" is unsigned or signed.
Colin Topliss
Esteemed Contributor

Re: Compiler issues, while compiling using gcc

Hi,

What 'make' are you using? Is it HP's make, or the GNU make? That will make a difference!

You also should check that /usr/local/bin/c++ actually points to g++ (so you are checking to see if you are using an older version of GCC to build the later version). If not, you need to ensure that you have HP's full ANSI C compiler (I'm sure that the c89 compiler won't build GCC) or try an older version of GCC (the porting centre has a depot).

Col.
Steve Ellcey
Valued Contributor

Re: Compiler issues, while compiling using gcc

It is difficult to tell exactly what is going on without having the sources but I would guess that there may be a typedef or a #define of 'char' to be 'unsigned char' or 'signed char' in a file that is included before the include of bits/type_traits.h. If I compile a file that just includes type_traits.h it compiles OK for me. Can you compile a simple program that just has '#include
Chayan
New Member

Re: Compiler issues, while compiling using gcc

Hello Everyone,

Ur suggestions did help me but it did not solve my problem yet, still it continues to give me the same error.
Clarifing some of the question from the responces........
1) yes the gcc version is 3.4.4
2) It is using HP's make file.
3) Tyring to run a sample application, it did work....but i found out something important that it works with iostream.h but not with iostream and it works also when bits/types_traits.h is added. But if we include using namespace std; it throws error and it throws it from iostream.h.
Making relative changes in my make file still it did not respond.
The error that I attached as a document last time shows clearly that it throws error from iostream, let it be iostream or iostream.h.

Any suggestions on this iostream to make it work.

Ur suggestions on this please.
Steve Ellcey
Valued Contributor

Re: Compiler issues, while compiling using gcc

Can you be more specific about your sample application. Is it just an include of iostream or is there more in it? I still cannot reproduce the problem here. Also, what OS version are you on? IPF or PA?
Chayan
New Member

Re: Compiler issues, while compiling using gcc

ok...
Pls find the sample application as attachment.
Also attached the output when complied using gcc and g++. The same applications compiles successfully when used g++ but throws error using gcc.
Even if I use g++ in my original make file which is troubling me errors related to iostream.(The ones which I have already attached in my previous mail).
Chayan
New Member

Re: Compiler issues, while compiling using gcc

OS is PA-RISC
HP-UX B.11.11 U 9000/785
Stephen Keane
Honored Contributor

Re: Compiler issues, while compiling using gcc

Bear in mind that gcc is for compiling C code, not C++ code and g++ is for compiling C++ code (but will work with C code). iostream/iostream.h is a C++ header file and shouldn't be used in C code, instead stdio.h would be used. As you refer to namespaces I'm guessing your code is C++ in which case you should use g++ rather than gcc, unless I'm not understanding you.