Results 1 to 2 of 2

Thread: Qt 4.5 + QCreator - problems with Win APIs like CreateDC()

  1. #1
    Join Date
    Jul 2007
    Posts
    56
    Thanks
    6
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Qt 4.5 + QCreator - problems with Win APIs like CreateDC()

    I'm trying out using QCreator 1.2.1 with Qt 4.5 on Windows. I have a project that builds fine on Qt 4.3 with VS integration, but am having problems getting it to compile in QCreator.

    The app calls into some basic Win32 APIs such as "CreateDC()", "DeleteDC()" and a bunch of others. For some reason it has a problem with "CreateDC()", "DeleteDC()" APIs.

    When I compile I get a linker error "undefined reference to 'CreateDCA@16'" in the object code file.

    My code is

    HDC hdc;
    hdc=::CreateDCA("DISPLAY",NULL,NULL,NULL);

    Do I need to specifically tell QCreator to link to a certain library? It's weird that it doesn't have a problem with any of the other Win32 APIs I use, just these.

  2. #2
    Join Date
    Jul 2007
    Posts
    56
    Thanks
    6
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Qt 4.5 + QCreator - problems with Win APIs like CreateDC()

    Figured it out - Needed to add the following to my pro file:

    LIBS += -lgdi32

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.