more information on my problem

Kurt Häusler turtill@ihug.co.nz
Wed Dec 17 17:43:00 GMT 1997


This is in regard to being able to compile console apps fine but not a
program using the win32 api.  I have attached the source file.
This is my command line:
gcc -o hellowin.exe hellowin.c

And this is compiler output stuff like:

<similar lines trimmed>

C:\WINDOWS\TEMP\cc0010611.o(.text+0x13f):hellowin.c: undefined reference to
`BeginPaint@8'
C:\WINDOWS\TEMP\cc0010611.o(.text+0x151):hellowin.c: undefined reference to
`GetClientRect@8'
C:\WINDOWS\TEMP\cc0010611.o(.text+0x167):hellowin.c: undefined reference to
`DrawTextA@20'
C:\WINDOWS\TEMP\cc0010611.o(.text+0x174):hellowin.c: undefined reference to
`EndPaint@8'
C:\WINDOWS\TEMP\cc0010611.o(.text+0x17f):hellowin.c: undefined reference to
`PostQuitMessage@4'
C:\WINDOWS\TEMP\cc0010611.o(.text+0x199):hellowin.c: undefined reference to
`DefWindowProcA@16'
gcc: Internal compiler error: program ld got fatal signal 1

Three people tried to help by pointing to various sites etc.  that I have
already read and understand but don't cover my problem.  They seem to be
only concerned with writing UNIX style console apps (but how many of them
need to be written for a GUI like windows?).

One person suggested explicitly linking libraries in this manner :

gcc -o hello.exe hello.c -lwin32 -Wl,-subsystem,windows

But it says Wl,-subsystem,windows is an undefined flag.  (I cant find it
anywhere on the docs either)

Someone said adding -lkernal32 -luser32 but the compiler says:

file -lkernal32 not found which looks as though its not recognizing the -l
flag!!

I have set up all the paths and environment vars correctly.  Please help . I
like the idea of the Cygnus project and I want to give it a fair go before I
give up and move on to paying for Visual C++

Thanks a lot

Kurt


-------------- next part --------------
A non-text attachment was scrubbed...
Name: Hellowin.c
Type: text/x-c
Size: 2743 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/19971217/5b4bf4ba/attachment.bin>


More information about the Cygwin mailing list