저는 Boost Python 라이브러리를 사용하여 C++ 코드의 파이썬 확장을 만듭니다. 나는 파이썬에서 C++ 코드에서 '인사'기능을 호출 할 수, 아래에서 확인하실 수 있습니다 싶습니다building Visual Studio 2008을 사용하여 파이썬 예제를 개선합니다.
#include <boost/python/module.hpp>
#include <boost/python/def.hpp>
char const* greet()
{
return "hello, world";
}
BOOST_PYTHON_MODULE(hello_ext)
{
using namespace boost::python;
def("greet", greet);
}
그리고 파이썬 코드 :
import hello_ext
print hello_ext.greet()
내가 사용이 작업을 수행하기 위해 관리했습니다 bjam (hello_ext.pyd가 생성되고 멋지게 작동합니다.)하지만 Visual Studio 2008을 사용하여 빌드하고 싶습니다. hello.dll이 빌드됩니다 (hello_ext.dll이나 .pyd도 생성되지 않습니다). 내 파이썬 코드를 호출 한 후 오류가 발생합니다.
ImportError : hello_ext라는 모듈이 없습니다.
hello.pyd 또는 hello_ext.pyd하는 hello.dll 이름을 바꾼 후, 나는 또 다른 ImportError를 얻을 : DLL이로드가
가 어떻게 VS 2008를 사용하여 올바른으로 .pyd 파일을 구축 할 수 있습니다 실패?
참조 http://stackoverflow.com/questions/2003506/how-to-build-a-boost-dependent-project-using- regularular-makefiles/2055958#2055958 – rafak