From: plasenci AT rohan DOT sdsu DOT edu (plasencia) Subject: [Help] Undefined referece to fopen and other Stdlib functions when compileing a dll 20 Jul 1997 19:03:22 -0700 Approved: cygnus DOT gnu-win32 AT cygnus DOT com Distribution: cygnus Message-ID: <199707210121.SAA27257.cygnus.gnu-win32@rohan.sdsu.edu> Content-Type: text Original-To: gnu-win32 AT cygnus DOT com X-Mailer: ELM [version 2.4 PL25] Original-Sender: owner-gnu-win32 AT cygnus DOT com Hi Folks, I have been using GCC for some time now. I have never had any problems with Gcc Cygwin until I tired to compile some source code that was developed using MSVC++4.0. The source code is a Dll. When I create and compile my own Dlls using Cygwin I have no problems. However now that I am trying to compile the MSVC++ code I am gettion all sorts of undefined references to standard lib files. I have a pentium 32MB RAM. Cygwin vew b18 and have the Unix utils setup. Windows95 The source code does compile. I do get my object files. It is durint like time that I get my errors. I am not using a make file, but I am using a Bash srcipt to compile my dll. The script is small and looks like this *******----------------------------------********************** #!/bin/sh INCLUDE="/Gator/Test/IOTEST~1/GCC-DLLs/Include" gcc -c commio.c -I $INCLUDE gcc -c timer.c -I $INCLUDE echo EXPORTS > commioB.def nm commio.o timer.o | grep '^........ [T] _' | sed 's/[^_]*_//' >> commioB.def dlltool --def commioB.def --output-exp commio.exp --output-lib commio.a --dllnam e commio.dll ld -o commio.dll commio.exp commio.o timer.o *******----------------------------------********************** As I said eariler, the code did compile, but during link time I got this errors commio.o(.text+0x885):commio.c: undefined reference to `fprintf' commio.o(.text+0x897):commio.c: undefined reference to `fclose' commio.o(.text+0x91e):commio.c: undefined reference to `fopen' commio.o(.text+0x92d):commio.c: undefined reference to `Sleep AT 4' commio.o(.text+0x93d):commio.c: undefined reference to `GetCommState AT 8' commio.o(.text+0x95b):commio.c: undefined reference to `SetCommState AT 8' commio.o(.text+0x96a):commio.c: undefined reference to `GetCommProperties AT 8' commio.o(.text+0x97d):commio.c: undefined reference to `ClearCommError AT 12' commio.o(.text+0x99a):commio.c: undefined reference to `OutputDebugStringA AT 4' commio.o(.text+0x9bb):commio.c: undefined reference to `WriteFile AT 20' commio.o(.text+0x9f1):commio.c: undefined reference to `fprintf' commio.o(.text+0xa28):commio.c: undefined reference to `fprintf' commio.o(.text+0xa3e):commio.c: undefined reference to `fprintf' commio.o(.text+0xa50):commio.c: undefined reference to `fclose' commio.o(.text+0xa92):commio.c: undefined reference to `fopen' There are alot more, I just wanted to give a sample. It looks to me like the code I not linking to the libaries, but I do not know enough about Cygwin to find out exactly what libs are linked or not. Thanks in advanced -- -- ______________________________________________________________________________ Xavier Plasencia | San Diego State University | Internet : plasenci AT rohan DOT sdsu DOT edu ______________________________________________________________________________ - For help on using this list (especially unsubscribing), send a message to "gnu-win32-request AT cygnus DOT com" with one line of text: "help".