Re: [心得] boost 編譯方法心得

看板C_and_CPP作者 (樂於助人)時間15年前 (2008/09/13 19:00), 編輯推噓2(202)
留言4則, 4人參與, 最新討論串2/2 (看更多)
※ 引述《ewn (...)》之銘言: : boost 這個 lib 應該很多人用吧,但是版上都沒個完整的編譯安裝心得 : 所以我把自己在 windows 上安裝 n 次的心得 po 上來給大家參考一下 : 1.首先從官網下載 boost 的原始碼和 bjam 的 binary : 把 boost 解開到某資料夾,如 d:\boost_1_36 : 再把 bjam 的執行檔也解到同一個資料夾下 : 2.進到 d:\boost_1_36 的資料夾下,用記事本打開Jamroot檔 : (Jamroot 好像是用 Python 寫的?? 前面一半是 bjam 的說明) : 在裡面找到一段這樣子的片段: : local default-build,complete = : debug release : <threading>single <threading>multi : <link>shared <link>static : <runtime-link>shared <runtime-link>static : 這一段就是 bjam --build-type=xxx的內容,依你需要的新增一個 ^^^^^^^^ : 像我平常不想用到 debug(多了debug多了1~2g的容量) : 而且我想要 static-link,不想用 dll,所以我改成如下: : local default-build, mybuild = : release : <threading>multi : <link>static : 這一段是自由發揮的,你想要編啥東西出來就改一改 : 不然就是直接用他 complete 的設定 今天嘗試手動build boost 1.36,發現這裡需要注意一下。 我們可以新增一個自己的build type(可以copy complete來改), 但要注意上方有一段程式會偵測你輸入的build type是否在允許的列表內: if ! ( $(build-type) in minimal complete ) { build-type = minimal ; } 所以如果要使用到我們自己新增的build type,我們要把它加到列表內,也就是: if ! ( $(build-type) in minimal complete mybuild ) { build-type = minimal ; } 否則bjam會用minimal。 [恕刪] -- 西方三聖:http://p8.p.pixnet.net/albums/userpics/8/3/553683/1193661731.jpg
《佛說阿彌陀經》http://web.cc.ncu.edu.tw/~93501025/amtf.doc 十一面觀音咒:http://file.buda.idv.tw/music/DBZFY04.mp3 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.115.220.219 ※ 編輯: zxvc 來自: 140.115.220.219 (09/13 19:02)

09/13 19:20, , 1F
感謝分享.. bjam 對我來說一直示意個很迷惑的東西..
09/13 19:20, 1F

09/13 19:23, , 2F
抱歉,我的確沒發現到那邊也要改,我會改一下我的文章
09/13 19:23, 2F

09/13 20:02, , 3F
我覺得bjam很像make這個東西。
09/13 20:02, 3F

09/14 11:53, , 4F
我發現mybuild後面沒空一格會錯誤
09/14 11:53, 4F
文章代碼(AID): #18ovrWog (C_and_CPP)
文章代碼(AID): #18ovrWog (C_and_CPP)