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: Tue, 25 Sep 2001 15:42:05 -0600 From: "Darrell R. Hougen" Subject: Problem building python extensions To: cygwin AT cygwin DOT com Cc: darrell DOT r DOT hougen AT lmco DOT com Message-id: <3BB0FA2D.D928DA51@lmco.com> Organization: Myself MIME-version: 1.0 X-Mailer: Mozilla 4.76 [en] (WinNT; U) Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7BIT X-Accept-Language: en Hi, I'm new to using cygwin to build python extension modules and am having a fair bit of trouble. I can build the extension module under Solaris, but when I try to build under cygwin, I get the following errors: gcc -s -Wl,--base-file,Term.base -o Term.dll Term.o -Wl,-e,_Term_init AT 12 /cygdrive/c/ENT/APPL/PROD/Python21/libs/*.lib Term.o: In function `TermObject_Evaluate': /...path.../Term.c:195: undefined reference to `PyExc_RuntimeError' Term.o: In function `TermObject_Gradient': /...path.../Term.c:266: undefined reference to `PyExc_RuntimeError' Term.o: In function `Term_init': /...path.../Term.c:505: undefined reference to `PyCObject_Type' Term.o: In function `TermSetParameters': /...path.../Term.c:29: undefined reference to `PyType_Type' /usr/lib/libcygwin.a(libcmain.o): In function `main': /cygnus/netrel/src/cygwin-1.3.3-2/winsup/cygwin/lib/libcmain.c:31: undefined reference to `WinMain AT 16' collect2: ld returned 1 exit status make: *** [Term.dll] Error 1 The funny looking gcc line at the top is copied straight out of the cygwin documentation for building dlls. When I look for PyExc_RuntimeError, PyCObject_Type and PyType_Type, I can't find a definition of them anywhere. They are declared but not defined. Yet, the code compiles unders Solaris. Actually, I'm wondering why linker is attempting to link the code at all. It appears to me that a .dll file or a .a file under windows ought be be similar to a .so under Solaris, i.e., it should be a library that does indeed have some undefined symbols. But cygwin's gcc isn't allowing me to have undefined symbols. I'm guessing that python somehow takes care of the undefined symbols at the moment it dynamically links the library. But I'm not getting that far. BTW, what does the -s option to gcc do? It doesn't seem to be documented. I am using active state python 2.1 and gcc 2.95.3-5 on an NT 4.0 box. I downloaded the version of cygwin that I'm using only yesterday, so it should be up to date. Thanks. Darrell -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/