After reading a lot of articles, after compiling and installing stlport, you will always be prompted that the header file cannot be found, or the library cannot be linked, and so on. I am worried that I have performed this operation according to my own documents today, it's amazing. The actual is very simple, the steps are as follows: Enter the stlport directory, cdstlport/build/libmake-fgcc.makdependmake-fgcc.makinstall and then you can use it, do not need to include usr/local
After reading a lot of articles, after compiling and installing stlport, you will always be prompted that the header file cannot be found, or the library cannot be linked, and so on. I am worried that I have performed this operation according to my own documents today, it's amazing.
The procedure is as follows:
Enter the stlport directory, cd stlport/build/lib
Make-f gcc. mak depend
Make-f gcc. mak install
Then you can use it without the need to include. the lib directory may be running make-f gcc. mak install has been added to the environment variable, and I do not know whether there is any concept of the environment variable in Linux.
- # Include
- # Include
- IntMain ()
- {
- Std: vector <Int> V1;
- V1.push _ back (0 );
- Printf ("The first element of vector is % d \ n", V1 [0]);
- Return0;
- }
Www.linuxidc.com @ Ubuntu :~ /Project $ g ++-g-o use_stl use_stl.cpp
Www.linuxidc.com @ ubuntu :~ /Project $./use_stl
The first element of vector is 0
Sorry, it turned out to be so simple. It took a lot of effort before. In fact, you can simply follow the document. Hey, remember!