Vc6 (SP6) + stlport4.6.2 Installation Guide

Source: Internet
Author: User

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 is a lowercase string in these definitions ). 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. I assume that the package is decompressed to 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 vcvars32.bat in the DOS window.../vc98/bin (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 are using 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 is an uppercase string in these definitions ). 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 comment tells us how to do it.

If you have any questions and tips, please feel free to contact yadan6388@126.com. I am interested in data structures and STL. 2004.8.20
Good luck :)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.