i'm trying to get borland's free commandline compiler working with a sample module i'm testing with. everything goes fine in the compile, but the linker is giving me the following error: Error: 'D:\PYTHON\LIBS\PYTHON20.LIB' contains invalid OMF record, type 0x21 (possibly COFF) ok, sounds like the python20.lib is incompatible with borland's compiler (??). if so, that seems like a big pain. does anyone have the steps needed to get this compiler working? i've not found any help from the docs or source yet. i'm guessing i'll need to recompile python with borland? (i didn't think that was an option?) perhaps i'm better off going with cygnus or mingw? what is the most common free win32 compiler for use with distutils?
Which distutils version are you using?
i'm trying to get borland's free commandline compiler working with a sample module i'm testing with.
everything goes fine in the compile, but the linker is giving me the following error:
Error: 'D:\PYTHON\LIBS\PYTHON20.LIB' contains invalid OMF record, type 0x21 (possibly COFF)
Just at this moment I'm looking into this issue (currently for MSVC, soon for Borland).
ok, sounds like the python20.lib is incompatible with borland's compiler (??). if so, that seems like a big pain. does anyone have the steps needed to get this compiler working? i've not found any help from the docs or source yet. i'm guessing i'll need to recompile python with borland? (i didn't think that was an option?)
No, bcpp contains an utility to convert OMF to COFF, so you should be able to generate a valid library. The real problem seems to be that distutils currently has problems with library names, so this issue will have to be fixed.
perhaps i'm better off going with cygnus or mingw? what is the most common free win32 compiler for use with distutils?
MSVC (which is the best compiler for win32), can be freely downloaded from MS if you don't care for (very) large downloads. There was a thread yesterday on c.l.p about this. Thomas
No, bcpp contains an utility to convert OMF to COFF, so you should be able to generate a valid library.
As borland compiler user you are required to read the source, since it isn't mentioned anywhere else: def find_library_file (self, dirs, lib, debug=0): # List of effective library names to try, in order of preference: # xxx_bcpp.lib is better than xxx.lib # and xxx_d.lib is better than xxx.lib if debug is set # # The "_bcpp" suffix is to handle a Python installation for people # with multiple compilers (primarily Distutils hackers, I suspect # ;-). The idea is they'd have one static library for each # compiler they care about, since (almost?) every Windows compiler # seems to have a different format for static libraries. if debug: dlib = (lib + "_d") try_names = (dlib + "_bcpp", lib + "_bcpp", dlib, lib) else: try_names = (lib + "_bcpp", lib) for dir in dirs: for name in try_names: libfile = os.path.join(dir, self.library_filename(name)) if os.path.exists(libfile): return libfile else: # Oops, didn't find it in *any* of 'dirs' return None Thomas
On 28 September 2000, Thomas Heller said:
No, bcpp contains an utility to convert OMF to COFF, so you should be able to generate a valid library.
As borland compiler user you are required to read the source, since it isn't mentioned anywhere else:
Thanks for pointing this out. I've just added a skeletal section to the "Installing Python Modules" manual called "Building Extensions: Tips and Tricks". This is where these sort of questions should be answered; feel free to mail me suggestions, patches to the doc, etc. I'll write something up for the non-Microsoft compilers, but I'll need to help to test and fact-check what I write! Greg
Just at this moment I'm looking into this issue (currently for MSVC, soon for Borland).
The real problem seems to be that distutils currently has problems with library names, so this issue will have to be fixed.
perhaps i'm better off going with cygnus or mingw? what is the most common free win32 compiler for use with distutils?
thanks thomas. i found a website with more info. http://www.cyberus.ca/~g_will/pyExtenDL.shtml using all the info garnerd. running a simple command, "coff2omf python20.lib python20_bcpp.lib", has yielded perfect results. i can now do "python setup.py build --c=bcpp" and get perfect PYD files from my extension source. distutils wins again!
MSVC (which is the best compiler for win32), can be freely downloaded from MS if you don't care for (very) large downloads. There was a thread yesterday on c.l.p about this.
good golly, my newsfeed is ugly now, but i'll check for this on deja
participants (3)
-
Greg Ward
-
Pete Shinners
-
Thomas Heller