Win7下VS2010使用STLPort 和boost1.56.
STLport的下载地址
http://sourceforge.net/projects/stlport/
下载后,解压出文件。我的目录是 D:\STLport-5.2.1 。
右键计算机,属性,高级系统设置,环境,系统变量,编辑Path变量,添加;C:\Program Files\Microsoft Visual Studio 10.0\VC\bin。(我的路径是这样,分号是分隔符),确定。。
然后在 C:\Program Files\Microsoft Visual Studio 10.0\VC\bin 目录,编辑 vcvars32.bat 。
找到下面的一段,主要是添加STLport的include和lib路径,我的分别是 D:\STLport-5.2.1\stlport和D:\STLport-5.2.1\build\lib,注意分号,它是分隔符。
@rem INCLUDE
@rem -------
@if exist "%VCINSTALLDIR%ATLMFC\INCLUDE" set INCLUDE=%VCINSTALLDIR%ATLMFC\INCLUDE;%INCLUDE%;D:\STLport-5.2.1\stlport
@if exist "%VCINSTALLDIR%INCLUDE" set INCLUDE=%VCINSTALLDIR%INCLUDE;%INCLUDE%
@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%
保存之后,双击 vcvars32.bat ,使我们的设置生效。
在 C:\Program Files\Microsoft Visual Studio 10.0\VC 目录下,运行 vcvarsall.bat 。
在 D:\STLport-5.2.1\stlport\stl 目录,编辑 _cstdlib.h。
将第158行的
inline _STLP_LONG_LONG abs(_STLP_LONG_LONG __x) { return __x < 0 ? -__x : __x; }
这一行改为如下三行。(就是多了个if判断。)
#if !defined(_STLP_MSVC) || (_STLP_MSVC < 1600)
inline _STLP_LONG_LONG abs(_STLP_LONG_LONG __x) { return __x < 0 ? -__x : __x; }
#endif
保存。
打开开始菜单的Microsoft Visual Studio 2010下的Visual Studio Tools中Visual Studio Command Prompt(2010)。
切换到STLport的目录下
cd D:\STLport-5.2.1
d:
进行配置,可以通过 configure --help查看支持哪些配置。
configure msvc9
切换到lib目录
cd build/lib
然后是
nmake /f msvc.mak clean install
我测试的效果如下:
Setting environment for using Microsoft Visual Studio 2010 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
————
等了几分钟就安装好了。
在D:\STLport-5.2.1目录多了几个文件夹,如bin和lib等。
把 D:\STLport-5.2.1\bin下 stlport.5.2.dll,stlportd.5.2.dll,stlportstld.5.2.dll,复制到 C:\Program Files\Microsoft Visual Studio 10.0\VC\bin 目录下,这样vc就能找到它了。
设置vc工程的include和lib目录了。
VS2010菜单,View,Property Manager,Debug|Win32,双击Microsoft.Cpp.Win32.user,Common Properties,VC++ directories。
在 Include Directories 下添加 D:\STLport-5.2.1\stlport 。
在 Library Directories 下添加 D:\STLport-5.2.1\lib 。
确定,通过这样的设置,以后建立的工程的VC++ Directories都有这些东西,就不用那么麻烦每个工程都进行设置了。
测试程序。
/*功能,Win7下vs2010使用STLport。
日期,2012年8月24日 星期五
环境,win7-32-vs2010
*/
#include <iostream>
#include <rope> using namespace std; int main()
{
// crope是用来存储char字符的容器
crope crope1("Hello,");
crope crope2("STLport!");
cout << crope1 + crope2 << endl; system("pause");
return 0;
}
/*
输出效果: Hello,STLport!
请按任意键继续. . . */
boost1.56编译
对于1-56版本的文件
1、运行 boost_1_56_0\tools\build 目录下的 bootstrap.bat,生成 b2.exe 和 bjam.exe
2、将 b2.exe和bjam.exe复制到 boost_1_56_0 根目录
3、打开 vs2010 的命令窗口,并将当前目录切换到 boost_1_56_0 根目录
4、运行 b2.exe link=static link=shared threading=multi variant=debug,release
5、
6、配置VC项目:
.C/C++ 常规 附加包含目录:C:\boost_1_56_0;%(AdditionalIncludeDirectories)
.链接器 常规 附加库目录:C:\boost_1_56_0\stage\lib;%(AdditionalLibraryDirectories)
Win7下VS2010使用STLPort 和boost1.56.的更多相关文章
- WIN7下vs2010滑轮滚动不正确的解决方法
win7下vs2010在滚动滑轮时文档滚动条不滚动而是解决方案的滚动条滚动的解决方法, 控制面板>设备和打印机>鼠标设置>滚轮选项卡里面将滚轮功能设置设为只使用office97预设的 ...
- Win7下VS2010、IIS7配置常见问题收集
一 在Win7下应按什么次序安装vs2010和iis7 win7推荐先安装iis7,再安装vs2010:如果次序反了,必须注册iis才可以用. IIS中ASP.NET的版本号此时可选的有1.1.2.0 ...
- 【转】Win7下VS2010中配置Opencv2.4.4的方法(32位和64位都有效)(亲测成功)
在vs2010下配置opencv是件痛苦的事情,一点点错误可能就会导致莫名其妙的报错,各种error让人郁闷不已,这里提供给大家一篇vs2010下配置opencv2.4.4的方法,我是64位的win7 ...
- [整理]win7下VS2010遇到内存不足解决方发
电脑重装Win7 64bit不久后,一天内VS2010使用久了,就会出现内存不足,实际内存使用情况却不是,显示内存已使用70%.以前没有遇到过,经网上查找,貌似是VS2010对内存计算会在某些情况下计 ...
- Win7下VS2010使用“ASP.Net 3.5 Claims-aware Template”创建ClaimsAwareWebSite报"HRESULT: 0x80041FEB"错误的解决办法
问题描述: 使用VS2010的WIF开发模板创建“Claims-aware ASP.NET Site”.“Claims-aware WCF Service”,下载安装后,创建网站时,报错"H ...
- Win7下VS2010不能链接问题
装了2012准备学VC++窗体开发,然后发现手边只有VS2010的教程,于是卸掉VS2012改装VS2010,结果发现不管写啥,链接时都报错“error Link1123 转到coff期间失败”. 于 ...
- win7下vs2010开发atl服务
问题一: 编译服务后,提示出下错误 Microsoft.CppCommon.targets(113,5): error MSB3073: 命令 " ***.exe " /RegS ...
- win7下VS2010编译python3
转自:http://www.cnblogs.com/fortwo/archive/2013/04/16/3023871.html 1.首先从python.org上:http://www.python. ...
- win7下vs2010编译生成sqlite3.dll库
http://blog.csdn.net/qing666888/article/details/53582262 http://download.csdn.net/detail/qing666888/ ...
随机推荐
- phpmyadmin密码字段加密方法
UPDATE member SET password=md5('password')
- 0X0000124
求教卡饭网友,都快疯掉了. 最近搞设计,电脑频发出现蓝屏,今晚都出现三次了,新装的win7 64位系统,都是安装的原版光驱. 错误代码基本上都是:0x00000124 (0x000 ...
- 一个使用CSocket类的网络通信实例
http://www.cppblog.com/changshoumeng/archive/2010/05/14/115413.html 3.8 一个使用CSocket类的网络通信实例 本例采用CSoc ...
- 一个用httpPost,get访问外网接口,参数json,返回json的示例
package com.royal.util; import java.io.BufferedReader;import java.io.DataInputStream;import java.io. ...
- 转:解决方案your project contains error s please fix them before running your application
文章来自于:http://www.mythroad.net/2013/08/05/%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88your-project-contains-e ...
- 转: pthread_create()
pthread_create函数 原型:int pthread_create((pthread_t *thread, pthread_attr_t *attr, void *(*start ...
- Big Data Security Part One: Introducing PacketPig
Series Introduction Packetloop CTO Michael Baker (@cloudjunky) made a big splash when he presented ‘ ...
- HDU_1238——最大子串搜索
Problem Description You are given a number of case-sensitive strings of alphabetic characters, find ...
- HDU_2048——全错位排列递推公式
Problem Description HDU 2006'10 ACM contest的颁奖晚会隆重开始了! 为了活跃气氛,组织者举行了一个别开生面.奖品丰厚的抽奖活动,这个活动的具体要求是这样的:首 ...
- LeetCode-Word LadderII
Given two words (start and end), and a dictionary, find all shortest transformation sequence(s) from ...