On Thu, Apr 19, 2012 at 3:41 PM, Niall Douglas <s_sourcefo...@nedprod.com> wrote: > > On 19 Apr 2012 at 14:40, JS Unkn0wn wrote: > > > What I'm trying to figure out now are fixing the errors explained on my > > blog entry ( http://goo.gl/K9G36 ). > > I think you will struggle to get much help here by posting links to > other places. No one here has time to read blogs. You need to > formulate the problem into a single post here, preferably with a > small example program illustrating the problem. > > Niall > > -- > Technology & Consulting Services - ned Productions Limited. > http://www.nedproductions.biz/. VAT reg: IE 9708311Q. > Work Portfolio: http://careers.stackoverflow.com/nialldouglas/ > > > > _______________________________________________ > Cplusplus-sig mailing list > Cplusplus-sig@python.org > http://mail.python.org/mailman/listinfo/cplusplus-sig
Well it is a blog entry detailing every single step I took, and every decision I made. But I can copy/paste it into here then if that is the only accepted method of communication ... n.b. output.txt, output2.txt, output3.txt and output4.txt is at the end of this message. -: Problem statement :- I am working on a video game on an embedded games system which does not have a .dll system. I want to embed Python into the binary executable and run python scripts that can communicate with the game engine. -: Additional information :- Python 2.7 was compiled with Visual Studio 2008, which means I don't have to compile Python 2.7 from source in order to use it in my project. You can either extend python or embed Python. I am embedding Python as I will be running this on an embedded system I've actually spent over a week so far trying to get this to work (even using Boost.Pro installer) and it seems like such a painful process. Unfortunately I never kept a log, but here is a brief summary of errors I do recall: Performing some of the cmd.exe steps in cmd.exe instead of Visual Studio 2008 Command Prompt Confusing some of the steps given. For example do I perform this step in the boost, boost-build or Boost.Pro-install directory? And why are libs that are supposed to appear in XYZ appearing elsewhere I was getting obscure compile errors at times, and other times I was was able to compile but would suffer from runtime errors when making calls to Python. I've never spent so much time configuring anything to work like this, and unfortunately I have a high level of patience so I'm not giving up yet. -: Final thoughts before I head back to this torturous task :- Why is this so darn difficult? Why can't it just work? or am I the only one in the world who is doing it the wrong way? I could have come up with my own scripting language by now, without half the headache I've had and time wasted. -:Instructions being followed:- I am following Boost C++ Libraries: Boost.Python Build and Test HOWTO, bearing in mind that it says in 3.1 to (1)Get Boost and (2) Get bjam, directing us to 1:Get Boost and 5:Prepare To Use a Boost Library Binary. -: A: Starting setup :- Python 2.7.2 installed (using python installer) Copied boost to c:\boost_1_47_0 Installed BoostPro to c:\boost_1_47_0 Visual Studio 2008 Installed every variant apart from DLL Multithreaded (+debug) Multithreaded static (+debug) Single threaded, static runtime (+debug) Boost Getting Started On Windows (5.1) says I need all variations of the Regex library, so I have run the installer again but to only install all variants. I have also installed the Multithreaded DLL (+dll) Python variants I have "skipped to Section 6" on Boost Getting Started On Windows (as directed by 5.1), and successfully executed the Regex sample I have done step 4 of the 3.1: Basic Procedure and ran bjam toolset=msvc --verbose-test test in the command prompt -: Result :- .\bin\msvc-9.0\debug\threading-multi\embedding.exe was created Running python test_extending.py yields output3.txt (i.e. a fail) The result is shown in output.txt I ran the MSVC batch file (just to be sure) and which is shown in output2.txt As explained in 3.2: In Case of Trouble, I have created a user-config.jam file with minimum incantation given. Compiling gives the following output4.txt (running python test_extending.py) still fails, buttest_extending.pyc is created this time (which I don't think was before) So here I am at 3.2: In Case of Trouble again, the same place I've been for the past week. I will be asking for help in the cplusplus-sig@python.org mailing list. BEGIN "output.txt">>> notice: found boost-build.jam at C:/boost_1_47_0/libs/python/example/quickstart/boost-build.jam notice: loading Boost.Build from C:/boost_1_47_0/tools/build/v2 notice: Searching C:\WINDOWS C:\Documents and Settings\Keldon C:\Documents and Settings\Keldon C:\boost_1_47_0\libs\python\example\quickstart\../../../../tools/build/v2 C:/boost_1_47_0/tools/build/v2/kernel C:/boost_1_47_0/tools/build/v2/util C:/boost_1_47_0/tools/build/v2/build C:/boost_1_47_0/tools/build/v2/tools C:/boost_1_47_0/tools/build/v2/contrib C:/boost_1_47_0/tools/build/v2/. for site-config configuration file site-config.jam . notice: Loading site-config configuration file site-config.jam from C:/boost_1_47_0/tools/build/v2/site-config.jam . notice: Searching C:\Documents and Settings\Keldon C:\Documents and Settings\Keldon C:\boost_1_47_0\libs\python\example\quickstart\../../../../tools/build/v2 C:/boost_1_47_0/tools/build/v2/kernel C:/boost_1_47_0/tools/build/v2/util C:/boost_1_47_0/tools/build/v2/build C:/boost_1_47_0/tools/build/v2/tools C:/boost_1_47_0/tools/build/v2/contrib C:/boost_1_47_0/tools/build/v2/. for user-config configuration file user-config.jam . notice: Loading user-config configuration file user-config.jam from C:/Documents and Settings/Keldon/user-config.jam . notice: [msvc-cfg] msvc-9.0 detected, command: 'c:\Program Files\Microsoft Visual Studio 9.0\VC\bin\cl.exe' notice: will use 'c:\Program Files\Microsoft Visual Studio 9.0\VC\bin\cl.exe' for msvc, condition <toolset>msvc-9.0 notice: [msvc-cfg] condition: '<toolset>msvc-9.0/<architecture>/<address-model>', setup: 'call "c:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86 >nul ' notice: [msvc-cfg] condition: '<toolset>msvc-9.0/<architecture>/<address-model>32', setup: 'call "c:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86 >nul ' notice: [msvc-cfg] condition: '<toolset>msvc-9.0/<architecture>x86/<address-model>', setup: 'call "c:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86 >nul ' notice: [msvc-cfg] condition: '<toolset>msvc-9.0/<architecture>x86/<address-model>32', setup: 'call "c:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86 >nul ' notice: [msvc-cfg] condition: '<toolset>msvc-9.0/<architecture>/<address-model>64', setup: 'call "c:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86_amd64 >nul ' notice: [msvc-cfg] condition: '<toolset>msvc-9.0/<architecture>x86/<address-model>64', setup: 'call "c:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86_amd64 >nul ' notice: [msvc-cfg] condition: '<toolset>msvc-9.0/<architecture>ia64/<address-model>', setup: 'call "c:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86_ia64 >nul ' notice: [msvc-cfg] condition: '<toolset>msvc-9.0/<architecture>ia64/<address-model>64', setup: 'call "c:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86_ia64 >nul ' notice: [python-cfg] Configuring python... notice: [python-cfg] user-specified version: "2.7" notice: [python-cfg] Registry indicates Python 2.7 installed at "C:\Python27\" notice: [python-cfg] Checking interpreter command "python"... notice: [python-cfg] running command 'DIR /-C /A:S "C:\Python27\python.exe" 2>&1' notice: [python-cfg] running command '"python" -c "from sys import *; print('version=%d.%d\nplatform=%s\nprefix=%s\nexec_prefix=%s\nexecutable=%s' % (version_info[0],version_info[1],platform,prefix,exec_prefix,executable))" 2>&1' notice: [python-cfg] ...requested configuration matched! notice: [python-cfg] Details of this Python configuration: notice: [python-cfg] interpreter command: "python" notice: [python-cfg] include path: "C:\Python27\Include" notice: [python-cfg] library path: "C:\Python27\libs" notice: [python-cfg] DLL search path: "C:\Python27" notice: Searching ../../../.. for project-config configuration file project-config.jam . notice: Loading project-config configuration file project-config.jam from ../../../../project-config.jam . notice: [cmdline-cfg] Detected command-line request for msvc: toolset= msvc version= notice: [cmdline-cfg] toolset msvc already configured notice: iostreams: not using zlib compression notice: iostreams: not using zlib compression notice: iostreams: not using bzip2 compression notice: iostreams: not using bzip2 compression ...patience... ...patience... ...found 1600 targets... ...updating 11 targets... common.mkdir bin common.mkdir bin\msvc-9.0 common.mkdir bin\msvc-9.0\debug common.mkdir bin\msvc-9.0\debug\threading-multi compile-c-c++ bin\msvc-9.0\debug\threading-multi\extending.obj extending.cpp msvc.link.dll bin\msvc-9.0\debug\threading-multi\extending.pyd Creating library bin\msvc-9.0\debug\threading-multi\extending.lib and object bin\msvc-9.0\debug\threading-multi\extending.exp msvc.manifest.dll bin\msvc-9.0\debug\threading-multi\extending.pyd compile-c-c++ bin\msvc-9.0\debug\threading-multi\embedding.obj embedding.cpp msvc.link bin\msvc-9.0\debug\threading-multi\embedding.exe Creating library bin\msvc-9.0\debug\threading-multi\embedding.lib and object bin\msvc-9.0\debug\threading-multi\embedding.exp msvc.manifest bin\msvc-9.0\debug\threading-multi\embedding.exe ...updated 11 targets... <<< output.txt END >>> BEGIN output2.txt notice: found boost-build.jam at C:/boost_1_47_0/libs/python/example/quickstart/boost-build.jam notice: loading Boost.Build from C:/boost_1_47_0/tools/build/v2 notice: Searching C:\WINDOWS C:\Documents and Settings\Keldon C:\Documents and Settings\Keldon C:\boost_1_47_0\libs\python\example\quickstart\../../../../tools/build/v2 C:/boost_1_47_0/tools/build/v2/kernel C:/boost_1_47_0/tools/build/v2/util C:/boost_1_47_0/tools/build/v2/build C:/boost_1_47_0/tools/build/v2/tools C:/boost_1_47_0/tools/build/v2/contrib C:/boost_1_47_0/tools/build/v2/. for site-config configuration file site-config.jam . notice: Loading site-config configuration file site-config.jam from C:/boost_1_47_0/tools/build/v2/site-config.jam . notice: Searching C:\Documents and Settings\Keldon C:\Documents and Settings\Keldon C:\boost_1_47_0\libs\python\example\quickstart\../../../../tools/build/v2 C:/boost_1_47_0/tools/build/v2/kernel C:/boost_1_47_0/tools/build/v2/util C:/boost_1_47_0/tools/build/v2/build C:/boost_1_47_0/tools/build/v2/tools C:/boost_1_47_0/tools/build/v2/contrib C:/boost_1_47_0/tools/build/v2/. for user-config configuration file user-config.jam . notice: Loading user-config configuration file user-config.jam from C:/Documents and Settings/Keldon/user-config.jam . notice: [msvc-cfg] msvc-9.0 detected, command: 'c:\Program Files\Microsoft Visual Studio 9.0\VC\bin\cl.exe' notice: will use 'c:\Program Files\Microsoft Visual Studio 9.0\VC\bin\cl.exe' for msvc, condition <toolset>msvc-9.0 notice: [msvc-cfg] condition: '<toolset>msvc-9.0/<architecture>/<address-model>', setup: 'call "c:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86 >nul ' notice: [msvc-cfg] condition: '<toolset>msvc-9.0/<architecture>/<address-model>32', setup: 'call "c:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86 >nul ' notice: [msvc-cfg] condition: '<toolset>msvc-9.0/<architecture>x86/<address-model>', setup: 'call "c:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86 >nul ' notice: [msvc-cfg] condition: '<toolset>msvc-9.0/<architecture>x86/<address-model>32', setup: 'call "c:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86 >nul ' notice: [msvc-cfg] condition: '<toolset>msvc-9.0/<architecture>/<address-model>64', setup: 'call "c:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86_amd64 >nul ' notice: [msvc-cfg] condition: '<toolset>msvc-9.0/<architecture>x86/<address-model>64', setup: 'call "c:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86_amd64 >nul ' notice: [msvc-cfg] condition: '<toolset>msvc-9.0/<architecture>ia64/<address-model>', setup: 'call "c:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86_ia64 >nul ' notice: [msvc-cfg] condition: '<toolset>msvc-9.0/<architecture>ia64/<address-model>64', setup: 'call "c:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86_ia64 >nul ' notice: [python-cfg] Configuring python... notice: [python-cfg] user-specified version: "2.7" notice: [python-cfg] Registry indicates Python 2.7 installed at "C:\Python27\" notice: [python-cfg] Checking interpreter command "python"... notice: [python-cfg] running command 'DIR /-C /A:S "C:\Python27\python.exe" 2>&1' notice: [python-cfg] running command '"python" -c "from sys import *; print('version=%d.%d\nplatform=%s\nprefix=%s\nexec_prefix=%s\nexecutable=%s' % (version_info[0],version_info[1],platform,prefix,exec_prefix,executable))" 2>&1' notice: [python-cfg] ...requested configuration matched! notice: [python-cfg] Details of this Python configuration: notice: [python-cfg] interpreter command: "python" notice: [python-cfg] include path: "C:\Python27\Include" notice: [python-cfg] library path: "C:\Python27\libs" notice: [python-cfg] DLL search path: "C:\Python27" notice: Searching ../../../.. for project-config configuration file project-config.jam . notice: Loading project-config configuration file project-config.jam from ../../../../project-config.jam . notice: [cmdline-cfg] Detected command-line request for msvc: toolset= msvc version= notice: [cmdline-cfg] toolset msvc already configured notice: iostreams: not using zlib compression notice: iostreams: not using zlib compression notice: iostreams: not using bzip2 compression notice: iostreams: not using bzip2 compression ...patience... ...patience... ...found 1600 targets... <<< output2.txt END >>> BEGIN output3.txt Trying: from extending import * Expecting nothing ********************************************************************** File "C:\boost_1_47_0\libs\python\example\quickstart\test_extending.py", line 6, in test_extending Failed example: from extending import * Exception raised: Traceback (most recent call last): File "C:\Python27\lib\doctest.py", line 1254, in __run compileflags, 1) in test.globs File "<doctest test_extending[0]>", line 1, in <module> from extending import * ImportError: No module named extending Trying: hi = hello('California') Expecting nothing ********************************************************************** File "C:\boost_1_47_0\libs\python\example\quickstart\test_extending.py", line 7, in test_extending Failed example: hi = hello('California') Exception raised: Traceback (most recent call last): File "C:\Python27\lib\doctest.py", line 1254, in __run compileflags, 1) in test.globs File "<doctest test_extending[1]>", line 1, in <module> hi = hello('California') NameError: name 'hello' is not defined Trying: hi.greet() Expecting: 'Hello from California' ********************************************************************** File "C:\boost_1_47_0\libs\python\example\quickstart\test_extending.py", line 8, in test_extending Failed example: hi.greet() Exception raised: Traceback (most recent call last): File "C:\Python27\lib\doctest.py", line 1254, in __run compileflags, 1) in test.globs File "<doctest test_extending[2]>", line 1, in <module> hi.greet() NameError: name 'hi' is not defined Trying: invite(hi) Expecting: 'Hello from California! Please come soon!' ********************************************************************** File "C:\boost_1_47_0\libs\python\example\quickstart\test_extending.py", line 10, in test_extending Failed example: invite(hi) Exception raised: Traceback (most recent call last): File "C:\Python27\lib\doctest.py", line 1254, in __run compileflags, 1) in test.globs File "<doctest test_extending[3]>", line 1, in <module> invite(hi) NameError: name 'invite' is not defined Trying: hi.invite() Expecting: 'Hello from California! Please come soon!' ********************************************************************** File "C:\boost_1_47_0\libs\python\example\quickstart\test_extending.py", line 12, in test_extending Failed example: hi.invite() Exception raised: Traceback (most recent call last): File "C:\Python27\lib\doctest.py", line 1254, in __run compileflags, 1) in test.globs File "<doctest test_extending[4]>", line 1, in <module> hi.invite() NameError: name 'hi' is not defined Trying: class wordy(hello): def greet(self): return hello.greet(self) + ', where the weather is fine' Expecting nothing ********************************************************************** File "C:\boost_1_47_0\libs\python\example\quickstart\test_extending.py", line 15, in test_extending Failed example: class wordy(hello): def greet(self): return hello.greet(self) + ', where the weather is fine' Exception raised: Traceback (most recent call last): File "C:\Python27\lib\doctest.py", line 1254, in __run compileflags, 1) in test.globs File "<doctest test_extending[5]>", line 1, in <module> class wordy(hello): NameError: name 'hello' is not defined Trying: hi2 = wordy('Florida') Expecting nothing ********************************************************************** File "C:\boost_1_47_0\libs\python\example\quickstart\test_extending.py", line 19, in test_extending Failed example: hi2 = wordy('Florida') Exception raised: Traceback (most recent call last): File "C:\Python27\lib\doctest.py", line 1254, in __run compileflags, 1) in test.globs File "<doctest test_extending[6]>", line 1, in <module> hi2 = wordy('Florida') NameError: name 'wordy' is not defined Trying: hi2.greet() Expecting: 'Hello from Florida, where the weather is fine' ********************************************************************** File "C:\boost_1_47_0\libs\python\example\quickstart\test_extending.py", line 20, in test_extending Failed example: hi2.greet() Exception raised: Traceback (most recent call last): File "C:\Python27\lib\doctest.py", line 1254, in __run compileflags, 1) in test.globs File "<doctest test_extending[7]>", line 1, in <module> hi2.greet() NameError: name 'hi2' is not defined Trying: invite(hi2) Expecting: 'Hello from Florida! Please come soon!' ********************************************************************** File "C:\boost_1_47_0\libs\python\example\quickstart\test_extending.py", line 22, in test_extending Failed example: invite(hi2) Exception raised: Traceback (most recent call last): File "C:\Python27\lib\doctest.py", line 1254, in __run compileflags, 1) in test.globs File "<doctest test_extending[8]>", line 1, in <module> invite(hi2) NameError: name 'invite' is not defined 1 items had no tests: test_extending.run ********************************************************************** 1 items had failures: 9 of 9 in test_extending 9 tests in 2 items. 0 passed and 9 failed. ***Test Failed*** 9 failures. <<< output3.txt END >>> BEGIN output4.txt notice: found boost-build.jam at C:/boost_1_47_0/libs/python/example/quickstart/boost-build.jam notice: loading Boost.Build from C:/boost_1_47_0/tools/build/v2 notice: Searching C:\WINDOWS C:\Documents and Settings\Keldon C:\Documents and Settings\Keldon C:\boost_1_47_0\libs\python\example\quickstart\../../../../tools/build/v2 C:/boost_1_47_0/tools/build/v2/kernel C:/boost_1_47_0/tools/build/v2/util C:/boost_1_47_0/tools/build/v2/build C:/boost_1_47_0/tools/build/v2/tools C:/boost_1_47_0/tools/build/v2/contrib C:/boost_1_47_0/tools/build/v2/. for site-config configuration file site-config.jam . notice: Loading site-config configuration file site-config.jam from C:/boost_1_47_0/tools/build/v2/site-config.jam . notice: Searching C:\Documents and Settings\Keldon C:\Documents and Settings\Keldon C:\boost_1_47_0\libs\python\example\quickstart\../../../../tools/build/v2 C:/boost_1_47_0/tools/build/v2/kernel C:/boost_1_47_0/tools/build/v2/util C:/boost_1_47_0/tools/build/v2/build C:/boost_1_47_0/tools/build/v2/tools C:/boost_1_47_0/tools/build/v2/contrib C:/boost_1_47_0/tools/build/v2/. for user-config configuration file user-config.jam . notice: Loading user-config configuration file user-config.jam from C:/Documents and Settings/Keldon/user-config.jam . notice: [python-cfg] Configuring python... notice: [python-cfg] Registry indicates Python 2.7 installed at "C:\Python27\" notice: [python-cfg] Checking interpreter command "python"... notice: [python-cfg] running command 'DIR /-C /A:S "C:\Python27\python.exe" 2>&1' notice: [python-cfg] running command '"python" -c "from sys import *; print('version=%d.%d\nplatform=%s\nprefix=%s\nexec_prefix=%s\nexecutable=%s' % (version_info[0],version_info[1],platform,prefix,exec_prefix,executable))" 2>&1' notice: [python-cfg] ...requested configuration matched! notice: [python-cfg] Details of this Python configuration: notice: [python-cfg] interpreter command: "python" notice: [python-cfg] include path: "C:\Python27\Include" notice: [python-cfg] library path: "C:\Python27\libs" notice: [python-cfg] DLL search path: "C:\Python27" notice: Searching ../../../.. for project-config configuration file project-config.jam . notice: Loading project-config configuration file project-config.jam from ../../../../project-config.jam . notice: [msvc-cfg] msvc-9.0 detected, command: 'c:\Program Files\Microsoft Visual Studio 9.0\VC\bin\cl.exe' notice: will use 'c:\Program Files\Microsoft Visual Studio 9.0\VC\bin\cl.exe' for msvc, condition <toolset>msvc-9.0 notice: [msvc-cfg] condition: '<toolset>msvc-9.0/<architecture>/<address-model>', setup: 'call "c:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86 >nul ' notice: [msvc-cfg] condition: '<toolset>msvc-9.0/<architecture>/<address-model>32', setup: 'call "c:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86 >nul ' notice: [msvc-cfg] condition: '<toolset>msvc-9.0/<architecture>x86/<address-model>', setup: 'call "c:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86 >nul ' notice: [msvc-cfg] condition: '<toolset>msvc-9.0/<architecture>x86/<address-model>32', setup: 'call "c:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86 >nul ' notice: [msvc-cfg] condition: '<toolset>msvc-9.0/<architecture>/<address-model>64', setup: 'call "c:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86_amd64 >nul ' notice: [msvc-cfg] condition: '<toolset>msvc-9.0/<architecture>x86/<address-model>64', setup: 'call "c:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86_amd64 >nul ' notice: [msvc-cfg] condition: '<toolset>msvc-9.0/<architecture>ia64/<address-model>', setup: 'call "c:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86_ia64 >nul ' notice: [msvc-cfg] condition: '<toolset>msvc-9.0/<architecture>ia64/<address-model>64', setup: 'call "c:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86_ia64 >nul ' notice: [cmdline-cfg] Detected command-line request for msvc: toolset= msvc version= notice: [cmdline-cfg] toolset msvc already configured notice: iostreams: not using zlib compression notice: iostreams: not using zlib compression notice: iostreams: not using bzip2 compression notice: iostreams: not using bzip2 compression ...patience... ...patience... ...found 1600 targets... <<< output4.txt END _______________________________________________ Cplusplus-sig mailing list Cplusplus-sig@python.org http://mail.python.org/mailman/listinfo/cplusplus-sig