This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

EGCS Mingw32 1.0.2 - compilation problem - undefined reference to a function


hey!

I wrote a small win95 program,that simply does nothing.I wanted to compile
it with egcs (mingw32 native,1.0.2) with command " gcc w.c -o w.exe ".

This is the program source code :

#include <windows.h>

LRESULT CALLBACK 
MainWind (HWND hwnd,UINT smsg,WPARAM wparam,LPARAM lparam)
           { 
            DefWindowProc(hwnd,smsg,,lparam,wparam);
           }; 

int WINAPI 
WinMain (HINSTANCE hInstance,HINSTANCE hPrevInstance,PSTR CommandLIne,
         int Showmode)
{
 HWND hwnd ;      
 MSG  msg  ;
 char AppName[] = "Plum";

 WNDCLASSEX klasa_okna ;  
 klasa_okna.cbSize  = sizeof(klasa_okna) ;
 klasa_okna.style   = CS_HREDRAW | CS_VREDRAW ;
 klasa_okna.lpfnWndProc = MainWind;
 klasa_okna.cbClsExtra = 0 ;
 klasa_okna.cbWndExtra = 0 ;
 klasa_okna.hInstance = hInstance ;
 klasa_okna.hIcon   = LoadIcon(NULL,IDI_APPLICATION);
 klasa_okna.hIconSm = LoadIcon(NULL,IDI_APPLICATION);
 klasa_okna.hCursor = LoadCursor(NULL,IDC_ARROW);
 klasa_okna.hbrBackground = GetStockObject (WHITE_BRUSH);
 klasa_okna.lpszMenuName = NULL ;
 klasa_okna.lpszClassName = AppName ;

 RegisterClassEx (&klasa_okna) ;
 hwnd=CreateWindow(AppName,"Donothing",WS_OVERLAPPED,CW_USEDEFAULT,
      CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,NULL,NULL,hInstance,NULL);

 ShowWindow (hwnd,SW_SHOWNORMAL);
 UpdateWindow (hwnd);

 while ( GetMessage(&msg,NULL,0,0) != 0 )
       {
        TranslateMessage(&msg);
        DispatchMessage(&msg);
       };
 return msg.wParam; */
}

The result of the compilation is less or more like that :

C:\WINDOWS\TEMP\cc9707771.o(.text+0x74):w.c: undefined reference to `LoadI
6 52p
'
C:\WINDOWS\TEMP\cc9707771.o(.text+0x85):w.c: undefined reference to
`LoadIconA@8
'
C:\WINDOWS\TEMP\cc9707771.o(.text+0x96):w.c: undefined reference to
`LoadCursorA
@8'
C:\WINDOWS\TEMP\cc9707771.o(.text+0xa2):w.c: undefined reference to
`GetStockObj
ect@4'
C:\WINDOWS\TEMP\cc9707771.o(.text+0xbd):w.c: undefined reference to
`RegisterCla
ssExA@4'
C:\WINDOWS\TEMP\cc9707771.o(.text+0xed):w.c: undefined reference to
`CreateWindo
wExA@48'
C:\WINDOWS\TEMP\cc9707771.o(.text+0xfd):w.c: undefined reference to
`ShowWindow@
8'
C:\WINDOWS\TEMP\cc9707771.o(.text+0x106):w.c: undefined reference to
`UpdateWind
ow@4'
C:\WINDOWS\TEMP\cc9707771.o(.text+0x115):w.c: undefined reference to
`GetMessage
A@16'
C:\WINDOWS\TEMP\cc9707771.o(.text+0x127):w.c: undefined reference to
`TranslateM
essage@4'
C:\WINDOWS\TEMP\cc9707771.o(.text+0x130):w.c: undefined reference to
`DispatchMe
ssageA@4'

That's strange for me. The windows.h is included correctly,as there is no
error msg for e.g. WNDCLASSEX struct.
What am i to do then ?

and second question : is there gdb for egcs,and where can i find it?



/greetz
Nikki (aka Inquisitor Nikodemus)



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]