Languages and Scripting
cancel
Showing results for 
Search instead for 
Did you mean: 

gcc g++ on hpux won't compile (can't find stdint)

 
Highlighted
BenIsCool
Frequent Advisor

gcc g++ on hpux won't compile (can't find stdint)

Hello,

I am trying to get started with some very basic c++ coding on my hpux system.
But I am stuck at square one. I cannot even compile "hello world"
g++ returns an error that says it cannot find stdint.h (which I am not even including so it must be included by iostream)

Any advice?

Thanks
11 REPLIES 11
Highlighted
Dennis Handly
Acclaimed Contributor

Re: gcc g++ on hpux won't compile (can't find stdint)

stdint.h is a C99 header, only available on 11.23. I'm surprised that C++ would be including it. And if g++ needed it, it should include its own copy.
Highlighted
Steven E. Protter
Exalted Contributor

Re: gcc g++ on hpux won't compile (can't find stdint)

Shalom,

Can you say where you got gcc and what version it is? If it is depot software, run swverify against it and see if its even installed correcty.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Highlighted
BenIsCool
Frequent Advisor

Re: gcc g++ on hpux won't compile (can't find stdint)

I agree that if g++ needed it, it should install its own copy (and be configured to find it). I got gcc from the utah unix porting depot and it is the most recent there.

I found on my own that stdint.h is on the system (and was installed by gcc because it is under the file structure that gcc created)

I created a ln -s to that stdint.h into /usr/include

Now my code compiles fine.

I don't know that this is correct but it worked.

Any thoughts.

Thanks
Highlighted
Dennis Handly
Acclaimed Contributor

Re: gcc g++ on hpux won't compile (can't find stdint)

>I found on my own that stdint.h is on the system (and was installed by gcc because it is under the file structure that gcc created)

The correct solution is to add a -I path to the gcc version.
Highlighted
BenIsCool
Frequent Advisor

Re: gcc g++ on hpux won't compile (can't find stdint)

I'm sorry but I do not know how to do that? (new to g++)
Can you give me some pointers on that?

I have searched for and found a lot of documentation on g++ and c++ coding but nothing on actually using g++ on hpux specifically addressing issues like this.

Thanks
Highlighted
Dennis Handly
Acclaimed Contributor

Re: gcc g++ on hpux won't compile (can't find stdint)

>I'm sorry but I do not know how to do that?

You found the header in some directory. Just add -Ifull-directory-path to your compile line.

The same as any other -I option.
Highlighted
BenIsCool
Frequent Advisor

Re: gcc g++ on hpux won't compile (can't find stdint)

Ahh. (you said -l to gcc version - thought you meant something more profound like configuring the gcc version)

I can use -L (capital) on the gcc 'compile' line and that does work.

Thank you.

Highlighted
Dennis Handly
Acclaimed Contributor

Re: gcc g++ on hpux won't compile (can't find stdint)

>I can use -L on the gcc 'compile' line and that does work.

This is for lib paths. -I is for include paths.
Highlighted
Steve Ellcey
Valued Contributor

Re: gcc g++ on hpux won't compile (can't find stdint)

Could you tell us more about what version of HP-UX (probably HP-PA 11.11?) and what version of GCC you are using? Also, where did you get the GCC compiler, from http://www.hp.com/go/gcc or from the HP Porting and Archive center or from somewhere else? It should be possible to compile hello world on an HP-UX platform with g++ and without any workarounds and if it isn't I am interested in understanding why things aren't working out of the box.