POLINK: error: Unresolved external symbol '__imp__SetTimer@16'.

Started by delper, May 24, 2009, 05:57:12 AM

Previous topic - Next topic

delper

Hi C-Wizards ....

     I have a very simple SetTimer program, and it does not work.   The code is shown below:


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

void CALLBACK RefreshLCDFnt (HWND hwnd, UINT uMsg, UINT idEvent, DWORD dwTime);

   
int main (void)
{
    UINT_PTR MyTimer;
    MSG mymsg = {0, 0, 0, 0};

    MyTimer = SetTimer (NULL, 0, 1000, (TIMERPROC)RefreshLCDFnt);
    for (;;)
        {
            if (GetMessage (&mymsg, NULL, 0, 0))       DispatchMessage (&mymsg);
        }
        KillTimer (NULL, MyTimer);
    return 0;
}


void CALLBACK RefreshLCDFnt (HWND hwnd, UINT uMsg, UINT idEvent, DWORD dwTime)
{
    printf ("+/-/*/");
}


     Does anyone knows what I am missing?

     I am getting these errors:


POLINK: error: Unresolved external symbol '__imp__SetTimer@16'.
POLINK: error: Unresolved external symbol '__imp__GetMessageA@16'.
POLINK: error: Unresolved external symbol '__imp__DispatchMessageA@4'.
POLINK: fatal error: 3 unresolved external(s).


    What am I missing?

ps.  When I use a different compiler, the code compiles correctly well, and it executes as designed.

JohnF


delper

Hi John,

     You are my hero ....  Thanks a lot for your help ....  I've been scratching my head all night long.

     I thought all the required lib were loaded when one selected the Console application.   

     Do you know if there are any other lib to have the IPC (interprocess communication) set up?    I'll need to communicate my program with another LabView program.   I don't know how to do it yet, so if anyone have any tips on this regards, I'll really appreciate it.   I only need transfer a few bytes and gather a few bytes from Labview (I need to read some variables and write to other different variables).

Regards,

D

JohnF

Look up the page for any API and it should tell you which lib to use.

John