Extensions with LCC

Kimmo Pääkkönen Kimmo.Paakkonen at helsinki.fi
Mon Oct 30 08:59:56 EST 2000


  Hi,
  I'm new to Python, so these questions may be trivial or some basics
may be not well understood (at least I feel puzzled enough :).
  I'm trying to compile an extension to the Python. I'm working on
Windows NT and as a compiler I use (freely available) LCC compiler,

http://www.cs.virginia.edu/~lcc-win32/index.html

After making tensormodule.c file by using python api, I tried to compile
it but got these error messages:
Error tensormodule.c 89 undefined reference to __imp__Py_InitModule4
Error tensormodule.c 78 undefined reference to __imp__Py_BuildValue
Error tensormodule.c 41 undefined reference to __imp__PyFloat_AsDouble
etc..
It gives me error messages for all the python C api commands. It does
find the python.h file, but I guess I would need to tell it which
library to link it with? I tried giving include paths to python/include
directories etc without success, and tried even bring some source files
from python sources to my project, but got just more, different errors.

I also tried out using GCC/mingw32 compiler, as I found instructions of
how to use it to make extensions, but I got error message of

ImportError: Module use of python15.dll conflicts with this version of
Python

when I tried to run my python program. With the instructions there was
modified header files for the python, so I doubt they would work with
version 2.0 (but I haven't tried it yet).

Unfortunately I don't have Visual Studio, so I can't use the "cookbook
approach". Is there any detailed instructions somewhere how you do
things with other compilers?
For example, I'm still confused if I do need source code or not, as the
GCC/Mingw32 instructions worked without them (but it had libpython15.a
file with it, and the modified header files). I would prefer LCC as it
is the compiler I'm most familiar with. Any help appreciated!

                Kimmo Pääkkönen
                Kimmo.Paakkonen at helsinki.fi





More information about the Python-list mailing list