正在进行安全检测...

发布时间:2024-01-08 00:35:06

boost库编译方法(zzWindows:C++代码bjam.exe--build-type=minimal--with-date_time--with-filesystem--with-program_options--with-regex--with-serialization--with-system--with-threadtoolset=msvc-9.0variant=releaselink=staticthreading=multistagebjam.exe--build-type=minimal--with-date_time--with-filesystem--with-program_options--with-regex--with-serialization--with-system--with-threadtoolset=msvc-9.0variant=releaselink=staticthreading=multistageLinux:C++代码./bjam--build-type=minimal--with-date_time--with-filesystem--with-program_options--with-regex--with-serialization--with-system--with-threadvariant=releaselink=staticthreading=multistage./bjam--build-type=minimal--with-date_time--with-filesystem--with-program_options--with-regex--with-serialization--with-system--with-threadvariant=releaselink=staticthreading=multistage:-////////////////////////////////////////////////许多新人对于编译BOOST感到无从下手,甚至因此而放弃使用BOOST那真的太可惜了,下面我把一些常用的BOOST编译方法贴于此,同时也作为自己的笔记。先下载bjam.exe复制到$BOOST$目录下。或者自己生成bjam打开VisualStudio2008命令提示窗口$BOOST$\tools\jam\src,执行build.bat会在$BOOST$\tools\jam\src\bin.ntx86生成bjam.exe文件。复制文件bjam.exe文件到$BOOST$\下。1.完全编译安装:bjam--toolset=msvcinstall完成后会生成一个bin.v2编译时的临时目录,手动删除。生成另一个目录C:\boost,里面为所有的头文件和库文件。头文件目录为boost_1_34_1\boost目录复制过去的。2.只编译相应的库文件bjam--toolset=msvcstage完成后同样会生成bin.v2临时目录。另一个目录为stage文件,里面有对应的库文件。3.查看需要编译才能使用的库列表bjam--show-libraries4.编译特定的库,如只编译regexbjam--toolset=msvc--with-regexstage生成的库文件在stage目录中。5.不编译某个库,如不编译regexbjam--toolset=msvc--without-regexstage
生成的库文件在stage目录中。6.编译特定的库,如只编译regex,生成debug,多线程,共享连接版本,并保存在stagebjam--toolset=msvc--with-regexstagedebugthreading=multilink=shared7.生成mt-sgd的静态库(runtime-link-staticbjam"-sTOOLS=vc-8_0"--with-threadinstalldebugreleaseruntime-link=static8.编译regex库。bjam--toolset=msvc--with-regexstagedebugreleasethreading=multithreading=singlelink=sharedlink=staticruntime-link=sharedruntime-link=staticboost的安装方法:对于DLL版本bjam--toolset=msvclink=sharedruntime-link=sharedthreading=multistagedebugreleaseinstall对于lib版本bjam--toolset=msvclink=staticruntime-link=sharedthreading=multistagedebugreleaseinstall另外,在$BOOST$\tools\build\v2\user-config.jam找到下面的地文#-------------------#MSVCconfiguration.#-------------------#Configuremsvc(defaultversion,searchedforinstandardlocationsandPATH.#usingmsvc;#Configurespecificmsvcversion(searchedforinstandardlocationsandPATH.#usingmsvc:8.0;#在这里添加vs2008的配置usingmsvc:9.0::/wd4819/D_CRT_SECURE_NO_DEPRECATE/D_SCL_SECURE_NO_DEPRECATE/D_SECURE_SCL=0;#在这里添加vs2005的配置usingmsvc:8.0::/wd4819/D_CRT_SECURE_NO_DEPRECATE/D_SCL_SECURE_NO_DEPRECATE/D_SECURE_SCL=0;然后进入$BOOST$目录,执行bjam.exe编译命令//下面的命令的各选项的说明://prefixboost安装到的路径(生成的头文件和库文件都会放到该路径中)//重定义以下变量(利用-s设置)//VC80_ROOTvc2005的安装路径,如果未将vc2005安装到默认位置,你必须指定该项。//TOOLS使用的编译工具,vc2005对应的是vc-8_0//PYTHON_ROOTython的安装目录,如果未将BOOST安装到默认位置,你必须指定该项。//BUILD编译结果选项,默认会生成尽可能多的版本,如调试版/发行版,静态库/动态库,单线程/多线程。bjam命令说明Boost.BuildV2(Milestone12Boost.Jam03.1.16Project-specifichelp:ProjecthasjamfileatJamrootUsage:

正在进行安全检测...

相关推荐