[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: cannot compile hash_map from stlport

From: Jim Anderson
Subject: Re: cannot compile hash_map from stlport
Date: Mon, 12 Nov 2007 21:16:07 GMT
User-agent: Thunderbird (X11/20070824)

Pedro Lamarão wrote:
On 7 nov, 01:40, Jim Anderson <> wrote:
I'd like to use the hash_map template from the stlport which I
picked up at (version 5.1.4). I installed the
library and then create the example given 
at I've attached
this example ( 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 In function 'int main()': error: 'hash_map' was not declared in this scope error: expected primary-expression before 'const' error: expected `;' before 'const' error: 'months' was not declared in this scope error: 'cout' was not declared in this scope 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


Thank you for you suggestion. I have added a 'using namespace std'
to my source file, When I try to compile, I now get
link errors which can be seen in the attached file, 'out'.

Can you look at my source file and makefile and give an opinion
on whether the file should compile and link cleanly?

I appreciate if you can take the additional time to help.

Jim Anderson

reply via email to

[Prev in Thread] Current Thread [Next in Thread]