build boost.python tutorial "hello world" without bjam

hi there,
for some days i try to build the boost.python tutorial "hello world" without bjam on winxp by using mingw.
so i wrote a *.bat-file:
// --- snip -----------------------------------------------------------------------------
@echo off
SETLOCAL
SET DIR_MINGW=c:\development_compiler\mingw\
SET DIR_BOOST=c:\development_compiler\_boost\
SET DIR_PYTHN=c:\development_compiler\python25\
SET DIR_PRJCT=%~dp0
SET NME_PRJCT=hello
SET CC=c:\development_compiler\mingw\bin\g++.exe
SET INCL=-I%DIR_BOOST%include\boost-1_34_1 -I%DIR_PYTHN%include -I%DIR_MINGW%include
SET LIBS=-L%DIR_BOOST%lib -L%DIR_PYTHN%libs -L%DIR_MINGW%lib %CC% -O0 -shared %INCL% %LIBS% -lboost_python-mgw34-s-1_34_1 -lpython25 %DIR_PRJCT%%NME_PRJCT%.cpp -o %NME_PRJCT%.pyd
ENDLOCAL
// --- snip -----------------------------------------------------------------------------
this works fine. but nevertheless it produces errors.
// --- snip -----------------------------------------------------------------------------
D:\Temp\boost_test>c:\development_compiler\mingw\bin\g++.exe -O0 - shared -Ic:\development_compiler\_boost\include\boost-1_34_1 -Ic:\development_compiler\python25\include -Ic:\development_compiler\mingw\include -Lc:\development_compiler\_boost\lib -Lc:\development_compiler\python25\libs -Lc:\development_compiler\mingw\lib -lboost_python-mgw34-mt-s-1_34_1 -lpython25 D:\Temp\boost_test\hello.cpp -o hello.pyd
C:\DOKUME~1\DBlock\LOKALE~1\Temp/cciAbaaa.o:hello.cpp:(.text+0x11e): undefined reference to `_imp___ZN5boost6python6detail11init_moduleEPKcPFvvE' C:\DOKUME~1\DBlock\LOKALE~1\Temp/cciAbaaa.o:hello.cpp:(.text$_ZN5boost6python3de
fIPFPKcvEEEvS3_T_[void boost::python::def

damny@web.de wrote:
hi there,
for some days i try to build the boost.python tutorial "hello world" without bjam on winxp by using mingw. so i wrote a *.bat-file:
// --- snip ----------------------------------------------------------------------------- @echo off SETLOCAL SET DIR_MINGW=c:\development_compiler\mingw\ SET DIR_BOOST=c:\development_compiler\_boost\ SET DIR_PYTHN=c:\development_compiler\python25\ SET DIR_PRJCT=%~dp0 SET NME_PRJCT=hello SET CC=c:\development_compiler\mingw\bin\g++.exe SET INCL=-I%DIR_BOOST%include\boost-1_34_1 -I%DIR_PYTHN%include -I%DIR_MINGW%include SET LIBS=-L%DIR_BOOST%lib -L%DIR_PYTHN%libs -L%DIR_MINGW%lib %CC% -O0 -shared %INCL% %LIBS% -lboost_python-mgw34-s-1_34_1 -lpython25 %DIR_PRJCT%%NME_PRJCT%.cpp -o %NME_PRJCT%.pyd ENDLOCAL // --- snip -----------------------------------------------------------------------------
this works fine. but nevertheless it produces errors.
// --- snip ----------------------------------------------------------------------------- D:\Temp\boost_test>c:\development_compiler\mingw\bin\g++.exe -O0 - shared -Ic:\development_compiler\_boost\include\boost-1_34_1 -Ic:\development_compiler\python25\include -Ic:\development_compiler\mingw\include -Lc:\development_compiler\_boost\lib -Lc:\development_compiler\python25\libs -Lc:\development_compiler\mingw\lib -lboost_python-mgw34-mt-s-1_34_1 -lpython25 D:\Temp\boost_test\hello.cpp -o hello.pyd
This is just a wild guess, but what happens when you reorder your compile command, putting the libraries _after_ the source file, like this: g++.exe -O0 - shared \ -Ic:\development_compiler\_boost\include\boost-1_34_1 \ -Ic:\development_compiler\python25\include \ -Ic:\development_compiler\mingw\include \ D:\Temp\boost_test\hello.cpp \ -Lc:\development_compiler\_boost\lib \ -Lc:\development_compiler\python25\libs \ -Lc:\development_compiler\mingw\lib \ -lboost_python-mgw34-mt-s-1_34_1 -lpython25 \ -o hello.pyd [...] Markus
participants (2)
-
damny@web.de
-
Markus Schöpflin