mingw32 problem

Francisco Dos Santos <[email protected]> Tue, 25 Oct 2011 13:19:21 +0000
Newsgroups gmane.comp.python.sybase
Message-ID <[email protected]>
--===============7005985835964057345==
Content-Type: multipart/alternative;
	boundary="_17eff5a3-a67a-4590-9ea8-fc97447dbca9_"

--_17eff5a3-a67a-4590-9ea8-fc97447dbca9_
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable


From: dikshie <dikshie@gm...> - 2011-08-17 11:57

>Hi=2C
>I got this error message when compile python-sybase with mingw32.
>
>"-LC:\Program Files\Python27\PCbuild" -lblk -lct -lcs -lpython27
>-lmsvcr90 -o bu ild\lib.win32-2.7\sybasect.pyd
>//mfauzie1$/personal/mingw/bin/../lib/gcc/mingw32/4.5.2/../../../../mingw3=
2/bin/ld.exe: cannot find -lblk
>//mfauzie1$/personal/mingw/bin/../lib/gcc/mingw32/4.5.2/../../../../mingw3=
2/bin/ld.exe: cannot find -lct
>//mfauzie1$/personal/mingw/bin/../lib/gcc/mingw32/4.5.2/../../../../mingw3=
2/bin/ld.exe: cannot find -lcs
>collect2: ld returned 1 exit status
>error: command 'gcc' failed with exit status 1

>I tried with
> syb_libs =3D ['libblk'=2C 'libct'=2C 'libcs']
>and
> syb_libs =3D ['blk'=2C 'ct'=2C 'cs']
>get same error messages.
>I am using python-sybase-0.40pre1.tar.gz on windows xp.


Here my quick and dirty hack to build python-sybase-0.40pre1 with mingw32 f=
or Sybase OCS-15_0 and Python 2.7.2 on windows 7 :-)

1) Make mingw the default compiler.
In your Python installation directory change in Lib\distutils\ccompiler.py =
(tuple _default_compilers around line 952)
  # OS name mappings
  ('nt'=2C 'mingw32')

2) The sybase library name have changed to avoid possible name conflict=2C =
they have a syb prefixe in their name.
In python-sybase-0.40 directory change the setup.py file (line 110)
  syb_libs =3D ['libsybblk'=2C 'libsybct'=2C 'libsybcs']

3) Now the compilation work but link fails with unresolved symbol=2C I must=
 add the sybase dll directory for setup.py to work.
I made a dirty change on setup.py=2C there's probably a better and more ele=
gant solution but it works for me =3B-)

I added line 124 a new directory variable :
  syb_dlldir =3D os.path.join(sybase=2C 'dll')

And I changed near the end (line 267) and added this variable :
  library_dirs=3D[syb_libdir=2C syb_dlldir]=2C


Hope that's will help others.

Francisco.
 		 	   		  =

--_17eff5a3-a67a-4590-9ea8-fc97447dbca9_
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<html>
<head>
<style><!--
.hmmessage P
{
margin:0px=3B
padding:0px
}
body.hmmessage
{
font-size: 10pt=3B
font-family:Tahoma
}
--></style>
</head>
<body class=3D'hmmessage'><div dir=3D'ltr'>
<pre>From: dikshie &lt=3Bdikshie@gm...&gt=3B - 2011-08-17 11:57
<br>&gt=3BHi=2C
&gt=3BI got this error message when compile python-sybase with mingw32.
&gt=3B
&gt=3B"-LC:\Program Files\Python27\PCbuild" -lblk -lct -lcs -lpython27
&gt=3B-lmsvcr90 -o bu ild\lib.win32-2.7\sybasect.pyd
&gt=3B//mfauzie1$/personal/mingw/bin/../lib/gcc/mingw32/4.5.2/../../../../m=
ingw32/bin/ld.exe: cannot find -lblk
&gt=3B//mfauzie1$/personal/mingw/bin/../lib/gcc/mingw32/4.5.2/../../../../m=
ingw32/bin/ld.exe: cannot find -lct
&gt=3B//mfauzie1$/personal/mingw/bin/../lib/gcc/mingw32/4.5.2/../../../../m=
ingw32/bin/ld.exe: cannot find -lcs
&gt=3Bcollect2: ld returned 1 exit status
&gt=3Berror: command 'gcc' failed with exit status 1

&gt=3BI tried with
&gt=3B syb_libs =3D ['libblk'=2C 'libct'=2C 'libcs']
&gt=3Band
&gt=3B syb_libs =3D ['blk'=2C 'ct'=2C 'cs']
&gt=3Bget same error messages.
&gt=3BI am using python-sybase-0.40pre1.tar.gz on windows xp.

<br>Here my quick and dirty hack to build python-sybase-0.40pre1 with mingw=
32 for Sybase OCS-15_0 and Python 2.7.2 on windows 7 :-)<br><br>1) Make min=
gw the default compiler.<br>In your Python installation directory change in=
 Lib\distutils\ccompiler.py (tuple _default_compilers around line 952)<br> =
 # OS name mappings<br>  ('nt'=2C 'mingw32')<br><br>2) The sybase library n=
ame have changed to avoid possible name conflict=2C they have a syb prefixe=
 in their name.<br>In python-sybase-0.40 directory change the setup.py file=
 (line 110)<br>  syb_libs =3D ['libsybblk'=2C 'libsybct'=2C 'libsybcs']<br>=
<br>3) Now the compilation work but link fails with unresolved symbol=2C I =
must add the sybase dll directory for setup.py to work.<br>I made a dirty c=
hange on setup.py=2C there's probably a better and more elegant solution bu=
t it works for me =3B-)<br><br>I added line 124 a new directory variable :<=
br>  syb_dlldir =3D os.path.join(sybase=2C 'dll')<br><br>And I changed near=
 the end (line 267) and added this variable :<br>  library_dirs=3D[syb_libd=
ir=2C syb_dlldir]=2C<br>
<br>Hope that's will help others.<br><br>Francisco.<br></pre> 		 	   		  </=
div></body>
</html>=

--_17eff5a3-a67a-4590-9ea8-fc97447dbca9_--


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

------------------------------------------------------------------------------
The demand for IT networking professionals continues to grow, and the
demand for specialized networking skills is growing even more rapidly.
Take a complimentary Learning@Cisco Self-Assessment and learn 
about Cisco certifications, training, and career opportunities. 
http://p.sf.net/sfu/cisco-dev2dev
--===============7005985835964057345==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Python-sybase-misc mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/python-sybase-misc

--===============7005985835964057345==--