Vc6 STLport-5.1.4/STLport-4.6.2 compilation, Installation

Source: Internet
Author: User

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. /*****
. modify .... in \ vc98 \ bin, find the vcvars32.bat file and find
set include = % msvcdir % \ ATL \ include; % msvcdir % \ MFC \ include; % include %
set Lib = % msvcdir % \ Lib; % msvcdir % \ MFC \ Lib; % lib %
, with the path of stlport, change to:
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 don't worry, it will be available after stlport compilation)
*****/

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 tune 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 stlport is installed by yourself or others, 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 After compilation, place the cursor on the vector and push_back, right-click its definition, and in the pop-up window, (note that STD is Lowercase ). Select a file to enter the definition file. We can see that the Referenced File 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 is compiled with the GCC Dev-C ++ without any questions.

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 Sub-directory next to C: \ stlport is the 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's not related to this file! So don't forget it. (Cancel this step !)
****/

B. Run the file... \ vc98 \ bin in the DOS window. Vcvars32.bat (Required !!!)

(4) In the same DOS window! Enter the c: \ stlport \ src directory to run
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 Uppercase ). Select a definition file to reference c: \ stlport \ STL \ _ vector. h.
(If any problem occurs, try build-clean to clear the cache)

Extension:
currently, stlport can be basically used, and Unicode version compilation has not been attempted. 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, see the notes in the stlport config file ( stlport/stl_user_config.h and stlport/STL/_ site_config.h ) to show us how to do this.

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.