VC5 error LNK2001: unresolved external symbol __imp__InitCommonControls@0 
Author Message
 VC5 error LNK2001: unresolved external symbol __imp__InitCommonControls@0

Hello.
I have VC5 and for some unknown reason, I can't seem to get my linker
to find any functions in the common control library. Please help.

Attached is some code that would produce this error.

Thanks.

#include <windows.h>
#include <commctrl.h>

/* Function Declarations */
LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM);

int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,
                PSTR szCmdLine, int iCmdShow)
{
        static char szAppName[] = "Test App";
        static char szClassName[] = "TestApp";
        HWND hWnd;
        MSG     msg;
        WNDCLASSEX WC;

        WC.cbSize = sizeof (WC);
        WC.style = CS_HREDRAW | CS_VREDRAW;
        WC.lpfnWndProc = WndProc;
        WC.cbClsExtra = 0;
        WC.cbWndExtra = 0;
        WC.hInstance = hInstance;
        WC.hIcon = LoadIcon (NULL, IDI_APPLICATION);
        WC.hCursor = LoadCursor (NULL, IDC_ARROW);
        WC.hbrBackground = (HBRUSH) GetStockObject (WHITE_BRUSH);
        WC.lpszMenuName = NULL;
        WC.lpszClassName = szClassName;
        WC.hIconSm = LoadIcon(NULL, IDI_APPLICATION);

        RegisterClassEx (&WC);

        hWnd = CreateWindow (szClassName,
                szAppName,
                WS_OVERLAPPEDWINDOW,
                CW_USEDEFAULT,
                CW_USEDEFAULT,
                CW_USEDEFAULT,
                CW_USEDEFAULT,
                NULL,
                NULL,
                hInstance,
                NULL);

        ShowWindow (hWnd, iCmdShow);
        UpdateWindow (hWnd);

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

Quote:
}

LRESULT CALLBACK WndProc (HWND hWnd, UINT iMsg, WPARAM wParam,
LPARAM lParam)
{

        switch (iMsg)
        {
        case WM_CREATE:
                InitCommonControls();
                return 0;

        case WM_DESTROY:
                PostQuitMessage (0);
                return 0;
        }
        return DefWindowProc (hWnd, iMsg, wParam, lParam);

Quote:
}



Mon, 02 Jul 2001 03:00:00 GMT  
 VC5 error LNK2001: unresolved external symbol __imp__InitCommonControls@0


Quote:

>>Hello.
>>I have VC5 and for some unknown reason, I can't seem to get my linker
>>to find any functions in the common control library. Please help.

>>Attached is some code that would produce this error.

>Maybe you need to link with comctl32.lib.

I placed an "comctl32.lib" in my Object/Library modules line in my
"Project settings / Link" tab and it did the trick. I thought that
the "comctl32.lib" in the project options would be enough but I
guess it's their for some other purpose.

Thanks again.



Mon, 02 Jul 2001 03:00:00 GMT  
 VC5 error LNK2001: unresolved external symbol __imp__InitCommonControls@0

Quote:

>Hello.
>I have VC5 and for some unknown reason, I can't seem to get my linker
>to find any functions in the common control library. Please help.

>Attached is some code that would produce this error.

Maybe you need to link with comctl32.lib.

--
Mike Enright

(Not speaking for Cetasoft)



Fri, 06 Jul 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. PxSQLScript.obj : error LNK2001: unresolved external symbol "class ATL::CTraceCa

2. error LNK2001: unresolved external symbol _ntohl@4

3. error LNK2001: unresolved external symbol _IID_ICategorizeProperties

4. error LNK2001: Unresolved external Symbol _IID__Class1

5. error LNK2001: unresolved external symbol

6. Linking Problem when trying to create ReleaseUMinDependency[error LNK2001: unresolved external symbol _main]

7. error LNK2001: unresolved external symbol _main

8. error LNK2001: unresolved external symbol

9. release build error LNK2001: unresolved external symbol _main

10. error LNK2001: unresolved external symbol _IID_IApplicationObject

11. Anyone knows error LNK2001: unresolved external symbol __imp__CoGetObjectContext@8

12. error LNK2001: unresolved external symbol _WinMain@16

 

 
Powered by phpBB® Forum Software