Loading ...
Sorry, an error occurred while loading the content.

[Cheetahtemplate-discuss] Compiling _namemapper.c on win32 with MinGW

Expand Messages
  • Jan Werner
    Hi group, since I don t have (and like) VC+, I would like to build _namemapper.c, which is not available in binary form for Python 2.7, with MinGW. I created a
    Message 1 of 2 , Dec 6, 2011
    • 0 Attachment
      Hi group,

      since I don't have (and like) VC+, I would like to build _namemapper.c, which is not available in binary form for Python 2.7, with MinGW. 

      I created a simple compile script:

      ======
      from distutils.core import setup, Extension

      module1 = Extension('namemapper', sources = ['cheetah/c/_namemapper.c'])

      setup (name = 'namemapper',
              version = '1.0',
              description = 'Namemapper C Version',
              ext_modules = [module1])
      ======

      When trying to compile with 

      python nm.py build -cmingw32

      I get the following output:

      ======
      $ python nm.py build -cmingw32
      running build
      running build_ext
      building 'namemapper' extension
      d:\MinGW\bin\gcc.exe -mdll -O -Wall -Id:\tools2\python\include -Id:\tools2\python\PC -c cheetah/c/_namemapper.c -o build\temp.win32-2.7\Release\cheetah\c\_namemapper.o
      writing build\temp.win32-2.7\Release\cheetah\c\namemapper.def
      d:\MinGW\bin\gcc.exe -shared -s build\temp.win32-2.7\Release\cheetah\c\_namemapper.o build\temp.win32-2.7\Release\cheetah\c\namemapper.def -Ld:\tools2\python\libs -Ld:\tools2\python\PCbuild -lpython27 -lmsvcr90 -o build\lib.win32-2.7\namema
      pper.pyd
      Cannot export initnamemapper: symbol not defined
      collect2: ld returned 1 exit status
      error: command 'gcc' failed with exit status 1


      Could someone give me a hint as to what I'm doing wrong?

      Thanks
      Jan
    • Franz Glasner
      The name of the C extension module is probably _namemapper (with an underscore) instead of namemapper . Best regards Franz. ... Cloud Services Checklist:
      Message 2 of 2 , Dec 8, 2011
      • 0 Attachment
        The name of the C extension module is probably "_namemapper" (with an
        underscore) instead of "namemapper".

        Best regards
        Franz.

        >
        > module1 = Extension('namemapper', sources = ['cheetah/c/_namemapper.c'])
        >
        > setup (name = 'namemapper',
        > version = '1.0',
        > description = 'Namemapper C Version',
        > ext_modules = [module1])


        ------------------------------------------------------------------------------
        Cloud Services Checklist: Pricing and Packaging Optimization
        This white paper is intended to serve as a reference, checklist and point of
        discussion for anyone considering optimizing the pricing and packaging model
        of a cloud services business. Read Now!
        http://www.accelacomm.com/jaw/sfnl/114/51491232/
        _______________________________________________
        Cheetahtemplate-discuss mailing list
        Cheetahtemplate-discuss@...
        https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss
      Your message has been successfully submitted and would be delivered to recipients shortly.