Win32 Binaries?

Mauro Cicognini mcicogni at
Thu Aug 14 10:22:42 CEST 2003

Michael Ströder wrote:

> Can you please post your old setup.cfg and the one the build went fine 
> with?

I attach the old setup.cfg from PythonLDAP 2.0.0pre04 that used to work 
perfectly. I *had* hacked a little bit then, to make it simple 
to define symbols. BTW, the particular symbol I need is just "WIN32".

However, I could _not_ get it to build this time; I had to resort to a 
"canonical" MSVC project, built by hand using the GUI.

These are the problems I encountered:

   1. There's no way (AFAIK) to simply "define" a preprocessor symbol
      within setup.cfg. The distutils scripts expect to have a list of
      one- or two-element tuples, but the parser has no way to pull
      those from the .cfg. Besides, the one-element tuple means to
      "undefine" the symbol, whereas I'd like to just "define" it
      without giving it a value, which is unnecessary. I managed to
      insert it using a crude hack within (just as I had done
      with the earlier version), but I do not like this solution.
   2. The "HAVE_XXX" symbol definition in is Linux-centric:
      since the libraries under Windows have slightly different names
      (for instance, "olber32" instead of just "lber"), those symbols
      would just not get defined. This however was simple enough to fix.
   3. It appears that any library path under "library_dirs" for some
      reason gets copied over to "runtime_library_dirs", which makes no
      sense to me. This chokes the distutil since the Windows link.exe
      has no notion of a runtime library directory (they are found
      exclusively in the PATH), so the build stops with an exception. I
      am absolutely at a loss to understand the reason of this behavior.
      I hacked (temporarily) the standard to work around
      this just to see what the next problem would be, but this isn't
      obviously an option.
   4. The linker get called without the default libraries, and in such a
      way that a whole lot of symbols are found twice, so it just barfs
      and never links.

After these unsuccessful attempts, I had modified (which could 
be OK) but I had also started changing the default Python library 
scripts, and I'm not comfortable with this. So I pulled up the old MSVC 
project I used for PythonLDAP 1.x, worked on it for a while and got the 
library to compile nicely.

That's it; if anyone has any clue, please let me know.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: setup.cfg
URL: <>

More information about the python-ldap mailing list