2013-05-17 3 views
0

내 시스템에 boostpro (boost 1.47)를 설치했습니다. 나는에 bjam 명령을 실행할 때 (윈도우 7 32 비트) "C : \ 프로그램 파일 \ 부스트 \ boost_1_47 \ libs와 \ 파이썬 \ 예"나는 다음과 같은 오류부스트 파이썬에서 bjam을 실행하는 중 오류가 발생했습니다.

C:\Program Files\boost\boost_1_47\libs\python\example\boost-build.jam attempted 
to load the build system by invoking 

    'boost-build ../../../tools/build/v2 ;' 

but we were unable to find "bootstrap.jam" in the specified directory 
or in BOOST_BUILD_PATH (searching C:\Program Files\boost\boost_1_47\libs\python\ 
example\../../../tools/build/v2). 

이 무엇을 의미합니까 얻을? 내 시스템에는 도구/빌드/v2도 없다. 이 문제를 어떻게 해결할 수 있습니까?

답변

0

bjam으로 싸우는 대신 Scons을 테스트 할 수 있습니다. 어느 날 나는 boost :: python을 사용하는 응용 프로그램을 작성했고 Scons는 나를 많이 도와주었습니다. 나에게 모든 것이 훨씬 더 간단했다.

import os, shutil, platform, re 
import SCons.Builder 

def copyLibBuilder(target, source, env): 
    '''copy library''' 
    shutil.copy(str(source[0]), str(target[0])) 
    return 

env = Environment() 

env.Append(ENV = {'PATH' : os.environ['PATH'] }) 

if(platform.system() == "Linux"): 

    env.Append(CPPPATH = ['/usr/include/python2.7']) 
    env.Append(LIBPATH = ['/usr/lib/python2.7']) 

    env.Append(CPPFLAGS = '-Wall -pedantic -pthread -O3 -std=c++0x -lboostpython') 
    env.Append(LINKFLAGS = '-Wall -pthread') 

    env.Append(LIBS = [ 'boost_python' ]) 

elif(platform.system() == "Windows"): 
    env.Append(CPPPATH = [ Dir('C:/Boost/include/boost-1_52'), # path to installed boost headers 
          Dir('C:/Python27/include') ]) # path to installed python headers 
    env.Append(LIBPATH = [ Dir('C:/Boost/lib'), # path to boost library 
          Dir('C:/Python27/libs') ]) #path to python 

    env.Append(CPPFLAGS = ' /EHsc /MD /D "WIN32" /D "_CONSOLE" /W4') 
    env.Append(LINKFLAGS = ' /SUBSYSTEM:WINDOWS ') 

else: 
    print platform.system() + " not supported" 

#build C++ library 
cpplib = env.SharedLibrary(target = 'sources', 
       source = ['file1.cpp', 'file2.cpp']) 
if(platform.system() == "Linux"): 
    target = 'my_new_module.so' 
elif(platform.system() == "Windows"): 
    target = 'my_new_module.pyd' 
env.Command(target, cpplib, copyLibBuilder) 
:

그리고 여기가 Sconstruct의 예입니다

관련 문제