Results 1 to 18 of 18

Thread: QtAxWidget link error

  1. #1
    Join Date
    Dec 2012
    Posts
    13
    Thanks
    1

    Smile QtAxWidget link error

    Hello everyone,
    I'm working on a Qt program and I have to use an ActiveX control. So I wanted to use QAxWidget but when I do this, I have :
    error LNK2019: unresolved external symbol "public: bool __thiscall QAxBase::setControl
    error LNK2019: unresolved external symbol "public: __thiscall QAxWidget::QAxWidget

    I checked that QAxContainer.lib and QAxContainerd.lib were in my input properties (I use Visual 2010). And that's it, those .lib are in the good folder, I don't understand why it doesn't work.

    Someone can help me?

  2. #2
    Join Date
    Sep 2011
    Posts
    1,241
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QtAxWidget link error

    Quote Originally Posted by ArnaudC View Post
    I checked that QAxContainer.lib and QAxContainerd.lib were in my input properties (I use Visual 2010). And that's it, those .lib are in the good folder, I don't understand why it doesn't work.

    Someone can help me?
    We can't take your word for it. Post a small example code that causes the problem. State explicitly (i.e. absolute paths!) what your library include locations () AND libs are.

    Post your compiler + linker command.
    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

  3. #3
    Join Date
    Dec 2012
    Posts
    13
    Thanks
    1

    Default Re: QtAxWidget link error

    yes sorry.
    I (Arnaud), work for a technical communication company. We are trying to make a software that uses a viewer with a activeX Control. So for that I need a QtAxWidget.

    Qt Code:
    1. #include <ActiveQt/QAxWidget>
    2.  
    3. LeoValidatorGUI::LeoValidatorGUI(QWidget *parent, Qt::WFlags flags)
    4. : QMainWindow(parent, flags)
    5. {
    6. ui.setupUi(this);
    7. ...
    8. QAxWidget *window = new QAxWidget();
    9. window->setControl("HKEY_CLASSES_ROOT\TypeLib\{ACFC5869-1D0F-4E2C-B898-05805607D542}"); // ClassID of the COM object
    10. window->show();
    11. ...
    12. }
    To copy to clipboard, switch view to plain text mode 


    Then, as I tols you I work with Visual, so in Project properties > Linker > input > Additional Dependencies, I've got :
    Qt Code:
    1. LeoEngine.lib
    2. kernel32.lib
    3. user32.lib
    4. shell32.lib
    5. uuid.lib
    6. ole32.lib
    7. ws2_32.lib
    8. gdi32.lib
    9. comdlg32.lib
    10. oleaut32.lib
    11. libboost_filesystem-vc100-mt-sgd-1_49.lib
    12. cgmlib_mt.lib
    13. CgmObjectsRW_mt.lib
    14. freetype2_mt.lib
    15. zlib_mt.lib
    16. imm32.lib
    17. winmm.lib
    18. winspool.lib
    19. qtmaind.lib
    20. QtCored.lib
    21. QtGuid.lib
    22. QAxContainerd.lib
    23. QAxContainer.lib
    To copy to clipboard, switch view to plain text mode 

    in Linker > General > Additional Library Directories :
    $(QTDIR)\lib

    if I do a
    Qt Code:
    1. ECHO $(QTDIR)
    To copy to clipboard, switch view to plain text mode 

    I have C:\Qt\4.8.2\qt-everywhere-opensource-src-4.8.2, which is rigth with to my Qt directory
    Then I checked in C:\Qt\4.8.2\qt-everywhere-opensource-src-4.8.2\lib and there are : QAxContainerd.lib and QAxContainer.lib


    and when I look into C/C++ > Command Line, I've got :
    Qt Code:
    1. /I".\GeneratedFiles" /I"." /I"C:\Qt\4.8.2\qt-everywhere-opensource-src-4.8.2\include" /I".\GeneratedFiles\Debug" /I"C:\Qt\4.8.2\qt-everywhere-opensource-src-4.8.2\include\QtCore" /I"C:\Qt\4.8.2\qt-everywhere-opensource-src-4.8.2\include\QtGui" /I"..\LeoEngine\include" /I"..\LeoEngine\boost_1_45_0" /I"..\LeoEngine\tinyxml" /I"..\LeoEngine\include\CgmObjects" /I".\include" /Zi /nologo /W1 /WX- /Od /Oy- /D "UNICODE" /D "WIN32" /D "QT_LARGEFILE_SUPPORT" /D "QT_CORE_LIB" /D "QT_GUI_LIB" /Gm- /EHsc /MTd /GS /fp:precise /Zc:wchar_t- /Zc:forScope /Fp"Debug\LeoValidatorGUI.pch" /Fa"Debug\" /Fo"Debug\" /Fd"Debug\vc100.pdb" /Gd /analyze- /errorReport:queue
    To copy to clipboard, switch view to plain text mode 

    and when I look into Linker > Command Line, I've got :
    Qt Code:
    1. /OUT:"C:\Users\acasella\Documents\AnteaDev\Leo\Win32\Debug\\LeoValidatorGUI.exe" /INCREMENTAL:NO /NOLOGO /LIBPATH:"C:\Qt\4.8.2\qt-everywhere-opensource-src-4.8.2\lib" /LIBPATH:"./lib" /LIBPATH:"../LeoEngine/lib/Debug/win32" "LeoEngine.lib" "kernel32.lib" "user32.lib" "shell32.lib" "uuid.lib" "ole32.lib" "ws2_32.lib" "gdi32.lib" "comdlg32.lib" "oleaut32.lib" "libboost_filesystem-vc100-mt-sgd-1_49.lib" "cgmlib_mt.lib" "CgmObjectsRW_mt.lib" "freetype2_mt.lib" "zlib_mt.lib" "imm32.lib" "winmm.lib" "winspool.lib" "qtmaind.lib" "QtCored.lib" "QtGuid.lib" "QAxContainerd.lib" "QAxContainer.lib" "advapi32.lib" "odbc32.lib" "odbccp32.lib" /MANIFEST /ManifestFile:"Debug\LeoValidatorGUI.exe.intermediate.manifest" /ALLOWISOLATION /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG /PDB:"C:\Users\acasella\Documents\AnteaDev\Leo\Win32\Debug\LeoValidatorGUI.pdb" /SUBSYSTEM:WINDOWS /PGD:"C:\Users\acasella\Documents\AnteaDev\Leo\Win32\Debug\LeoValidatorGUI.pgd" /TLBID:1 /DYNAMICBASE /NXCOMPAT /MACHINE:X86 /ERRORREPORT:QUEUE
    To copy to clipboard, switch view to plain text mode 



    Do you need other information?

  4. #4
    Join Date
    Sep 2011
    Posts
    1,241
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QtAxWidget link error

    this is in your linker command:
    "QAxContainerd.lib" "QAxContainer.lib"

    You are linking with both release and debug!
    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

  5. #5
    Join Date
    Dec 2012
    Posts
    13
    Thanks
    1

    Default Re: QtAxWidget link error

    Yes it doesn't work with only QAxContainerd.lib

    It doesnt work with only QAxContainer.lib too, same error.


    Added after 5 minutes:


    for exemple, if I do this :
    [Code]
    /OUT:"C:\Users\acasella\Documents\AnteaDev\Leo\Win3 2\Debug\\LeoValidatorGUI.exe" /INCREMENTAL:NO /NOLOGO /LIBPATH:"C:\Qt\4.8.2\qt-everywhere-opensource-src-4.8.2\lib" /LIBPATH:"./lib" /LIBPATH:"../LeoEngine/lib/Debug/win32" "LeoEngine.lib" "kernel32.lib" "user32.lib" "shell32.lib" "uuid.lib" "ole32.lib" "ws2_32.lib" "gdi32.lib" "comdlg32.lib" "oleaut32.lib" "libboost_filesystem-vc100-mt-sgd-1_49.lib" "cgmlib_mt.lib" "CgmObjectsRW_mt.lib" "freetype2_mt.lib" "zlib_mt.lib" "imm32.lib" "winmm.lib" "winspool.lib" "qtmaind.lib" "QtCored.lib" "QtGuid.lib" "QAxContainer.lib" "advapi32.lib" "odbc32.lib" "odbccp32.lib" /MANIFEST /ManifestFile:"Debug\LeoValidatorGUI.exe.intermedia te.manifest" /ALLOWISOLATION /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG /PDB:"C:\Users\acasella\Documents\AnteaDev\Leo\Win3 2\Debug\LeoValidatorGUI.pdb" /SUBSYSTEM:WINDOWS /PGD:"C:\Users\acasella\Documents\AnteaDev\Leo\Win3 2\Debug\LeoValidatorGUI.pgd" /TLBID:1 /DYNAMICBASE /NXCOMPAT /MACHINE:X86 /ERRORREPORT:QUEUE
    [Code]
    Last edited by ArnaudC; 17th December 2012 at 14:57.

  6. #6
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,329
    Thanks
    317
    Thanked 871 Times in 858 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: QtAxWidget link error

    You can't link to both Debug and Release versions of a library at the same time in Visual Studio. The two versions are incompatible, because VS inserts extra code into Debug libraries (for debugging purposes) that makes a debug and a release version of the same object different and incompatible.

    So in your link statement above, you have the release version of QAxContainer.lib, not the debug version, and this won't work.

    By the way, the tags are "CODE" and "/CODE" (inside of "[]" brackets), not "[Code]"

  7. #7
    Join Date
    Dec 2012
    Posts
    13
    Thanks
    1

    Default Re: QtAxWidget link error

    no sorry I copied the wrong one, but I did the same with QAxContainerd.lib of course.

    Yes it doesn't work with only QAxContainerd.lib
    It doesnt work with only QAxContainer.lib too, same error.

    thank you for the trick

  8. #8
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,329
    Thanks
    317
    Thanked 871 Times in 858 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: QtAxWidget link error

    What do you mean, you "copied the wrong one"? Everything in that link line refers to Debug versions of libraries except QAxContainer.lib. If you mean to say that you used QAxContainerd.lib with a Release build, well that won't work either.

    By the way, I notice that you do not have "QT_DLL" defined on your C/C++ command line. You may need this to get proper linkage from the QT DLLs. Go to the project properties, C/C++ Preprocessor settings, and add QT_DLL to the Preprocessor Definitions line. (This is on VC 2008; the name in VC 2010 might be different, but for sure there will be something similar). This define is required whenever you are using Qt as DLLs in a project to ensure that the class declarations are imported with the correct name-mangling. (A different define is used internally by Qt when building the Qt DLLs themselves).
    Last edited by d_stranz; 17th December 2012 at 20:00.

  9. #9
    Join Date
    Dec 2012
    Posts
    13
    Thanks
    1

    Default Re: QtAxWidget link error

    Woooow, I tried with the QT_DLL flag, it threw me a lot of errors!!

    Qt Code:
    1. 1>ErrorManager.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __thiscall QString::toStdString(void)const " (__imp_?toStdString@QString@@QBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ) referenced in function "private: class TiXmlElement * __thiscall ErrorManager::buildExportHeader(class TiXmlDocument * const)" (?buildExportHeader@ErrorManager@@AAEPAVTiXmlElement@@QAVTiXmlDocument@@@Z)
    2. 1>leovalidatorgui.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __thiscall QString::toStdString(void)const " (__imp_?toStdString@QString@@QBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ)
    3. 1>XMLProfileListReader.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __thiscall QString::toStdString(void)const " (__imp_?toStdString@QString@@QBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ)
    4. 1>ErrorManager.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class QString & __thiscall QString::append(class QByteArray const &)" (__imp_?append@QString@@QAEAAV1@ABVQByteArray@@@Z) referenced in function "private: void __thiscall ErrorManager::addToFile(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,bool)" (?addToFile@ErrorManager@@AAEXV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@0_N@Z)
    5. 1>leovalidatorgui.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class QString & __thiscall QString::append(class QByteArray const &)" (__imp_?append@QString@@QAEAAV1@ABVQByteArray@@@Z)
    6. 1>ErrorManager.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall QString::QString(char const *)" (__imp_??0QString@@QAE@PBD@Z) referenced in function "private: void __thiscall ErrorManager::addToFile(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,bool)" (?addToFile@ErrorManager@@AAEXV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@0_N@Z)
    7. 1>leovalidatorgui.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall QString::QString(char const *)" (__imp_??0QString@@QAE@PBD@Z)
    8. 1>XMLProfileListReader.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall QString::QString(char const *)" (__imp_??0QString@@QAE@PBD@Z)
    9. 1>leovalidatorgui.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall QTreeWidgetItem::setTextAlignment(int,int)" (__imp_?setTextAlignment@QTreeWidgetItem@@QAEXHH@Z) referenced in function "public: void __thiscall Ui_LeoValidatorGUIClass::setupUi(class QMainWindow *)" (?setupUi@Ui_LeoValidatorGUIClass@@QAEXPAVQMainWindow@@@Z)
    10. 1>leovalidatorgui.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: bool __thiscall QString::operator!=(char const *)const " (__imp_??9QString@@QBE_NPBD@Z) referenced in function "public: void __thiscall LeoValidatorGUI::selectAutoFolder(void)" (?selectAutoFolder@LeoValidatorGUI@@QAEXXZ)
    11. 1>leovalidatorgui.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall QFileDialog::~QFileDialog(void)" (__imp_??1QFileDialog@@UAE@XZ) referenced in function "public: void __thiscall LeoValidatorGUI::chooseFolderPath(void)" (?chooseFolderPath@LeoValidatorGUI@@QAEXXZ)
    12. 1>leovalidatorgui.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static class QString __cdecl QFileDialog::getExistingDirectory(class QWidget *,class QString const &,class QString const &,class QFlags<enum QFileDialog::Option>)" (__imp_?getExistingDirectory@QFileDialog@@SA?AVQString@@PAVQWidget@@ABV2@1V?$QFlags@W4Option@QFileDialog@@@@@Z) referenced in function "public: void __thiscall LeoValidatorGUI::chooseFolderPath(void)" (?chooseFolderPath@LeoValidatorGUI@@QAEXXZ)
    13. 1>leovalidatorgui.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall QFileDialog::QFileDialog(class QWidget *,class QString const &,class QString const &,class QString const &)" (__imp_??0QFileDialog@@QAE@PAVQWidget@@ABVQString@@11@Z) referenced in function "public: void __thiscall LeoValidatorGUI::chooseFolderPath(void)" (?chooseFolderPath@LeoValidatorGUI@@QAEXXZ)
    14. 1>leovalidatorgui.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static class QString __cdecl QFileDialog::getOpenFileName(class QWidget *,class QString const &,class QString const &,class QString const &,class QString *,class QFlags<enum QFileDialog::Option>)" (__imp_?getOpenFileName@QFileDialog@@SA?AVQString@@PAVQWidget@@ABV2@11PAV2@V?$QFlags@W4Option@QFileDialog@@@@@Z) referenced in function "public: void __thiscall LeoValidatorGUI::chooseListPath(void)" (?chooseListPath@LeoValidatorGUI@@QAEXXZ)
    15. 1>leovalidatorgui.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall QString::QString(struct QString::Null const &)" (__imp_??0QString@@QAE@ABUNull@0@@Z) referenced in function "public: void __thiscall LeoValidatorGUI::chooseListPath(void)" (?chooseListPath@LeoValidatorGUI@@QAEXXZ)
    16. 1>leovalidatorgui.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: bool __thiscall QString::operator==(char const *)const " (__imp_??8QString@@QBE_NPBD@Z) referenced in function "public: void __thiscall LeoValidatorGUI::updateFilesList(void)" (?updateFilesList@LeoValidatorGUI@@QAEXXZ)
    17. 1>leovalidatorgui.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class QString & __thiscall QString::append(char const *)" (__imp_?append@QString@@QAEAAV1@PBD@Z) referenced in function "public: void __thiscall LeoValidatorGUI::watchInFolder(void)" (?watchInFolder@LeoValidatorGUI@@QAEXXZ)
    18. 1>leovalidatorgui.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class QString __thiscall QTreeWidgetItem::text(int)const " (__imp_?text@QTreeWidgetItem@@QBE?AVQString@@H@Z) referenced in function "private: class QStringList __thiscall LeoValidatorGUI::getFileListFromTree(void)" (?getFileListFromTree@LeoValidatorGUI@@AAE?AVQStringList@@XZ)
    19. 1>leovalidatorgui.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall QListWidget::addItem(class QString const &)" (__imp_?addItem@QListWidget@@QAEXABVQString@@@Z) referenced in function "public: void __thiscall LeoValidatorGUI::showFile(void)" (?showFile@LeoValidatorGUI@@QAEXXZ)
    20. 1>leovalidatorgui.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class QString __thiscall QTableWidgetItem::text(void)const " (__imp_?text@QTableWidgetItem@@QBE?AVQString@@XZ) referenced in function "public: void __thiscall LeoValidatorGUI::showFile(void)" (?showFile@LeoValidatorGUI@@QAEXXZ)
    21. 1>leovalidatorgui.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static class QString __cdecl QString::fromStdString(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (__imp_?fromStdString@QString@@SA?AV1@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) referenced in function "public: void __thiscall LeoValidatorGUI::chooseCGMPath(void)" (?chooseCGMPath@LeoValidatorGUI@@QAEXXZ)
    22. 1>leovalidatorgui.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class QString & __thiscall QString::operator=(char const *)" (__imp_??4QString@@QAEAAV0@PBD@Z) referenced in function "private: bool __thiscall LeoValidatorGUI::validateCGM(class QStr
    To copy to clipboard, switch view to plain text mode 

    (and by the way, I meant that the QAxContainerd.lib in DEBUG didn't work, even when I don't use QAxContainer.lib)

  10. #10
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,329
    Thanks
    317
    Thanked 871 Times in 858 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: QtAxWidget link error

    Hmm, did you rebuild the entire project using the define? Was your Qt distribution built using the QT_MAKEDLL define? Is your LeoEngine a Qt-dependent library?

    I would suggest that you back up, make a simple GUI project that uses only QtCore and QtGui, and get *that* to link properly, then add ActiveQt to that, *then* try pulling in all of your other libraries etc. If you want to avoid link errors, everything has to be built with the same linkage to Qt.

  11. #11
    Join Date
    Dec 2012
    Posts
    13
    Thanks
    1

    Default Re: QtAxWidget link error

    First, Thank you for your help, I move foward thank to this.

    I did a "test" project with almost nothing in it (a basic Qt app from Visual), I add to this the QAxContainerd.lib.

    This is the code I have :
    Qt Code:
    1. viewtest::viewtest(QWidget *parent, Qt::WFlags flags)
    2. : QMainWindow(parent, flags)
    3. {
    4. ui.setupUi(this);
    5.  
    6. QAxWidget *window = new QAxWidget();
    7. window->setControl("HKEY_CLASSES_ROOT\TypeLib\{ACFC5869-1D0F-4E2C-B898-05805607D542}");
    8. window->show();
    9. }
    To copy to clipboard, switch view to plain text mode 

    but I still have the same error :
    Qt Code:
    1. 1>viewtest.obj : error LNK2019: unresolved external symbol "public: bool __thiscall QAxBase::setControl(class QString const &)" (?setControl@QAxBase@@QAE_NABVQString@@@Z) referenced in function "public: __thiscall viewtest::viewtest(class QWidget *,class QFlags<enum Qt::WindowType>)" (??0viewtest@@QAE@PAVQWidget@@V?$QFlags@W4WindowType@Qt@@@@@Z)
    2. 1>viewtest.obj : error LNK2019: unresolved external symbol "public: __thiscall QAxWidget::QAxWidget(class QWidget *,class QFlags<enum Qt::WindowType>)" (??0QAxWidget@@QAE@PAVQWidget@@V?$QFlags@W4WindowType@Qt@@@@@Z) referenced in function "public: __thiscall viewtest::viewtest(class QWidget *,class QFlags<enum Qt::WindowType>)" (??0viewtest@@QAE@PAVQWidget@@V?$QFlags@W4WindowType@Qt@@@@@Z)
    3. 1>C:\Users\acasella\Documents\Visual Studio 2010\Projects\testActiveX\Win32\Debug\\viewtest.exe : fatal error LNK1120: 2 unresolved externals
    To copy to clipboard, switch view to plain text mode 

    (here is the compilation command :
    Qt Code:
    1. /OUT:"C:\Users\acasella\Documents\Visual Studio 2010\Projects\testActiveX\Win32\Debug\\viewtest.exe" /INCREMENTAL:NO /NOLOGO /LIBPATH:"C:\Qt\4.8.2\qt-everywhere-opensource-src-4.8.2\lib" "kernel32.lib" "user32.lib" "shell32.lib" "uuid.lib" "ole32.lib" "advapi32.lib" "ws2_32.lib" "gdi32.lib" "comdlg32.lib" "oleaut32.lib" "imm32.lib" "winmm.lib" "winspool.lib" "qtmaind.lib" "QtCored.lib" "QtGuid.lib" "QAxContainerd.lib" "odbc32.lib" "odbccp32.lib" /MANIFEST /ManifestFile:"Debug\viewtest.exe.intermediate.manifest" /ALLOWISOLATION /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG /PDB:"C:\Users\acasella\Documents\Visual Studio 2010\Projects\testActiveX\Win32\Debug\viewtest.pdb" /SUBSYSTEM:WINDOWS /PGD:"C:\Users\acasella\Documents\Visual Studio 2010\Projects\testActiveX\Win32\Debug\viewtest.pgd" /TLBID:1 /DYNAMICBASE /NXCOMPAT /MACHINE:X86 /ERRORREPORT:QUEUE
    To copy to clipboard, switch view to plain text mode 
    )


    Then,
    did you rebuild the entire project using the define
    Yes, Absolutely.

    Was your Qt distribution built using the QT_MAKEDLL define?
    How can I check that?

    Is your LeoEngine a Qt-dependent library?
    no Qt in the LeoEngine

    Thank you very much.

  12. #12
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,329
    Thanks
    317
    Thanked 871 Times in 858 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: QtAxWidget link error

    "public: bool __thiscall QAxBase::setControl
    Something is fishy with this linkage. I would expect to see "__stdcall" or something like that. I am starting to wonder if there is some preprocessor define required to use ActiveQt. Have you looked at the example and demo projects that come with Qt to see what they look like?

  13. #13
    Join Date
    Dec 2012
    Posts
    13
    Thanks
    1

    Default Re: QtAxWidget link error

    The Qt sample in visual only shows how to build a activeX controler (server) and it works, but this is not what I want to do. I want to use one.
    If you were thinking at other samples, tell me and I'll check.
    And yes I saw a QAXSERVER preprocessor define, but if I add it to my test project, it still doesn't work. I trying to find another define only for the use of activeX controlers.

  14. #14
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,329
    Thanks
    317
    Thanked 871 Times in 858 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: QtAxWidget link error

    OK, I have made a little project that opens an Excel workspace in a QMainWindow. This is a VS 2008 project, but you should be able to import it into VS 2010. If this doesn't work for you, then I think there is probably something wrong with your Qt installation.


    Image1.png

    AxFoo.zip

  15. The following user says thank you to d_stranz for this useful post:

    ArnaudC (21st December 2012)

  16. #15
    Join Date
    Dec 2012
    Posts
    13
    Thanks
    1

    Default Re: QtAxWidget link error

    NIIIIICE!! Thank you very much!

    and it doesn't work
    AxFoo.obj : error LNK2019: unresolved external symbol "public: bool __thiscall QAxBase::setControl(class QString const &)" (?setControl@QAxBase@@QAE_NABVQString@@@Z) referenced in function "public: __thiscall AxFoo::AxFoo(class QWidget *,class QFlags<enum Qt::WindowType>)" (??0AxFoo@@QAE@PAVQWidget@@V?$QFlags@W4WindowType@ Qt@@@@@Z)
    1>AxFoo.obj : error LNK2019: unresolved external symbol "public: __thiscall QAxWidget::QAxWidget(class QWidget *,class QFlags<enum Qt::WindowType>)" (??0QAxWidget@@QAE@PAVQWidget@@V?$QFlags@W4WindowT ype@Qt@@@@@Z) referenced in function "public: __thiscall AxFoo::AxFoo(class QWidget *,class QFlags<enum Qt::WindowType>)" (??0AxFoo@@QAE@PAVQWidget@@V?$QFlags@W4WindowType@ Qt@@@@@Z)
    1>QtCored.lib(qeventdispatcher_win.obj) : error LNK2019: unresolved external symbol _WSAAsyncSelect@16 referenced in function "public: void __thiscall QEventDispatcherWin32Private::doWsaAsyncSelect(int )" (?doWsaAsyncSelect@QEventDispatcherWin32Private@@Q AEXH@Z)
    1>QtGuid.lib(qaccessible_win.obj) : error LNK2019: unresolved external symbol __imp__PlaySoundW@12 referenced in function "public: static void __cdecl QAccessible::updateAccessibility(class QObject *,int,enum QAccessible::Event)" (?updateAccessibility@QAccessible@@SAXPAVQObject@@ HW4Event@1@@Z)
    1>QtGuid.lib(qwininputcontext_win.obj) : error LNK2019: unresolved external symbol _ImmSetCandidateWindow@8 referenced in function "public: virtual void __thiscall QWinInputContext::update(void)" (?update@QWinInputContext@@UAEXXZ)
    1>QtGuid.lib(qwininputcontext_win.obj) : error LNK2019: unresolved external symbol _ImmSetCompositionWindow@8 referenced in function "public: virtual void __thiscall QWinInputContext::update(void)" (?update@QWinInputContext@@UAEXXZ)
    1>QtGuid.lib(qwininputcontext_win.obj) : error LNK2019: unresolved external symbol _ImmSetCompositionFontW@8 referenced in function "public: virtual void __thiscall QWinInputContext::update(void)" (?update@QWinInputContext@@UAEXXZ)
    1>QtGuid.lib(qwininputcontext_win.obj) : error LNK2019: unresolved external symbol _ImmGetContext@4 referenced in function "struct HIMC__ * __cdecl getContext(struct HWND__ *)" (?getContext@@YAPAUHIMC__@@PAUHWND__@@@Z)
    1>QtGuid.lib(qwininputcontext_win.obj) : error LNK2019: unresolved external symbol _ImmReleaseContext@8 referenced in function "void __cdecl releaseContext(struct HWND__ *,struct HIMC__ *)" (?releaseContext@@YAXPAUHWND__@@PAUHIMC__@@@Z)
    1>QtGuid.lib(qwininputcontext_win.obj) : error LNK2019: unresolved external symbol _ImmNotifyIME@16 referenced in function "void __cdecl notifyIME(struct HIMC__ *,unsigned long,unsigned long,unsigned long)" (?notifyIME@@YAXPAUHIMC__@@KKK@Z)
    1>QtGuid.lib(qwininputcontext_win.obj) : error LNK2019: unresolved external symbol _ImmGetCompositionStringW@16 referenced in function "long __cdecl getCompositionString(struct HIMC__ *,unsigned long,void *,unsigned long)" (?getCompositionString@@YAJPAUHIMC__@@KPAXK@Z)
    1>QtGuid.lib(qwininputcontext_win.obj) : error LNK2019: unresolved external symbol _ImmAssociateContext@8 referenced in function "void __cdecl enableIme(class QWidget *,bool)" (?enableIme@@YAXPAVQWidget@@_N@Z)
    1>QtGuid.lib(qwininputcontext_win.obj) : error LNK2019: unresolved external symbol _ImmGetDefaultIMEWnd@4 referenced in function "struct HWND__ * __cdecl getDefaultIMEWnd(struct HWND__ *)" (?getDefaultIMEWnd@@YAPAUHWND__@@PAU1@@Z)
    1>C:\Users\acasella\Downloads\AxFoo\Debug\AxFoo.ex e : fatal error LNK1120: 13 unresolved externals

    sooo yes, it's seemed to be a pbm of installation. I had to compile Qt sources for visual 2010, maybe I did something wrong. I try to do it again, and I tell you.

  17. #16
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,329
    Thanks
    317
    Thanked 871 Times in 858 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: QtAxWidget link error

    Might be better to just download the binaries from qt-project.org. I am pretty sure they have 4.8 binaries pre-built for VS 2010.

  18. #17
    Join Date
    Dec 2012
    Posts
    13
    Thanks
    1

    Default Re: QtAxWidget link error

    Ok, just for you to know I needed to compile QT for my computer, now the error is gone.
    Thank you everyone.

  19. #18
    Join Date
    Sep 2011
    Posts
    1,241
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QtAxWidget link error

    well no sh!t Sherlock. That's (normally) the first thing you have to do when using Qt :-/
    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

Similar Threads

  1. moc link error
    By Zalwou06 in forum Qt Programming
    Replies: 3
    Last Post: 13th September 2012, 03:03
  2. Qt4 with MySQLon Win XP link error
    By FumblesMacStupid in forum Newbie
    Replies: 0
    Last Post: 7th May 2011, 19:17
  3. Replies: 11
    Last Post: 5th May 2011, 14:05
  4. Link error
    By emrares in forum Qt Programming
    Replies: 1
    Last Post: 12th November 2010, 13:45
  5. moc link error
    By user_mail07 in forum Qt Programming
    Replies: 3
    Last Post: 3rd July 2007, 19:30

Tags for this Thread

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.