[Qt-interest] undefined reference to xxx error

Bence Magyar mw.mzperx at gmail.com
Wed Jan 18 11:29:34 CET 2012


Hello Vincent,

undefined references usually occur when the programmer forgets to tell the
linker which libraries it should link to. I see you use QSerialDevice
without any LIB file. Add the .dll or .so file (Windows/Unix) to your
project, and everything will be fine.

--Bence

2012/1/18 Vincent Cai <wcai at cypress.com>

>  Dear all,****
>
> ** **
>
>          My project report errors during link stage.****
>
> ** **
>
>          Issue Description, please also refer to attached pro file.****
>
> #####################################################################****
>
> #Error on this line****
>
> #(1) if comment below line, error occurs****
>
> #(2) if assign TARGET with AppGui, error occurs****
>
> #(3) if assign TARGET with name not equal to AppGui, error disappear****
>
> TARGET = AppGui****
>
> ** **
>
>          Error Info:****
>
> ./debug\mainwindow.o: In function `MainWindow':****
>
> E:\wcai_perforce\LTS_R3\CFT
> members\WCAI\Projects\TSA\Qt\TSA_IDE\TSA_Data\UART\AppGui/mainwindow.cpp:11:
> undefined reference to `QSerialUI::QSerialUI(QWidget*)'****
>
> E:\wcai_perforce\LTS_R3\CFT
> members\WCAI\Projects\TSA\Qt\TSA_IDE\TSA_Data\UART\AppGui/mainwindow.cpp:12:
> undefined reference to `QSerialUI::Initialization()'****
>
> E:\wcai_perforce\LTS_R3\CFT
> members\WCAI\Projects\TSA\Qt\TSA_IDE\TSA_Data\UART\AppGui/mainwindow.cpp:11:
> undefined reference to `QSerialUI::QSerialUI(QWidget*)'****
>
> E:\wcai_perforce\LTS_R3\CFT
> members\WCAI\Projects\TSA\Qt\TSA_IDE\TSA_Data\UART\AppGui/mainwindow.cpp:12:
> undefined reference to `QSerialUI::Initialization()'****
>
> collect2: ld returned 1 exit status****
>
> mingw32-make[2]: *** [build\debug\exe\AppGui.exe] Error 1****
>
> mingw32-make[1]: *** [debug] Error 2****
>
> mingw32-make: *** [sub-AppGui-make_default] Error 2****
>
> ** **
>
> Thanks,****
>
> Vincent.****
>
> ------------------------------
> This message and any attachments may contain Cypress (or its subsidiaries)
> confidential information. If it has been received in error, please advise
> the sender and immediately delete this message.
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at qt.nokia.com
> http://lists.qt.nokia.com/mailman/listinfo/qt-interest
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20120118/af9597e8/attachment.html 


More information about the Qt-interest-old mailing list