public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Problems linking WinAPI calls
@ 1999-09-22  7:21 Svensson, Paul
  1999-09-30 23:42 ` Svensson, Paul
  0 siblings, 1 reply; 2+ messages in thread
From: Svensson, Paul @ 1999-09-22  7:21 UTC (permalink / raw)
  To: 'cygwin@sourceware.cygnus.com'

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@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Problems linking WinAPI calls
  1999-09-22  7:21 Problems linking WinAPI calls Svensson, Paul
@ 1999-09-30 23:42 ` Svensson, Paul
  0 siblings, 0 replies; 2+ messages in thread
From: Svensson, Paul @ 1999-09-30 23:42 UTC (permalink / raw)
  To: 'cygwin@sourceware.cygnus.com'

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@sourceware.cygnus.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1999-09-30 23:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-09-22  7:21 Problems linking WinAPI calls Svensson, Paul
1999-09-30 23:42 ` Svensson, Paul

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).