Results 1 to 4 of 4

Thread: LNK 2019 Error while compiling qt program in VS2008

  1. #1
    Join Date
    Feb 2010
    Posts
    1
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default LNK 2019 Error while compiling qt program in VS2008

    Hi all.

    Im developing a qt app to use on a wince device.

    I have compiled the OpenSource version of Qt for winCE, and it is working.

    My program compiles fine. However, if i have any slots defined in the header file, it throws the following linker error:

    moc_updatedialog.obj : error LNK2019: unresolved external symbol "private: void __cdecl UpdateDialog::On_btnSubmitNE_pressed(void)" (?On_btnSubmitNE_pressed@UpdateDialog@@AAAXXZ) referenced in function "public: virtual int __cdecl UpdateDialog::qt_metacall(enum QMetaObject::Call,int,void * *)" (?qt_metacall@UpdateDialog@@UAAHW4Call@QMetaObject @@HPAPAX@Z)

    this is the header file which compiles:


    Qt Code:
    1. #ifndef UPDATEDIALOG_H
    2. #define UPDATEDIALOG_H
    3.  
    4. #include <QDialog>
    5. #include <QObject>
    6. #include "ui_updatedialog.h"
    7.  
    8. class UpdateDialog : public QDialog
    9. {
    10. Q_OBJECT
    11.  
    12. public:
    13. UpdateDialog(QWidget *parent = 0);
    14. ~UpdateDialog();
    15.  
    16. private:
    17. Ui::UpdateDialogClass ui;
    18.  
    19. private slots:
    20. //void On_tbxBatchIDUP_returnPressed();
    21. //void On_tbxLocationNE_returnPressed();
    22. //void On_tbxQtyPotsNE_returnPressed();
    23. //void On_btnSubmitNE_pressed();
    24.  
    25. };
    26.  
    27. #endif // UPDATEDIALOG_H
    To copy to clipboard, switch view to plain text mode 

    however, this does nothing. i have linked to all qt libraries that i am using, and the QtDesigner/QtDesignerComponents, as i made the .ui files in QtDesigner.

    here is the code that throws the errors:
    Qt Code:
    1. #ifndef UPDATEDIALOG_H
    2. #define UPDATEDIALOG_H
    3.  
    4. #include <QDialog>
    5. #include <QObject>
    6. #include "ui_updatedialog.h"
    7.  
    8. class UpdateDialog : public QDialog
    9. {
    10. Q_OBJECT
    11.  
    12. public:
    13. UpdateDialog(QWidget *parent = 0);
    14. ~UpdateDialog();
    15.  
    16. private:
    17. Ui::UpdateDialogClass ui;
    18.  
    19. private slots:
    20. void On_tbxBatchIDUP_returnPressed();
    21. void On_tbxLocationNE_returnPressed();
    22. void On_tbxQtyPotsNE_returnPressed();
    23. void On_btnSubmitNE_pressed();
    24.  
    25. };
    26.  
    27. #endif // UPDATEDIALOG_H
    To copy to clipboard, switch view to plain text mode 
    i assume the problem has something to do with the moc'ing process.



    the qt version is 4.5.3

    here is the VS build log:

    Build Log Build started: Project: barcoderRebuild, Configuration: Debug|STANDARDSDK_500 (ARMV4I)
    Command Lines Creating temporary file "c:\Documents and Settings\Joseph OfficeDesktop\My Documents\Visual Studio 2008\Projects\barcoderRebuild\barcoderRebuild\STAN DARDSDK_500 (ARMV4I)\Debug\BAT0000D331643512.bat" with contents
    [
    @echo off

    "C:\Qt\qt-embedded-wince-opensource-src-4.5.3\bin\moc.exe" -DUNDER_CE -DWINCE -D_WINDOWS -D_UNICODE -DUNICODE -D_WIN32 -DQT_NO_PRINTER -DQT_NO_PRINTDIALOG -DSTANDARDSHELL_UI_MODEL -D_WIN32_WCE=0x500 -DARMV4I -D_ARMV4I_ -Darmv4i -D_ARM_ -DARM -D_M_ARM -DARM -D__arm__ -DQ_OS_WINCE_STD -DQT_NO_PRINTER -DQT_NO_PRINTDIALOG -DQT_THREAD_SUPPORT -DQT_CORE_LIB -DQT_GUI_LIB -DQT_SQL_LIB -I".\GeneratedFiles\." -I"C:\Qt\qt-embedded-wince-opensource-src-4.5.3\include\." -I".\GeneratedFiles\Debug\." -I"C:\Qt\qt-embedded-wince-opensource-src-4.5.3\include\QtCore\." -I"C:\Qt\qt-embedded-wince-opensource-src-4.5.3\include\QtGui\." -I"C:\Qt\qt-embedded-wince-opensource-src-4.5.3\include\QtSql\." -I"C:\Qt\qt-embedded-wince-opensource-src-4.5.3\include\QtWebKit\." -I".\." -I".\Patterns\." ".\updatedialog.h" -o ".\GeneratedFiles\Debug\moc_updatedialog.cpp"



    if errorlevel 1 goto VCReportError

    goto VCEnd

    :VCReportError

    echo Project : error PRJ0019: A tool returned an error code from "Moc'ing updatedialog.h..."

    exit 1

    :VCEnd
    ]
    Creating command line """c:\Documents and Settings\Joseph OfficeDesktop\My Documents\Visual Studio 2008\Projects\barcoderRebuild\barcoderRebuild\STAN DARDSDK_500 (ARMV4I)\Debug\BAT0000D331643512.bat"""
    Creating temporary file "c:\Documents and Settings\Joseph OfficeDesktop\My Documents\Visual Studio 2008\Projects\barcoderRebuild\barcoderRebuild\STAN DARDSDK_500 (ARMV4I)\Debug\RSP0000D431643512.rsp" with contents
    [
    /Od /I ".\GeneratedFiles" /I "C:\Qt\qt-embedded-wince-opensource-src-4.5.3\include" /I ".\GeneratedFiles\Debug" /I "C:\Qt\qt-embedded-wince-opensource-src-4.5.3\include\QtCore" /I "C:\Qt\qt-embedded-wince-opensource-src-4.5.3\include\QtGui" /I "C:\Qt\qt-embedded-wince-opensource-src-4.5.3\include\QtSql" /I "C:\Qt\qt-embedded-wince-opensource-src-4.5.3\include\QtWebKit" /I ".\\" /I "Patterns" /D "UNDER_CE" /D "WINCE" /D "_WINDOWS" /D "_UNICODE" /D "UNICODE" /D "_WIN32" /D "QT_NO_PRINTER" /D "QT_NO_PRINTDIALOG" /D "STANDARDSHELL_UI_MODEL" /D "_WIN32_WCE=0x500" /D "ARMV4I" /D "_ARMV4I_" /D "armv4i" /D "_ARM_" /D "ARM" /D "_M_ARM" /D "__arm__" /D "Q_OS_WINCE_STD" /D "QT_THREAD_SUPPORT" /D "QT_CORE_LIB" /D "QT_GUI_LIB" /D "QT_SQL_LIB" /FD /EHsc /MDd /fp:fast /Zc:wchar_t- /GR- /Fo"STANDARDSDK_500 (ARMV4I)\Debug/" /Fd"STANDARDSDK_500 (ARMV4I)\Debug/vc80.pdb" /W3 /c /Zi /TP

    ".\updatedialog.cpp"
    ]
    Creating command line "cl.exe @"c:\Documents and Settings\Joseph OfficeDesktop\My Documents\Visual Studio 2008\Projects\barcoderRebuild\barcoderRebuild\STAN DARDSDK_500 (ARMV4I)\Debug\RSP0000D431643512.rsp" /nologo"
    Creating temporary file "c:\Documents and Settings\Joseph OfficeDesktop\My Documents\Visual Studio 2008\Projects\barcoderRebuild\barcoderRebuild\STAN DARDSDK_500 (ARMV4I)\Debug\RSP0000D531643512.rsp" with contents
    [
    /Od /I ".\GeneratedFiles" /I "C:\Qt\qt-embedded-wince-opensource-src-4.5.3\include" /I ".\GeneratedFiles\Debug" /I "C:\Qt\qt-embedded-wince-opensource-src-4.5.3\include\QtCore" /I "C:\Qt\qt-embedded-wince-opensource-src-4.5.3\include\QtGui" /I "C:\Qt\qt-embedded-wince-opensource-src-4.5.3\include\QtSql" /I "C:\Qt\qt-embedded-wince-opensource-src-4.5.3\include\QtWebKit" /I ".\\" /I "Patterns" /D "UNDER_CE" /D "WINCE" /D "_WINDOWS" /D "_UNICODE" /D "UNICODE" /D "_WIN32" /D "QT_NO_PRINTER" /D "QT_NO_PRINTDIALOG" /D "STANDARDSHELL_UI_MODEL" /D "_WIN32_WCE=0x500" /D "ARMV4I" /D "_ARMV4I_" /D "armv4i" /D "_ARM_" /D "ARM" /D "_M_ARM" /D "__arm__" /D "Q_OS_WINCE_STD" /D "QT_THREAD_SUPPORT" /D "QT_CORE_LIB" /D "QT_GUI_LIB" /D "QT_SQL_LIB" /FD /EHsc /MDd /fp:fast /Zc:wchar_t- /GR- /Fo"STANDARDSDK_500 (ARMV4I)\Debug/" /Fd"STANDARDSDK_500 (ARMV4I)\Debug/vc80.pdb" /W3 /c /Zi /TP

    ".\GeneratedFiles\Debug\moc_updatedialog.cpp"
    ]
    Creating command line "cl.exe @"c:\Documents and Settings\Joseph OfficeDesktop\My Documents\Visual Studio 2008\Projects\barcoderRebuild\barcoderRebuild\STAN DARDSDK_500 (ARMV4I)\Debug\RSP0000D531643512.rsp" /nologo"
    Creating temporary file "c:\Documents and Settings\Joseph OfficeDesktop\My Documents\Visual Studio 2008\Projects\barcoderRebuild\barcoderRebuild\STAN DARDSDK_500 (ARMV4I)\Debug\RSP0000D631643512.rsp" with contents
    [
    /OUT:"C:\Documents and Settings\Joseph OfficeDesktop\My Documents\Visual Studio 2008\Projects\barcoderRebuild\Debug\barcoderRebuil d.exe" /LIBPATH:"C:\Qt\qt-embedded-wince-opensource-src-4.5.3\lib" /MANIFEST:NO /NODEFAULTLIB:"oldnames.lib" /DEBUG /PDB:"C:\Documents and Settings\Joseph OfficeDesktop\My Documents\Visual Studio 2008\Projects\barcoderRebuild\Debug\barcoderRebuil d.pdb" /DYNAMICBASE /NXCOMPAT /MACHINE:THUMB /SUBSYSTEM:WINDOWSCE,5.00 QtDesignerd4.lib QtDesignerComponentsd4.lib qtmaind.lib QtCored4.lib QtGuid4.lib QtSqld4.lib QtWebKitd4.lib coredll.lib corelibc.lib ole32.lib oleaut32.lib uuid.lib commctrl.lib

    ".\STANDARDSDK_500 (ARMV4I)\Debug\main.obj"

    ".\STANDARDSDK_500 (ARMV4I)\Debug\qbarcoda.obj"

    ".\STANDARDSDK_500 (ARMV4I)\Debug\moc_qbarcoda.obj"

    ".\STANDARDSDK_500 (ARMV4I)\Debug\qrc_qbarcoda.obj"

    ".\STANDARDSDK_500 (ARMV4I)\Debug\newentrydialog.obj"

    ".\STANDARDSDK_500 (ARMV4I)\Debug\moc_newentrydialog.obj"

    ".\STANDARDSDK_500 (ARMV4I)\Debug\updatedialog.obj"

    ".\STANDARDSDK_500 (ARMV4I)\Debug\moc_updatedialog.obj"
    ]
    Creating command line "link.exe @"c:\Documents and Settings\Joseph OfficeDesktop\My Documents\Visual Studio 2008\Projects\barcoderRebuild\barcoderRebuild\STAN DARDSDK_500 (ARMV4I)\Debug\RSP0000D631643512.rsp" /NOLOGO /ERRORREPORTROMPT"
    Output Window Moc'ing updatedialog.h...
    Compiling...
    updatedialog.cpp
    Compiling...
    moc_updatedialog.cpp
    Linking...
    moc_updatedialog.obj : error LNK2019: unresolved external symbol "private: void __cdecl UpdateDialog::On_btnSubmitNE_pressed(void)" (?On_btnSubmitNE_pressed@UpdateDialog@@AAAXXZ) referenced in function "public: virtual int __cdecl UpdateDialog::qt_metacall(enum QMetaObject::Call,int,void * *)" (?qt_metacall@UpdateDialog@@UAAHW4Call@QMetaObject @@HPAPAX@Z)
    C:\Documents and Settings\Joseph OfficeDesktop\My Documents\Visual Studio 2008\Projects\barcoderRebuild\Debug\barcoderRebuil d.exe : fatal error LNK1120: 1 unresolved externals
    Results Build log was saved at "file://c:\Documents and Settings\Joseph OfficeDesktop\My Documents\Visual Studio 2008\Projects\barcoderRebuild\barcoderRebuild\STAN DARDSDK_500 (ARMV4I)\Debug\BuildLog.htm"
    barcoderRebuild - 2 error(s), 0 warning(s)


    thanks in advance.

    kevin

  2. #2
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: LNK 2019 Error while compiling qt program in VS2008

    Post the relevent parts of your cpp file so we can see your slot implementations.

  3. #3
    Join Date
    Jan 2010
    Posts
    8
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows

    Default Re: LNK 2019 Error while compiling qt program in VS2008

    Hi,


    I would like to compile the OpenSource version of Qt for winCE, could you giveme some tips??

    thanks

  4. #4
    Join Date
    Jun 2009
    Posts
    25
    Thanks
    1

    Default Re: LNK 2019 Error while compiling qt program in VS2008

    I passed instalation qt for winCE fev days ago so maybe i can help. You have to check file "install" when you download qt for winCE and should be fine.

Similar Threads

  1. Replies: 1
    Last Post: 6th December 2009, 14:28
  2. Replies: 1
    Last Post: 25th October 2008, 19:18
  3. 2019 linker error
    By bmn in forum Newbie
    Replies: 10
    Last Post: 29th July 2008, 00:56
  4. Program not compiling on Fresh install of Leopard
    By dvmorris in forum Qt Programming
    Replies: 1
    Last Post: 22nd November 2007, 10:22
  5. Compiling Error
    By KyrinComa in forum Qt Programming
    Replies: 2
    Last Post: 17th May 2006, 13:19

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.