This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


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

Undefined Reference??


I have installed both gnu-win32 and mingw32 but both
packages give me the same error.  It must be an option
or something.  My brain is fried.

gcc -o myprg.exe myprg.c

Error:
c:\windows\temp\cc9350811.o   : undefined reference to 'SetTimer@16'
GCC.EXE: Internal compiler error: program ld got fatal signal 1


koi@ssa.crane.navy.mil


program:
-------------------------------------------------------

#include <stdio.h>
#include <windows.h>

VOID
CALLBACK handler(HWND hwnd, UINT umsg, UINT id, DWORD dwTime)
{
   fprintf(stdout,"Callback invoked dwTime=%d\n",dwTime);
}

int
main(int argc, char **argv)
{
    UINT cc;

    cc=SetTimer(NULL, 0, 500, (TIMERPROC) handler);
    if (cc == 0) {
       fprintf(stderr,"SetTimer failed\n");
       exit(-1);
    }
    fprintf(stdout,"Created timer succesfull\n");
    Sleep(10000);
    fprintf(stdout,"After sleep \n");
}
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".


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