Important: Please read the Qt Code of Conduct -

"#pragma comment" with .lib - unknown pragma ignored.

  • Hello, how can I link "crypt32.lib" to my program? I have static QT with MinGW.
    There is my config for compile static QT:

        cmd /c "configure.bat -static -release -platform win32-g++ -prefix $QtDir `
            -qt-zlib -qt-pcre -qt-libpng -qt-libjpeg -qt-freetype -opengl desktop -qt-sqlite -no-openssl `
            -opensource -confirm-license `
            -make libs -nomake tools -nomake examples -nomake tests"

    In Visual Studio this '#pragma comment(lib, "crypt32.lib")' works well.
    For addition I have:

    int wmain( int argc, wchar_t *argv[])
    undefined reference to `WinMain'

    How can I properly include this crypt32.lib when using static qt?

  • Lifetime Qt Champion

    Well in the normal Qt - mingw (non static)
    LIBS += -LC:/Windows/System32 -lcrypt32
    to the .pro file seems to work.

  • Still getting "undefined reference to `WinMain'" error.

    I found an issue, I cant use wchar_t* in main as attribute.
    Its possible to use this data type as main attribute?

Log in to reply