gcc 3.2 and stl

Bernhard Rueckerl bernhard_rueckerl@freenet.de
Mon Nov 4 10:51:00 GMT 2002


Hello,

I downloaded and installed gcc 3.2 on my machine and
now I have problems with stl-containers.

Compiling the code:

file test.cpp:

#include <vector>


main(
     )
{
vector<int> n;

n.push_back(0);
}


with
g++ -o test test.cpp -lstdc++

causes the error:


test.cpp: In function `int main()':
test.cpp:7: `vector' undeclared (first use this function)
test.cpp:7: (Each undeclared identifier is reported only once for each 
function
    it appears in.)
test.cpp:7: parse error before `>' token
test.cpp:9: `n' undeclared (first use this function)


g++ -v delivers:
Reading specs from /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.2/specs
Configured with: ./configure --enable-languages=c,c++
Thread model: posix
gcc version 3.2

uname -a:
Linux asterix 2.2.13 #1 Sat Nov 13 16:24:19 GMT 1999 i686 unknown

Did I make anything wrong or is it a bug?
Is the standard-template-library part of the gcc?

best regards and thanks in advance
Benrhard Rueckerl



More information about the Gcc-help mailing list