在windows和linux安装与测试STLPort
2011-09-13 10:45
465 查看
http://www.stlport.org,具体内容就不详细描述了!
A、在Windows中安装
1.编辑VC安装目录下VC98的VC98\bin中运行vcvars32.bat,在最后添加如下三行:
set STLPATH=E:\STLport-5.2.1
set INCLUDE=%STLPATH%\stlport;%INCLUDE%
set LIB=%STLPATH%\lib;%LIB%。
2.把vcvars32.bat另存为vcvars32_stl.bat
3.运行vcvars32_stl.bat。
4.到%STLPort%\build\lib\下,在命令提示符下执行configure.bat -c msvc6。
5.执行nmake /fmsvc.mak install开始编译。
6.编译结束后,将bin\目录下的三个*.dll文件拷贝到windows\system32\目录下。
7.设置%STLPort%目录下的\include\和\lib\目录到VC的默认include和lib路径之中,要把%STLPort%放在第一行,以保证先使用STLPort。
最后注意,STLPort在控制台程序中使用时要更改运行时库为多线程库,否侧编译通不过。
B、在linux-openSUSE11.0安装
1.把STLport-5.2.1.rar解压到/home/STLport-5.2.1目录中。
2.#cd /home/STLport-5.2.1/build/lib
3.#make -f gcc.mak depend
4.#make -f gcc.mak install
5.编写测试程序
teststlport521程序Makefile文件编写
PRJNAME= teststlport521
PRJOUT = /FEPDebug
include $(FEPHOME)/code/include/makefile_linux
####### Files
SRCDIR =../src
SOURCES = stdafx.cpp \
testSTLPort521.cpp
OBJECTS = $(OBJDIR)/stdafx.o \
$(OBJDIR)/testSTLPort521.o
FEPLIB = -lstlport
STLPATH = -I/usr/local/include/stlport
INCPATH += $(STLPATH)
OUTBIN = $(BINDIR)/$(PRJNAME)
####### Build rules
all: obj_dir $(OUTBIN)
obj_dir:
@$(CHK_DIR_EXISTS) $(OBJDIR) || $(MKDIR) $(OBJDIR)
$(OUTBIN): $(OBJECTS)
$(CXX) -o $@ $(OBJECTS) $(FEPLIB)
####### Include file dependencies
depend:
@(mkdepend -p$(OBJDIR)/ -o.o $(INCPATH) $(SOURCES))>/dev/null 2>&1
@rm -f makefile.bak
clean:
rm -f $(OBJECTS)
rm -f $(OUTBIN)
####### Compile
$(OBJDIR)/stdafx.o: $(SRCDIR)/stdafx.cpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $?
$(OBJDIR)/testSTLPort521.o: $(SRCDIR)/testSTLPort521.cpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $?
# DO NOT DELETE THIS LINE -- make depend depends on it.
编译后运行测试
# ./teststlport521
hello hash_map!
A、在Windows中安装
1.编辑VC安装目录下VC98的VC98\bin中运行vcvars32.bat,在最后添加如下三行:
set STLPATH=E:\STLport-5.2.1
set INCLUDE=%STLPATH%\stlport;%INCLUDE%
set LIB=%STLPATH%\lib;%LIB%。
2.把vcvars32.bat另存为vcvars32_stl.bat
3.运行vcvars32_stl.bat。
4.到%STLPort%\build\lib\下,在命令提示符下执行configure.bat -c msvc6。
5.执行nmake /fmsvc.mak install开始编译。
6.编译结束后,将bin\目录下的三个*.dll文件拷贝到windows\system32\目录下。
7.设置%STLPort%目录下的\include\和\lib\目录到VC的默认include和lib路径之中,要把%STLPort%放在第一行,以保证先使用STLPort。
最后注意,STLPort在控制台程序中使用时要更改运行时库为多线程库,否侧编译通不过。
B、在linux-openSUSE11.0安装
1.把STLport-5.2.1.rar解压到/home/STLport-5.2.1目录中。
2.#cd /home/STLport-5.2.1/build/lib
3.#make -f gcc.mak depend
4.#make -f gcc.mak install
5.编写测试程序
// testSTLPort521.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include <iostream> #include <hash_map> #include <string> using namespace std; int main() { hash_map<int, string> mymap; mymap[0x2011] = "liuxuezong"; mymap[0x7c00] = "STLport"; mymap[0x9000] = "hello hash_map!"; hash_map<int, string>::iterator iter = mymap.find(0x9000); if (iter != mymap.end()) { cout << iter->second << endl; } return 0; }
teststlport521程序Makefile文件编写
PRJNAME= teststlport521
PRJOUT = /FEPDebug
include $(FEPHOME)/code/include/makefile_linux
####### Files
SRCDIR =../src
SOURCES = stdafx.cpp \
testSTLPort521.cpp
OBJECTS = $(OBJDIR)/stdafx.o \
$(OBJDIR)/testSTLPort521.o
FEPLIB = -lstlport
STLPATH = -I/usr/local/include/stlport
INCPATH += $(STLPATH)
OUTBIN = $(BINDIR)/$(PRJNAME)
####### Build rules
all: obj_dir $(OUTBIN)
obj_dir:
@$(CHK_DIR_EXISTS) $(OBJDIR) || $(MKDIR) $(OBJDIR)
$(OUTBIN): $(OBJECTS)
$(CXX) -o $@ $(OBJECTS) $(FEPLIB)
####### Include file dependencies
depend:
@(mkdepend -p$(OBJDIR)/ -o.o $(INCPATH) $(SOURCES))>/dev/null 2>&1
@rm -f makefile.bak
clean:
rm -f $(OBJECTS)
rm -f $(OUTBIN)
####### Compile
$(OBJDIR)/stdafx.o: $(SRCDIR)/stdafx.cpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $?
$(OBJDIR)/testSTLPort521.o: $(SRCDIR)/testSTLPort521.cpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $?
# DO NOT DELETE THIS LINE -- make depend depends on it.
编译后运行测试
# ./teststlport521
hello hash_map!
相关文章推荐
- windows下的vmware安装linux上网问题-已测试通过
- sipp 在windows/linux下的安装和使用及性能测试
- sipp 在windows/linux下的安装和使用及性能测试
- sipp 在windows/linux下的安装和使用及性能测试
- redis-windows环境安装与测试+linux环境安装以及一些操作
- Windows下的Memcache安装与Java部署(测试用,一般情况下会在linux环境下使用memcahe)
- 如何在安装双启动后卸载 Windows 或者 Linux
- Windows 下硬盘安装linux 系统
- zookeeper windows 入门安装和测试
- linux和windows下安装python拓展包及requirement.txt安装类库
- linux下安装zeromq及其测试
- SVN (Subversion) 的安装配置与应用(linux和windows)
- backtrack5 完美解决windows平台下软件在linux中安装方法
- Windows下ZooKeeper安装和测试
- NO1:安装VMLinux虚拟机,安装配置Samba实现Linux与Windows文件共享
- 实现Windows与VMware下Linux的文件共享 VMware Tools 安装
- Linux性能测试工具-UnixBench--安装以及结果分析
- windows下测试oracle安装是否成功
- hadoop入门-在windows上安装,测试hadoop
- windows安装Spark单机开发测试环境