OK I managed to compiled the wrap file (SWIG option)by a bit of luck and looking at the manual for gcc. This is the way I did it.
gcc -c example_wrap.c -IC:\Python25\include The -I needed to be next to the path not separate by a / or \ Now the problem is linking the files together. I used the command given by the example. ld -shared example.o example_wrap.o -o _example.so I get an error saying something about the time. I think since I'm in windows I'm not using the ld command properly. Any hints would be greatly appreciated. It seems that if I can get pass this step then Swig will be the winner for me. --- In [email protected], "mr_gees100_peas" <[EMAIL PROTECTED]> wrote: > > Hi I've been trying to use either swig or boost.python to wrap some > c/c++ code so it can be accessed easily from python. I have had ZERO > luck with either. > > this is what I have done with boost.python > > I downloaded the boost library and the bjam library. both are in my C: > directory. > > I then set up the path so that I could do bjam from anywhere suing the > coomand prompt. Did the same for python and g++. I'm using the g++ > that came with bloodshed DevC++ compiler. > > So, I navigated myself to the tutorial example in the boost library. > C:\boost_1_34_0\libs\python\example\tutorial > > In the command prompt I typed bjam and I got the following error message. > > C:\boost_1_34_0\libs\python\example\tutorial>bjam > Jamroot:17: in modules.load > rule python-extension unknown in module > Jamfile</C:/boost_1_34_0/libs/python/example/tutorial>. > C:/boost_1_34_0/tools/build/v2/build\project.jam:312: in load-jamfile > C:/boost_1_34_0/tools/build/v2/build\project.jam:68: in load > C:/boost_1_34_0/tools/build/v2/build\project.jam:170: in project.find > C:/boost_1_34_0/tools/build/v2\build-system.jam:237: in load > C:\boost_1_34_0\libs\python\example\..\..\..\tools\build\v2/kernel\modules.jam:261: > in import > C:\boost_1_34_0\libs\python\example\..\..\..\tools\build\v2/kernel/bootstrap.jam:132: > in boost-build > C:\boost_1_34_0\libs\python\example\boost-build.jam:7: in module scope > > > I've have been trying desperately for 3 days. I also tried swig with > similar results but I feel I'm closer to solving the issue with boost > than with swig. I'm at a total lost here. I have tried the tutorials > in the boost web page but I just don't get anywhere. > > http://www.boost.org/libs/python/doc/tutorial/doc/html/python/hello.html > > with swig I get a similar problem > > I copied the sample files in their webpage. I then typed swig > example.i as describe on the webpage and I het the wrap file as > adverticed. The problem comes when I try to compile the two *.c file > like this. > > gcc -c example.c example_wrap.c -I\c:\python25 > > maybe the -I\c:\python25 is the part that is wrong. Anyways, I get > errors galore. The first is that it can't find the Python.h but there > are so many errors that it cannot hold them on the screen. >
