简体   繁体   中英

Qt 4.8 Link error with Visual Studio 2010

I am receiving a link error when trying to compile my "hello world" Qt program.

Error 1 error LNK2001: unresolved external symbol "__declspec(dllimport) protected: virtual void __thiscall QObject::disconnectNotify(char const *)" (__imp_?disconnectNotify@QObject@@MAEXPBD@Z) C:\\Users\\Matthew\\documents\\visual studio 2010\\Projects\\FBIDecryptor\\FBIDecryptor\\main.obj FBIDecryptor

I believe I am missing a library input, but I don't know which library.

This is the code I am trying to execute:

int main(int argc, char* argv[])
{
    QApplication app(argc, argv);
    QLabel *label = new QLabel("Hello Qt");
    label->show();

    return app.exec();
}

You are missing reference to QtCore, QtWidget and other Core library modules. Adding the Qt4.8/bin path to the environment variable should fix this.

Found a useful set up guide here

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM