freeze and win32com

Thomas Heller thomas.heller at ion-tof.com
Thu May 31 09:20:11 EDT 2001


I'm trying to build a com_dll server with freeze.
Is this supposed to work?

I'm using Python2.0 (BeOpen) for this, and have
PyWin32 checked out from cvs.pythonpros.com.
When trying to compile, I get compiler errors.
See below.
Oh, Win2k SP1, and VC6.

Thomas

-------------------------------------
C:\python20\Tools\freeze>type testCOMserver.py
class HelloWorld:
    _reg_clsid_ = "{B83DD222-7750-413D-A9AD-01B37021B24B}"
    _reg_desc_ = "Python Test COM Server"
    _reg_progid_ = "Python.TestServer"
    _public_methods_ = ['Hello']
    _public_attrs_ = ['softspace', 'noCalls']
    _readonly_attrs_ = ['noCalls']
    def __init__(self):
        self.softspace = 1
        self.noCalls = 0
    # __init__()

    def Hello(self, who):
        self.noCalls = self.noCalls + 1
        # insert "softspace" number of spaces
        return "Hello" + " " * self.softspace + str(who)

if __name__ == '__main__':
    import win32com.server.register
    win32com.server.register.UseCommandLine(HelloWorld)

C:\python20\Tools\freeze>freeze.py -s com_dll testCOMserver.py
(Using Python source directory)

  Name                      File
  ----                      ----
m UserDict                  c:\python20\lib\UserDict.py
m __builtin__
m _sre                      c:\python20\dlls\_sre.pyd
m copy                      c:\python20\lib\copy.py
m copy_reg                  c:\python20\lib\copy_reg.py
m exceptions
m new
m nt
m ntpath                    c:\python20\lib\ntpath.py
m os                        c:\python20\lib\os.py
m pcre
m popen2                    c:\python20\lib\popen2.py
m posixpath                 c:\python20\lib\posixpath.py
m pre                       c:\python20\lib\pre.py
m pythoncom                 C:\WINNT\System32\pythoncom20.dll
m re                        c:\python20\lib\re.py
m repr                      c:\python20\lib\repr.py
m site                      c:\python20\lib\site.py
m sre                       c:\python20\lib\sre.py
m sre_compile               c:\python20\lib\sre_compile.py
m sre_constants             c:\python20\lib\sre_constants.py
m sre_parse                 c:\python20\lib\sre_parse.py
m stat                      c:\python20\lib\stat.py
m string                    c:\python20\lib\string.py
m strop
m sys
m tempfile                  c:\python20\lib\tempfile.py
m testCOMserver             testCOMserver.py
m types                     c:\python20\lib\types.py
m win32api                  c:\python20\win32\win32api.pyd
P win32com                  c:\python20\win32com\__init__.py
P win32com.server           c:\python20\win32com\server\__init__.py
m win32com.server.register  c:\python20\win32com\server\register.py
m win32con                  c:\python20\win32\lib\win32con.py
m winerror                  c:\python20\win32\lib\winerror.py
? pwd from posixpath
? sitecustomize from site

freezing UserDict ...
freezing copy ...
freezing copy_reg ...
freezing ntpath ...
freezing os ...
freezing popen2 ...
freezing posixpath ...
freezing pre ...
freezing re ...
freezing repr ...
freezing site ...
freezing sre ...
freezing sre_compile ...
freezing sre_constants ...
freezing sre_parse ...
freezing stat ...
freezing string ...
freezing tempfile ...
freezing testCOMserver ...
freezing types ...
freezing win32com ...
freezing win32com.server ...
freezing win32com.server.register ...
freezing win32con ...
freezing winerror ...
generating table of frozen modules

C:\python20\Tools\freeze>echo %PYTHONEX%
\PyWin32

C:\python20\Tools\freeze>nmake

Microsoft (R) Program Maintenance Utility   Version 6.00.8168.0
Copyright (C) Microsoft Corp 1988-1998. All rights reserved.

dllmain.cpp
C:\PyWin32\com\win32com\src\dllmain.cpp(73) : error C2491: 'PyCom_LogF' : definition of dllimport function not allowed
C:\PyWin32\com\win32com\src\dllmain.cpp(99) : error C2491: 'PyCom_EnableQuitMessage' : definition of dllimport function not allowed
C:\PyWin32\com\win32com\src\dllmain.cpp(104) : warning C4273: 'PyCom_DLLAddRef' : inconsistent dll linkage.  dllexport assumed.
C:\PyWin32\com\win32com\src\dllmain.cpp(135) : warning C4273: 'PyCom_DLLReleaseRef' : inconsistent dll linkage.  dllexport assumed.
C:\PyWin32\com\win32com\src\dllmain.cpp(250) : warning C4273: 'PyCom_CoInitializeEx' : inconsistent dll linkage.  dllexport assumed.
C:\PyWin32\com\win32com\src\dllmain.cpp(290) : warning C4273: 'PyCom_CoInitialize' : inconsistent dll linkage.  dllexport assumed.
C:\PyWin32\com\win32com\src\dllmain.cpp(320) : warning C4273: 'PyCom_CoUninitialize' : inconsistent dll linkage.  dllexport assumed.
NMAKE : fatal error U1077: 'cl' : return code '0x2'
Stop.






More information about the Python-list mailing list