www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1999/09/22/10:22:32

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT sourceware DOT cygnus DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT sourceware DOT cygnus DOT com>
List-Archive: <http://sourceware.cygnus.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sourceware DOT cygnus DOT com>
List-Help: <mailto:cygwin-help AT sourceware DOT cygnus DOT com>, <http://sourceware.cygnus.com/ml/#faqs>
Sender: cygwin-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com
Message-ID: <EB56304A310DD211856600805FF560D3900CEF@njmtlnt02.mfsts.com>
From: "Svensson, Paul" <psvensso AT MFSTS DOT com>
To: "'cygwin AT sourceware DOT cygnus DOT com'" <cygwin AT sourceware DOT cygnus DOT com>
Subject: Problems linking WinAPI calls
Date: Wed, 22 Sep 1999 10:19:46 -0400
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2448.0)

I'm trying to port a medium-sized project over from Unix to NT, and have so
far
managed to compile with Cygwin; the next step being to replace
Cygwin-specific
calls in the code with the corresponding native NT code.  However, when
trying
to do this, the linker can't find any of the Windows functions. As far as I
can understand the documentation at the Cygwin web page, the code below
should
work, and I have also tried various combinations of -mwindows, -lkernel32,
etc,
without improving anything.  What confuses me is that the sql libs I built
myself, from the .LIB files shipped with oracle, work perfectly fine, while
the
kernel32.a shipped with Cygwin does not.  Doing an nm on the files, I see
that
the kernel32.dll has names with @NN appended (varying NN), which the sql
libs
don't. This seems significant, but I can't figure out how to convince the
linker
to find the right stuff.  I wanted to try to build my own kernel32.a from
the
system KERNEL32.LIB, but running nm on that fails after a few lines, with
nm: KERNEL32.dll: File format not recognized.  Right now, I'm stumped.  Any
pointers, workarounds, or ideas where to look for more information would be
greatly appreciated.
----------------------------------------------------------------------------
----
gcc -ansi -pedantic -Wall -Wunused -Wstrict-prototypes -Wpointer-arith \
	-Wwrite-strings -Wmissing-declarations -Wnested-externs \
	-finline-functions -fstrength-reduce -g  -o \ 
	/usr/src/plaza/build/bin/filerd.exe \
	/usr/src/plaza/build/obj/filerd/def.o \
	/usr/src/plaza/build/obj/filerd/main.o \
	/usr/src/plaza/build/obj/filerd/param.o \
	/usr/src/plaza/build/obj/filerd/poll.o \
	/usr/src/plaza/build/obj/filerd/timestamp.o \
	/usr/src/plaza/build/obj/filerd/writefile.o  \
	/usr/src/plaza/build/lib/sqllib80.a
/usr/src/plaza/build/lib/sqxlib80.a \
	/usr/src/plaza/build/lib/libplaza.a -lcygipc

/usr/src/plaza/build/obj/filerd/main.o: In function `main':
/usr/src/plaza/src/filerd/main.c:100: undefined reference to `OpenFile'
/usr/src/plaza/build/lib/libplaza.a(shm.o): In function `attach_shm':
/usr/src/plaza/src/libplaza/shm.c:48: undefined reference to
`CreateFileForMapping'
/usr/src/plaza/src/libplaza/shm.c:57: undefined reference to `GetLastError'
/usr/src/plaza/src/libplaza/shm.c:59: undefined reference to
`CreateFileMappingA'
/usr/src/plaza/src/libplaza/shm.c:62: undefined reference to `CloseHandle'
/usr/src/plaza/src/libplaza/shm.c:66: undefined reference to `MapViewOfFile'
/usr/src/plaza/src/libplaza/shm.c:69: undefined reference to `CloseHandle'
/usr/src/plaza/src/libplaza/shm.c:70: undefined reference to `CloseHandle'
collect2: ld returned 1 exit status
----------------------------------------------------------------------------
----

	/Paul


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019