delorie.com/archives/browse.cgi | search |
Mailing-List: | contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm |
List-Subscribe: | <mailto:cygwin-subscribe AT sources DOT redhat DOT com> |
List-Archive: | <http://sources.redhat.com/ml/cygwin/> |
List-Post: | <mailto:cygwin AT sources DOT redhat DOT com> |
List-Help: | <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs> |
Sender: | cygwin-owner AT sources DOT redhat DOT com |
Delivered-To: | mailing list cygwin AT sources DOT redhat DOT com |
Message-ID: | <003e01c04c50$58ab7460$8819fea9@mitsu5> |
From: | "Mitsuo Igarashi" <mitsu5 AT ruby DOT famille DOT ne DOT jp> |
To: | <cygwin AT sources DOT redhat DOT com> |
Subject: | RE: How to make an extension of Python |
Date: | Sun, 12 Nov 2000 11:29:04 +0900 |
MIME-Version: | 1.0 |
X-Priority: | 3 |
X-MSMail-Priority: | Normal |
X-Mailer: | Microsoft Outlook Express 4.72.3110.5 |
X-MimeOLE: | Produced By Microsoft MimeOLE V4.72.3110.3 |
|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. At last, I have succeeded in getting "environ.dll" working fine. From your patched Python-2.0, I modified the script of "Demo/extend/make_shared"to adapt "environ.c". Then I could build "environ.dll" very easily. I am wondering what and how is the mechanism of the patch. I hope the patch script of Python for cygwin is always on at http://www.python.org for the every new version of Python. Thank you so much your taking care of me. ----------=========--------- Mitsuo Igarashi mitsu5 AT ruby DOT famille DOT ne DOT jp -- Want to unsubscribe from this list? Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |