Environment: vc6.0 + SP5, WindowsXP + SP2
Stlport version 4.6.2
Install my Vc in D:/bin/vc6 and decompress the stlport to D:/bin/vc6/vc98. the root directory of stlport is stlport (that is, remove the original version number)
Edit the vcvars32.bat file under D:/bin/vc6/vc98/bin.
Add % msvcdir %/stlport to the include variable
Add % msvcdir %/stlport/lib to the Lib variable
Should be
Set include = % msvcdir %/stlport; % msvcdir %/ATL/include; % msvcdir %/mfc/include; % include %
Set Lib = % msvcdir %/stlport/LIB; % msvcdir %/mfc/LIB; % lib %
Open a console window and run D:/bin/vc6/vc98/bin/vcvars32.bat,
If echo
Setting environment for using Microsoft Visual C ++ tools.
It indicates the operation is successful.
CD to D:/bin/vc6/vc98/stlport/src
Run nmake-F vc6.mak clean all
Compile stlport. If no error is reported, it will succeed.
I used stlport of version 5.0, but it was not compiled successfully here, so I had to use 4.6.2. After all, 5.0 is not the official version.
Open VC, tools-> options-> directories,
Select include files and add D:/bin/vc6/vc98/stlport.
Select lib files and add D:/bin/vc6/vc98/stlport/lib.
And move them all to the beginning,
When you don't want to use stlport STL and use the STL of VC, you can adjust it to the back.
Compile a test program. The STL provided by VC cannot be used, but stlport can
# Include <vector>
# Include <deque>
Using namespace STD;
Int main (){
Const int arraysize = 7;
Int Ia [arraysize] = {0, 1, 2, 3, 4, 5, 6 };
Vector <int> V (IA, Ia + arraysize );
Deque <int> D (IA, Ia + arraysize );
Return 0;
}
Reference
Http://blog.csdn.net/li_yadan/archive/2004/08/20/80285.aspx