This is the mail archive of the
cygwin@sourceware.cygnus.com
mailing list for the Cygwin project.
[Help] Undefined referece to fopen and other Stdlib functions when compileing a dll
- To: gnu-win32 at cygnus dot com
- Subject: [Help] Undefined referece to fopen and other Stdlib functions when compileing a dll
- From: plasencia <plasenci at rohan dot sdsu dot edu>
- Date: Sun, 20 Jul 1997 18:21:54 -0700 (PDT)
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@4'
commio.o(.text+0x93d):commio.c: undefined reference to `GetCommState@8'
commio.o(.text+0x95b):commio.c: undefined reference to `SetCommState@8'
commio.o(.text+0x96a):commio.c: undefined reference to `GetCommProperties@8'
commio.o(.text+0x97d):commio.c: undefined reference to `ClearCommError@12'
commio.o(.text+0x99a):commio.c: undefined reference to `OutputDebugStringA@4'
commio.o(.text+0x9bb):commio.c: undefined reference to `WriteFile@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@rohan.sdsu.edu
______________________________________________________________________________
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".