From: <dan...@ya...> - 2001-06-16 00:06:05
|
> > My big problem is that I can't link if I have any functions from > libgdi32.a. I have > tried explicitly specifying that library, and also use nm to analyse, > but I'm still > stuck. Details below. Order is important - see below. > > I have another niggle in that my app does not seem to quite be a > proper windows app. > - If I start it from "Start, Run..", then it launches a dos prompt as > well as my window > - If I kill the window, the program running in the dos prompt keeps > on going until I C-C. > > Please copy me direct on any replies, as I am not yet subscribed to > the mailing list. > > Many thanks, > Adam > > > > Compile commands > ---------------- > > (wmain.c attached, but it is not very interesting.) > > 1) Command that I can use to compile and link. > gcc -lgdi32 wmain.c -o wmain.exe Put libs at end gcc wmain.c -o wmain.exe -lgdi32 Or gcc -mwindows -o wmain.exe wmain.c The -mwindows tells gcc that it is a windows app (passes --subsystem windows flag to ld) and to link against windows GUI libs (-lgdi32 -lcomdlg32) In your case the --subsystem windows flags may cause problems because printf wants to print to stdout. Danny _____________________________________________________________________________ http://messenger.yahoo.com.au - Yahoo! Messenger - Voice chat, mail alerts, stock quotes and favourite news and lots more! |