Code::Blocks Forums

User forums => General (but related to Code::Blocks) => Topic started by: BigAngryDog on July 11, 2006, 09:00:20 am

Title: STL with GCC on HPUX
Post by: BigAngryDog on July 11, 2006, 09:00:20 am
Hi,

I'm trying to compile an application of mine with GCC on HPUX, but the compiler isn't recognising anything which is STL. I'm getting compiler errors of the like:

Can't open include file 'string'.
Can't open include file 'exception'.
etc...

This isn't a CB question, but before I go around asking the guys in my office (and let everything know the breadth of my ignorance with Unix :) ) I'd thought I'd ask here.

Is there a conditional define, something like "USE_STL" for example, I may need in my project makefile to get GCC to use STL? Or is more likely that STL hasn't been installed with GCC?

Thanks :)
Title: Re: STL with GCC on HPUX
Post by: thomas on July 11, 2006, 09:28:23 am
A good guess would be to use something that does not occur in 2000 file names (other than "string") and run locate on it. For example locate deque.

If that returns a path, then you add that path to your compiler's include paths. If that does not return anything, then you don't have it. :)
Title: Re: STL with GCC on HPUX
Post by: MortenMacFly on July 11, 2006, 09:30:25 am
Can't open include file 'string'.
I wonder if it works if you don't use include <string>, but include <string.h> or even include "string.h"...?! LCC for example doesn't like <string> so I have to use "string.h" for my projects there allthough this is STL.
Title: Re: STL with GCC on HPUX
Post by: BigAngryDog on July 11, 2006, 09:41:20 am
Thanks for replies. :)

It's lookling like there is there is no STL on machine I'm using.
Title: Re: STL with GCC on HPUX
Post by: thomas on July 11, 2006, 09:48:49 am
Quote
I wonder if it works if you don't use include <string>, but include <string.h>
With gcc, the ".h" STL includes live in the "backwards" subfolder under the location of the "real" includes and they don't really contain anything, they simply emit a warning after including the "real" file.
If you are unable to include <string> then you should not be able to include <string.h> either (wait... actually you will be able to include string.h, there is a C header with that name!)
Title: Re: STL with GCC on HPUX
Post by: thomas on July 11, 2006, 09:51:57 am
Thanks for replies. :)

It's lookling like there is there is no STL on machine I'm using.
You could always compile STLPort then. I have never done it, but I heard the Ogre project has a nice HOWTO on this (they use STLPort for some compatibility reason). Google on Ogre and STLPort will help :)
Title: Re: STL with GCC on HPUX
Post by: mandrav on July 11, 2006, 09:57:51 am
You should know that gcc != g++. STL is part of g++...
Title: Re: STL with GCC on HPUX
Post by: MortenMacFly on July 11, 2006, 10:05:19 am
Quote
I wonder if it works if you don't use include <string>, but include <string.h>
With gcc, the ".h" STL includes live in the "backwards" subfolder [...]
I haven't read "GCC". Sure, for GCC you'll get a backward warning in that case, so forget about my post.
Title: Re: STL with GCC on HPUX
Post by: BigAngryDog on July 11, 2006, 12:59:09 pm
Thanks for all the help! :)

>You should know that gcc != g++. STL is part of g++...

OK. I'm learning this. :)

I have discovered that STL is indeed installed on the machine I'm using, but [I think] I need to setup an environment path. As I'm still learning the difference between the c shell and bash shell, I some way to go.

Oh and I love VI!

Cheers :)
Title: Re: STL with GCC on HPUX
Post by: mandrav on July 11, 2006, 01:31:14 pm
>You should know that gcc != g++. STL is part of g++...

OK. I'm learning this. :)

What I meant was that you might have gcc installed but not g++. Just another lead :)