NO

Author Topic: POLINK: error: Unresolved external symbol '__imp__SetTimer@16'.  (Read 3495 times)

delper

  • Guest
Hi C-Wizards ....

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

Code: [Select]
#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:

Code: [Select]
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

  • Guest
Re: POLINK: error: Unresolved external symbol '__imp__SetTimer@16'.
« Reply #1 on: May 24, 2009, 08:14:17 AM »
Have you linked with User32.lib?

John

delper

  • Guest
Re: POLINK: error: Unresolved external symbol '__imp__SetTimer@16'.
« Reply #2 on: May 24, 2009, 02:59:40 PM »
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

  • Guest
Re: POLINK: error: Unresolved external symbol '__imp__SetTimer@16'.
« Reply #3 on: May 24, 2009, 03:35:50 PM »
Look up the page for any API and it should tell you which lib to use.

John