Compiling _namemapper.c on win32 with MinGW

Jan Werner <[email protected]> Tue, 6 Dec 2011 22:22:17 +0100
Newsgroups gmane.comp.python.cheetah
Message-ID <CAExgHD=xvqhPqcAn_Y+PMHcT8bc_txMXApEBiG-qWd664QSu9w@mail.gmail.com>
--===============6308227826643830077==
Content-Type: multipart/alternative; boundary=bcaec544ecfea4b63e04b3730789

--bcaec544ecfea4b63e04b3730789
Content-Type: text/plain; charset=ISO-8859-1

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

--bcaec544ecfea4b63e04b3730789
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Hi group,<div><br></div><div>since I don&#39;t have (and like) VC+, I would=
 like to build=A0_namemapper.c, which is not available in binary form for P=
ython 2.7, with MinGW.=A0</div><div><br></div><div>I created a simple compi=
le script:</div>
<div><br></div><div>=3D=3D=3D=3D=3D=3D</div><div><div>from distutils.core i=
mport setup, Extension</div><div><br></div><div>module1 =3D Extension(&#39;=
namemapper&#39;, sources =3D [&#39;cheetah/c/_namemapper.c&#39;])</div><div=
><br></div><div>
setup (name =3D &#39;namemapper&#39;,</div><div>=A0 =A0 =A0 =A0 version =3D=
 &#39;1.0&#39;,</div><div>=A0 =A0 =A0 =A0 description =3D &#39;Namemapper C=
 Version&#39;,</div><div>=A0 =A0 =A0 =A0 ext_modules =3D [module1])</div></=
div><div>=3D=3D=3D=3D=3D=3D</div><div><br>
</div><div>When trying to compile with=A0</div><div><br></div><div>python n=
m.py build -cmingw32</div><div><br></div><div>I get the following output:</=
div><div><br></div><div>=3D=3D=3D=3D=3D=3D</div><div><div>$ python nm.py bu=
ild -cmingw32</div>
<div>running build</div><div>running build_ext</div><div>building &#39;name=
mapper&#39; extension</div><div>d:\MinGW\bin\gcc.exe -mdll -O -Wall -Id:\to=
ols2\python\include -Id:\tools2\python\PC -c cheetah/c/_namemapper.c -o bui=
ld\temp.win32-2.7\Release\cheetah\c\_namemapper.o</div>
<div>writing build\temp.win32-2.7\Release\cheetah\c\namemapper.def</div><di=
v>d:\MinGW\bin\gcc.exe -shared -s build\temp.win32-2.7\Release\cheetah\c\_n=
amemapper.o build\temp.win32-2.7\Release\cheetah\c\namemapper.def -Ld:\tool=
s2\python\libs -Ld:\tools2\python\PCbuild -lpython27 -lmsvcr90 -o build\lib=
.win32-2.7\namema</div>
<div>pper.pyd</div><div>Cannot export initnamemapper: symbol not defined</d=
iv><div>collect2: ld returned 1 exit status</div><div>error: command &#39;g=
cc&#39; failed with exit status 1</div></div><div><br></div><div><br></div>
<div>Could someone give me a hint as to what I&#39;m doing wrong?</div><div=
><br></div><div>Thanks</div><div>Jan</div>

--bcaec544ecfea4b63e04b3730789--


--===============6308227826643830077==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

------------------------------------------------------------------------------
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/
--===============6308227826643830077==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Cheetahtemplate-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss

--===============6308227826643830077==--