您现在的位置: 中国男护士网 >> 考试频道 >> 计算机等级 >> 二级辅导 >> C十十 >> 辅导 >> 正文    
  C++基础(boost与libtorrent的安装方法) 【注册男护士专用博客】          

C++基础(boost与libtorrent的安装方法)

www.nanhushi.com     佚名   不详 

  编译boost:
  1.下載boost source
  到http://www.boost.org下載最新版本的boost,我目前下載的是1.33.1,將之解壓縮到c:\boost_1_33_1\下
  2.編譯bjam
  利用Visual Studio 2005 Command Prompt開啟DOS視窗,Examda,將目錄cd到C:\boost_1_33_1\tools\build\jam_src下,執行build.bat,然後會在C:\boost_1_33_1\tools\build\jam_src\bin.ntx86\產生bjam.exe,將bjam.exe複製到c: \boost_1_33_1\下
  3.編譯boost
  將目錄移至c:\boost_1_33_1\下執行bjam "sTOOLS=vs8_0" "sPYTHON_ROOT=c:\Python25"
  "prefix=c:\boost" install
  參數說明
  sTOOLS : 使用compiler,Visual Studio 2005為vs8_0
  sPYTHON_ROOT:boost 1.33.1預設支援python 2.4,但最新版本為python 2.5,若要同時編譯支援Python的boost,須加上"sPYTHON_ROOT"參數指定Python目錄
  prefix:指定編譯後library的安裝目錄
  sVC80_ROOT:若你的Visual Studio 2005不是安裝在預設目錄,就必須自己指定,如"sVC80_ROOT=D:\Program Files\Microsoft Visual Studio 8\VC"
  4.開始編譯
  需要一段時間編譯,出現不少warning訊息,但不用擔心,主要是Visual C++ 8.0支援新的C++標準,但boost用了一些deprecated的寫法,以及code page的警告。
  5.設定Visual Studio 2005環境
  Tools > Options > Projects and Solutions > VC++ Directories
  在Library files加上c:\boost\lib
  在Include files加上c:\Boost\include\boost1_33_1
  setting up and compiling libtorrent with vs.net 2005
  1. create a new vs.net 2005 MFC project and solution file
  2. include the files contained in the src folder, excluding the makefiles.
  only include either file.cpp or file_win.cpp
  3. include all .c files in the zlib folder
  4. add the following additional include header files:
  "libtorrent\include"
  "c:\boost\include\boost1_33_1"
  "libtorrent\zlib"
  "libtorrent\include\libtorrent"
  5. add the following preprocessor definitions:
  WIN32
  WIN32_LEAN_AND_MEAN
  _WIN32_WINNT=0x0500
  BOOST_ALL_NO_LIB
  _FILE_OFFSET_BITS=64
  BOOST_THREAD_USE_LIB
  TORRENT_BUILDING_SHARED
  TORRENT_LINKING_SHARED
  UNICODE
  6. add c:\boost\lib to additional library directories
  7. add the following additional dependencies: under project property pages>configuration properties>linker>Input>Addtional Dependencies
  wsock32.lib
  libboost_threadvc80mt.lib
  libboost_filesystemvc80mt.lib
  libboost_date_timevc80mt.lib
  8. set the runtime library to Multithreaded Debug Dll(/MDd) under the code generation section.
  libtorrent provides some examples : dump_torrent.cpp (parse torrent file)考试大(www.Examda。com)

 

文章录入:杜斌    责任编辑:杜斌 
  • 上一篇文章:

  • 下一篇文章:
  • 【字体: 】【发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口
     

    联 系 信 息
    QQ:88236621
    电话:15853773350
    E-Mail:malenurse@163.com
    免费发布招聘信息
    做中国最专业男护士门户网站
    最 新 热 门
    最 新 推 荐
    相 关 文 章
    没有相关文章
    专 题 栏 目

      网友评论:(只显示最新10条。评论内容只代表网友观点,与本站立场无关!)                            【进男护士社区逛逛】
    姓 名:
    * 游客填写  ·注册用户 ·忘记密码
    主 页:

    评 分:
    1分 2分 3分 4分 5分
    评论内容:
  • 请遵守《互联网电子公告服务管理规定》及中华人民共和国其他各项有关法律法规。
  • 严禁发表危害国家安全、损害国家利益、破坏民族团结、破坏国家宗教政策、破坏社会稳定、侮辱、诽谤、教唆、淫秽等内容的评论 。
  • 用户需对自己在使用本站服务过程中的行为承担法律责任(直接或间接导致的)。
  • 本站管理员有权保留或删除评论内容。
  • 评论内容只代表网友个人观点,与本网站立场无关。