Author Topic: STL with GCC on HPUX  (Read 4745 times)

Offline BigAngryDog

  • Multiple posting newcomer
  • *
  • Posts: 75
    • BigAngryDog.com
STL with GCC on HPUX
« 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 :)
BigAngryDog.com

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: STL with GCC on HPUX
« Reply #1 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. :)
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9524
Re: STL with GCC on HPUX
« Reply #2 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.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline BigAngryDog

  • Multiple posting newcomer
  • *
  • Posts: 75
    • BigAngryDog.com
Re: STL with GCC on HPUX
« Reply #3 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.
BigAngryDog.com

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: STL with GCC on HPUX
« Reply #4 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!)
« Last Edit: July 11, 2006, 09:54:44 am by thomas »
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: STL with GCC on HPUX
« Reply #5 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 :)
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4291
    • Code::Blocks IDE
Re: STL with GCC on HPUX
« Reply #6 on: July 11, 2006, 09:57:51 am »
You should know that gcc != g++. STL is part of g++...
Be patient!
This bug will be fixed soon...

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9524
Re: STL with GCC on HPUX
« Reply #7 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.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline BigAngryDog

  • Multiple posting newcomer
  • *
  • Posts: 75
    • BigAngryDog.com
Re: STL with GCC on HPUX
« Reply #8 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 :)
BigAngryDog.com

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4291
    • Code::Blocks IDE
Re: STL with GCC on HPUX
« Reply #9 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 :)
Be patient!
This bug will be fixed soon...