[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: cannot compile hash_map from stlport
From: |
Pedro Lamarão |
Subject: |
Re: cannot compile hash_map from stlport |
Date: |
Fri, 09 Nov 2007 18:47:05 -0000 |
User-agent: |
G2/1.0 |
On 7 nov, 01:40, Jim Anderson <ez...@ieee.org> wrote:
> I'd like to use the hash_map template from the stlport which I
> picked up at sourceforge.net (version 5.1.4). I installed the
> library and then create the example given
> athttp://www.sgi.com/tech/stl/hash_map.html. I've attached
> this example (sample.cc) and a simple makefile. The only change I've
> made to the example is to add the #include statements
> for iostream and hash_map.
>
> ---------------
> When I compile, I get the following output:
>
> g++ -I/home/jja/work/prog/dev/ind/include/stlport -o sample sample.cc
> sample.cc: In function 'int main()':
> sample.cc:15: error: 'hash_map' was not declared in this scope
> sample.cc:15: error: expected primary-expression before 'const'
> sample.cc:15: error: expected `;' before 'const'
> sample.cc:17: error: 'months' was not declared in this scope
> sample.cc:30: error: 'cout' was not declared in this scope
> sample.cc:30: error: 'endl' was not declared in this scope
> make: *** [sample] Error 1
> ----------------
>
> I ran the sample program through cpp to verify that hash_map
> is being read in. It appears to be read in, yet I'm getting
> the error that 'hash_map' was not declared. I'm guessing
> the error message is telling me that the template is not
> instansiating the hash_map class that is needed, but I'm
> not sure. Can anyone explain the error message and why
> the SGI example will not compile?
The missing names are all in namespace std.
You are missing the proper using declarations.
--
Pedro Lamarão