Vc6 STLport-5.1.4 compilation, Installation
1. Open the command line window, establish the VC environment, and execute % msvcdir %/vc98/bin/vcvars32.bat
2. Switch to % STLport-5.1.4 %/build/lib and execute configure-C msvc6-clean to compile the configuration. Where:
-C: select the compiler.
-Clear build configuration files after cleaning.
Run configure -- help to view more options and parameters.
3. Run nmake/fmsvc. Mak or nmake/fmsvc. Mak install, which copies the generated Library to the % STLport-5.1.4 %/lib directory after compilation. We recommend that you use the install parameter.
4. open vc6, In tools-> options-> directories, add include files path: % STLport-5.1.4 %/stlport, add library files path: % STLport-5.1.4 %/lib, adjust the two paths to the first path.
5. Modify project options: Project-> Settings...-> C/C ++, select code generation for category, and then select debug multithreaded in use run-time library. (For the release version, select multithreaded. If you want to use a dynamic link, you must first compile the stlport of the Dynamic Link version, and then select the corresponding DLL here)
Vc6 STLport-4.6.2 compilation, install [% STLport-4.6.2 % represents its path, such as C:/stlport, etc]
1 ./*****
A. Modify the vcvars32.bat file in.../vc98/bin and find
Set include = % msvcdir %/ATL/include; % msvcdir %/mfc/include; % include %
Set Lib = % msvcdir %/LIB; % msvcdir %/mfc/LIB; % lib %
Add the stlport path to the two statements as follows:
Set include = % STLport-4.6.2 %/stlport; % msvcdir %/ATL/include; % msvcdir %/mfc/include; % include %
Set Lib = % STLport-4.6.2 %/LIB; % msvcdir %/mfc/LIB; % lib %
(C:/stlport/lib does not exist yet, but you don't have to worry about it. stlport will be available after compiling)
****/
2. Open the command line window, create a VC environment, and execute % Microsoft Visual Studio %/vc98/bin/vcvars32.bat
3. nmake-F vc6.mak clean all (vc6 can also select vc6-unicode.mak files that support Unicode)
4. Configure VC:
Click Tools-options-directories in VC,
Select include files, add % STLport-4.6.2 %/stlport, and move to the beginning
Select library files, add % STLport-4.6.2 %/lib, and move to the beginning
---------------------------------------------------------------------
Vc6 (SP6) + stlport4.6.2 Installation Guide
First of all, I have almost no experience with VC/C ++, and STL is just getting started. In order to use stlport, I had been busy calling for a long time and was just installed. To avoid detours when you or others install stlport, we will record this experience. Because I am very fond of cooking, even if the installation is complete, there are still many unknown points, so if there is an error in the following document, please criticize and point out. I still have some questions in this article. I hope I can answer these questions after learning them in depth. You are also welcome to help me answer these questions.
Step by step, now:
1. Install vc6 and patch SP6
Http://msdn.microsoft.com/vstudio/downloads/updates/sp/vs6/sp6/default.aspx)
2. We recommend that you install visual assist for vc6. It makes the editing environment easier to use.
Is there a http://www.vcer.net/download.jsp? Id = 1042 http://www.vcer.net/upload/2004/04/1042.zip does not know the invalidation is not)
3. Download stlport from www.stlport.org. I downloaded stlport4.6.2.
Http://www.stlport.org/archive/STLport-4.6.2.tar.gz)
4. Before using stlport, check the STL library of VC.
Compile a CPP for the simplest project.
# Include <vector>
Using namespace STD;
Int main ()
{
Vector <int> V;
V. push_back (0 );
Return 0;
}
This program can be compiled by placing the mouse on the vector and push_back, right-clicking its definition (goto the definition ...), in the pop-up window, (note that STD isLowercase). Select a file to enter the definition file. We can see that the file referenced is.../vc98/include/vector. This directory contains list and so on, which is the STL Implementation of vc6. It is said to be bad. I have never used it. I don't know it :)
However, the program below cannot be compiled.
# 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 );
// V. push_back (0 );
Deque <int> D (IA, Ia + arraysize );
Return 0;
}
The reason should be that vc6's deque does not support such a structure. However, this program can be compiled under the dev-C ++ of GCC.
Well, save our project and we can guess that if stlport is successfully installed, it should be able to be compiled smoothly.
5. decompress the downloaded stlport package.C:/stlport(The subdirectories next to C:/stlport are SRC, Doc, stlport, and other directories of stlport)
6. Compile stlport
(1) set the environment variable so that the environment variable path contains C:/program files/Microsoft Visual Studio/vc98/bin
(You can also leave this parameter Unspecified. If you are willing to enter this directory name)
(2) open a DOS window (run cmd)
(3) Run vcvars32.bat in.../vc98/bin:
/*****
A. Modify the vcvars32.bat file in.../vc98/bin and find
Set include = % msvcdir %/ATL/include; % msvcdir %/mfc/include; % include %
Set Lib = % msvcdir %/LIB; % msvcdir %/mfc/LIB; % lib %
Add the stlport path to the two statements as follows:
Set include = C:/stlport; % msvcdir %/ATL/include; % msvcdir %/mfc/include; % include %
Set Lib = C:/stlport/LIB; % msvcdir %/mfc/LIB; % lib %
(C:/stlport/lib does not exist yet, but you don't have to worry about it. stlport will be available after compiling)
Note: Step (3)-A does not need to modify the content of the vcvars32.bat file. I wrote this in some documents but tried it several times later, it doesn't matter if you don't change this file! So don't forget it. (Cancel this step !)
****/
B. Run this file in the DOS window.../vc98/bin.Vcvars32.bat(Required !!!)
(4) In the same DOS window! Run the command in the C:/stlport/src directory.
Nmake-F vc6.mak clean all
(Problem, vc6 can also choose to support Unicode vc6-unicode.mak files, but how to use Unicode in VC, I do not know :()
It takes a little time to compile. After compilation, you can choose to run nmake-F vc6.mak install.
Note: The Install task is optional. See the install document of stlport:
[Quote]
"Install" target works on most platforms.
On win32, it does the following:
-Copies stlport headers in "stlport" subdirectory of your Compiler's include directory;
-Copies stlport. Lib files in your Compiler's lib directory;
-Copies stlport DLLs to Windows System directory so they can be found at runtime.
[/Quote]
Dums (master on the stlport Forum) is recommended not to use nmake install, and I strongly recommend not to run this nmake install !!! If you want the STL of VC to coexist with the STL of stlport, do not execute this install task !!!
(If you still want to run nmake install with an error, run vcvars32.bat again)
/**
Q: I have not tried to modify C:/program files/Microsoft Visual Studio/common/msdev98/bin/sysincl. dat after it is written in the installation documentation. How can I modify it? What is the purpose?
**/
7. Configure VC
Go to VC and compile the CPP with the previous error. The same compilation error still exists.
(Even if vcvars32.bat is modified and the path of stlport is added, it is useless! It seems that this file cannot add include and Lib. This is why I don't need to modify vcvars32.bat. I don't understand the role of this file when running VC. please correct me :))
Click Tools-options-directories in VC,
Select include files, add C:/stlport, and set it to the beginning.
Select library files, add C:/stlport/lib, and set it to the beginning.
Compile the project. Similarly, to verify that we use the stlport STL library, place the mouse in the program vector and push_back, right-click its definition (goto the definition ...), in the pop-up window, (note that STL isUppercase). Select a definition file to reference C:/stlport/STL/_ vector. h.
(If any problem occurs, try build-clean to clear the cache)
Extended:
Currently, it is only possible to basically use stlport. The Unicode version has not been compiled. In addition, stlport also has complicated configurations, such as optimization and static connections. I haven't used that level yet, but I am a bit prompted. If you want to configure it, please refer to the stlport config file (Stlport/stl_user_config.h and stlport/STL/_ site_config.h) The annotations tell us how to do this.
---------------------------------