Win7 under VS2010 use STLport.

Source: Internet
Author: User
Tags visual studio 2010

STLport's

http://sourceforge.net/projects/stlport/

After downloading, unzip the file. My directory is D:\STLport-5.2.1.

Right-click Computer, properties, advanced system settings, environment, system variables, edit path variable, add; C:\Program Files\Microsoft Visual Studio 10.0\vc\bin. (My path is this, semicolon is the delimiter), OK:

Then in C:\Program Files\Microsoft Visual Studio 10.0\vc\bin directory, edit Vcvars32.bat.

Find the following section, mainly to add STLport include and Lib path, my distinction is D:\STLport-5.2.1\stlport and D:\STLport-5.2.1\build\lib, note the semicolon, it is a delimiter.

@rem INCLUDE

@rem-------

@if exist "%vcinstalldir%atlmfc\include" set include=%vcinstalldir%atlmfc\include;%i Nclude%;D: \stlport-5.2.1\stlport

@if exist "%vcinstalldir%include" set include=%vcinstalldir%include;%i Nclude%

@rem LIB

@rem---

@if exist "%vcinstalldir%atlmfc\lib" set lib=%vcinstalldir%atlmfc\lib;%lib%;D: \stlport-5.2.1\build\lib

@if exist "%vcinstalldir%lib" set lib=%vcinstalldir%lib;%lib%

Once saved, double-click on Vcvars32.bat to make our settings effective.

Under C:\Program Files\Microsoft Visual Studio 10.0\VC directory, run Vcvarsall.bat.

In the D:\STLport-5.2.1\stlport\stl directory, edit _cstdlib.h.

The 158th line of

Inline _stlp_long_long abs (_stlp_long_long __x) {return __x < 0?-__x: __x;}

This line is changed to the following three lines. (It is a more if judgment.) )

#if!defined (_stlp_msvc) | | (_stlp_msvc < 1600)

Inline _stlp_long_long abs (_stlp_long_long __x) {return __x < 0?-__x: __x;}

#endif

Save.

Open the Start menu in Visual Studio Tools under Microsoft Visual Studio 2010 in Visual Studio Command Prompt (2010).

Switch to the STLport directory

CD D:\STLport-5.2.1

D:

Configuration, you can see which configurations are supported through configure--HELP.

Configure MSVC9

Switch to the Lib directory

CD Build/lib

Then the

nmake/f Msvc.mak Clean Install

The effect of my test is as follows:

Setting environment for using Microsoft Visual Studio x86 tools

C:\Program Files\Microsoft Visual Studio 10.0\vc>cd D:\STLport-5.2.1

C:\Program Files\Microsoft Visual Studio 10.0\vc>d:

D:\stlport-5.2.1>configure MSVC9

STLport Configuration Tool for Windows

Setting Compiler:microsoft Visual C + + 2008

Setting platform:windows XP

Done configuring STLport.

Go to Build/lib folder and type ' nmake clean install ' to build and

Install STLport to the "Lib" and "Bin" folders.

Go to Build/test/unit folder and type nmake clean install to

Build unit tests and install them in Bin folder.

D:\STLPORT-5.2.1>CD Build/lib

d:\stlport-5.2.1\build\lib>nmake/f Msvc.mak Clean Install

————

Waited a few minutes for the installation to be ready.

In the D:\STLport-5.2.1 directory a few more folders, such as Bin and lib.

Put D:\STLport-5.2.1\bin under Stlport.5.2.dll,stlportd.5.2.dll,stlportstld.5.2.dll, copy to C:\Program Files\Microsoft Visual Studio 10.0\vc\bin directory, so VC can find it.

Set up the Include and LIB directories for VC projects.

VS2010 menu, View,property manager,debug| Win32, double-click Microsoft.cpp.win32.user,common properties,vc++ directories.

Add D:\STLport-5.2.1\stlport under Include directories.

Add D:\STLport-5.2.1\lib under Library directories.

OK, through such a setup, after the establishment of the project VC + + directories have these things, it is not so troublesome each project is set up.

Test the program.

/*function, Win7 under vs2010 use STLport. Date, Friday, August 24, 2012 environment, win7-32-vs2010*/#include<iostream>#include<rope>using namespacestd; intMain () {//Crope is a container used to store char charactersCrope Crope1 ("Hello,"); Crope Crope2 ("stlport!"); cout<< Crope1 + crope2 <<Endl; System ("Pause"); return 0; }  /*Output Effect: hello,stlport! Please press any key to continue ...*/

Win7 under VS2010 use STLport.

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.