首先,編譯boost_python.dll:
在目錄boost/boost_1_32_0/libs/python/build/VisualStudio下,有vc的工程文件boost_python.dsw,我是用VC6編譯的,這個文件剛好用:-)打開它。編譯release還是debug隨便,在tools->option->directories中,添加include file,D:/BOOST/BOOST_1_32_0和C:/TOOLS/PYTHON/INCLUDE(<pyconfig.h>文件路徑),添加Library files,C:/TOOLS/PYTHON/LIBS(包涵python24.lib),然後就可以編譯通過了,順利!
接下來,編譯教程中的hello.cpp,就是
>>import hello
>>hello.greet()
'Hello, world!'
的那個文件,要使用bjam,boost32裏面那個就好用,至於Jamfile用原配的吧
需要注意的是:
set PYTHON_ROOT=c:/dev/tools/python
set PYTHON_VERSION=2.2
這兩句話一定要執行一下,尤其PYTHON_VERSION,一定要是2.2,千萬別耍小聰明,弄個2.3,2.4什麼的,不然自討苦喫,然後開始編譯(使用vc6)
bjam -sTOOLS=msvc
很快就能得到
hello.pyd,表示編譯成功!
最後,把
hello.pyd和boost_python.dll拷貝到同一個目錄,如:D:/python/boost下,來到命令行運行:
D:/python/boost/python
Python 2.4 (#60, Nov 30 2004, 11:49:19) [MSC v.1310 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>import hello
>>hello.greet()
'Hello, world!'
>>
萬事大吉。
boost Python 編譯通過記錄
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章
EclipseCDT
最近聽說Eclipse不但可以編輯Java程序,還能夠編寫C++的代碼,我就搞了一個來,eclipse3.0+cdt2.1,呵呵,滿懷
auding1900
2020-06-24 14:30:03
C++ Coding Standards ---- Item1 : Compile cleanly at high warning levels.
auding1900
2020-06-24 14:29:45
EclipseJava
環境變量classpath, java_home, path,是必須要設置的: classpath=C:/Sun/AppServer/jdk/l
auding1900
2020-06-24 14:29:45
新的版本控制工具
auding1900
2020-02-20 19:41:33
C++ Coding Standards Item 4: Invest in code reviews
auding1900
2020-02-20 19:41:32
C++ Coding Standards Item 2 : Use an automated build system
auding1900
2020-02-20 19:41:32
C++ Coding Standards Item 3: Use a version control system
auding1900
2020-02-20 19:41:32
C++ Coding Standards Item 5 : Give One entity one cohesive responsibility
auding1900
2020-02-20 19:41:32
wxPython學習2005-07-21
auding1900
2020-02-20 19:41:32
全部開源
auding1900
2020-02-20 19:41:32
EclipsePython
auding1900
2020-02-20 19:41:32
C++ Coding Standards ---- Item0 : Don's sweat the small stuff.(Or : Know what not to standardize)
auding1900
2020-02-20 19:41:31
關於sort 和 qsort
auding1900
2020-02-20 19:41:31