Newsgroup: it.comp.programmare.win32
Titolo: Non riesco a compilare questo piccolo programma.

Non riesco a compilare correttamente il programmino "tmp.c" che metto
in coda al messaggio. Si tratta di un banale programma che dovrebbe
soltanto generare una finestra Windows95 e disegnare un semplice
ellisse al suo interno.
Pero' quando faccio la compilazione con Egcs 1.1.1 (per win32) ottengo
la sfilza di errori che riporto qui sotto. 
Qualcuno sa dirmi quale e' l'errore?
Ringrazio fin d'ora.
-------------------------------------------------------------
C:\EGCS-1.1.1>gcc -g tmp.c -o tmp.exe
C:\WINDOWS\TEMP\cc1407fb.o: In function `WinMain':
//C/EGCS-1.1.1/tmp.c:19: undefined reference to `LoadCursorA@8'
//C/EGCS-1.1.1/tmp.c:22: undefined reference to `GetStockObject@4'
//C/EGCS-1.1.1/tmp.c:27: undefined reference to `RegisterClassA@4'
//C/EGCS-1.1.1/tmp.c:30: undefined reference to `CreateWindowExA@48'
//C/EGCS-1.1.1/tmp.c:35: undefined reference to `ShowWindow@8'
//C/EGCS-1.1.1/tmp.c:36: undefined reference to `UpdateWindow@4'
//C/EGCS-1.1.1/tmp.c:37: undefined reference to `GetMessageA@16'
//C/EGCS-1.1.1/tmp.c:38: undefined reference to `TranslateMessage@4'
//C/EGCS-1.1.1/tmp.c:39: undefined reference to `DispatchMessageA@4'
C:\WINDOWS\TEMP\cc1407fb.o: In function `WndProc':
//C/EGCS-1.1.1/tmp.c:54: undefined reference to `BeginPaint@8'
//C/EGCS-1.1.1/tmp.c:57: undefined reference to `Ellipse@20'
//C/EGCS-1.1.1/tmp.c:58: undefined reference to `TextOutA@20'
//C/EGCS-1.1.1/tmp.c:61: undefined reference to `ValidateRect@8'
//C/EGCS-1.1.1/tmp.c:62: undefined reference to `EndPaint@8'
//C/EGCS-1.1.1/tmp.c:66: undefined reference to `PostQuitMessage@4'
//C/EGCS-1.1.1/tmp.c:70: undefined reference to `DefWindowProcA@16'
C:\EGCS-1.1.1>
-------------------------------------------------------------
-------------------------------------------------------------
//File: tmp.c
//
#include <windows.h>
LRESULT CALLBACK WndProc(HWND,UINT,WPARAM,LPARAM);
char szProgName[]="ProgName";
int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPreInst, LPSTR
lpszCmdLine, int nCmdShow)
{
   HWND hWnd;
   MSG lpMsg;
   WNDCLASS wcApp;
   wcApp.lpszClassName=szProgName;
   wcApp.hInstance=hInst;
   wcApp.lpfnWndProc=WndProc;
   wcApp.hCursor=LoadCursor(NULL,IDC_ARROW);
   wcApp.hIcon=0;
   wcApp.lpszMenuName=0;
   wcApp.hbrBackground=GetStockObject(WHITE_BRUSH);
   wcApp.style=CS_HREDRAW|CS_VREDRAW;
   wcApp.cbClsExtra=0;
   wcApp.cbWndExtra=0;
   if(!RegisterClass(&wcApp))
      return 0;
   hWnd=CreateWindow(szProgName,"Un modello",
      WS_OVERLAPPEDWINDOW,CW_USEDEFAULT,
      CW_USEDEFAULT,CW_USEDEFAULT,
      CW_USEDEFAULT,(HWND)NULL,(HMENU)NULL,
      (HANDLE)hInst,(LPSTR)NULL);
   ShowWindow(hWnd,nCmdShow);
   UpdateWindow(hWnd);
   while(GetMessage(&lpMsg,NULL,0,0)){
      TranslateMessage(&lpMsg);
      DispatchMessage(&lpMsg);
   }
   return(lpMsg.wParam);
}
LRESULT CALLBACK WndProc(HWND hWnd, UINT messg, WPARAM wParam, LPARAM
lParam)
{
   HDC hdc;
   PAINTSTRUCT ps;
   switch(messg)
   {
      case WM_PAINT:
	hdc=BeginPaint(hWnd,&ps);
//---- Inserire qui la routine ----
	Ellipse(hdc,100,100,300,300);
	TextOut(hdc,350,200,"<- Un cerchio",13);	
//---- Qui sopra la routine ----
         ValidateRect(hWnd,NULL);
         EndPaint(hWnd, &ps);
         break;
      case WM_DESTROY:
         PostQuitMessage(0);
         break;
      default:
         return(DefWindowProc(hWnd, messg, wParam, lParam));
   }
}
-------------------------------------------------------------
      Mangiafuoco

...

Da quanto ne so non hai linkato i runtime...
