Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com Date: Fri, 10 Nov 2000 09:22:18 -0500 From: Jason Tishler To: Mitsuo Igarashi Cc: cygwin AT sources DOT redhat DOT com Subject: Re: How to make an extension of Python Message-ID: <20001110092218.A183@dothill.com> References: <000b01c04ae9$21360e40$f06afea9 AT mitsu5> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <000b01c04ae9$21360e40$f06afea9@mitsu5>; from mitsu5@ruby.famille.ne.jp on Fri, Nov 10, 2000 at 04:37:09PM +0900 Organization: Dot Hill Systems Corp. Mitsuo, On Fri, Nov 10, 2000 at 04:37:09PM +0900, Mitsuo Igarashi wrote: > |> dllwrap -o myEnviron.pyd -def myEnviron.def myEnviron.o -lpython2.0 > |> "Importerror: dynamic modules does not define init > |> function ( initmyEnviron)". > | > |My guess is for some reason initmyEnviron is not being exported from > |myEnviron.pyd. What is the contents of your myEnviron.def file? > > > EXPORTS > initenviron Your myEnviron.def file should be the following: EXPORTS initmyEnviron and myEnviron.c should define the corresponding function: void initmyEnviron() { ... } You can use also use: DL_EXPORT(void) initmyEnviron() { ... } and then you shouldn't need the def file. Python requires that your init function match your module name as follows: If you have a module named "foo", then your init function must be named "initfoo". > |Were you importing the above module into the Win32 or Cygwin Python? > > cygwin python > > This failure is probably the bad -lpython2.0. > "libpython2.0.a" is not shared? Yes, but libpython2.0.a is not "bad" is it just static. You will have all kinds of problems trying to building shared extensions if you link with the static library. This is the main reason for my patch. Jason -- Jason Tishler Director, Software Engineering Phone: +1 (732) 264-8770 x235 Dot Hill Systems Corporation Fax: +1 (732) 264-8798 82 Bethany Road, Suite 7 Email: Jason DOT Tishler AT dothill DOT com Hazlet, NJ 07730 USA WWW: http://www.dothill.com -- Want to unsubscribe from this list? Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com