Results 1 to 1 of 1

Thread: Cannot build Qt SIP project on Windows: gives linkage errors (metacast,metacall,etc)

  1. #1
    Join Date
    Sep 2015
    Posts
    1
    Platforms
    Windows

    Default Cannot build Qt SIP project on Windows: gives linkage errors (metacast,metacall,etc)

    I have a QWidget, written in C++. I want to create a SIP Python wrapper for it to embed it into another PyQt application.
    It is possible, if PyQt is linked against the same version of Qt as embeddable widget is linked.

    There is even an example on such embedding: the example and some talks about itу.
    And I have even built it under Linux without any problems, just by the manual.
    And it even worked!

    But for Windows it was not so easy.
    I installed Qt 5.8.0. Downloaded SIP sources, built SIP, installed it with make install. Okay, SIP installed.
    Then I downlaoded PyQt5 sources, built it (here is a tutorial), copied Qt DLLs into site-packages/PyQt5 -- and PyQt also started working. Okay so far...

    But when I tried to build the example from https://github.com/eyllanesc/Qt5toPyQt5 , it failed.

    What I did?

    I did python3 configure.py -- okay, it passed, Makefiles created.
    Qt Code:
    1. D:\Projects\Qt5toPyQt5>C:/Python35/python configure.py
    2. QMake version 3.1
    3. Using Qt version 5.8.0 in D:/Libs/Qt5.8.0/5.8/msvc2015_64/lib
    4. C:\Python35\sip -t WS_WIN -t Qt_5_8_0 *-I D:\Projects\Qt5toPyQt5\sip -I C:\Python35\sip\PyQt5 -I C:\Python35\include -I D:\Projects\Qt5toPyQt5\src -c D:\Projects\Qt5toPyQt5\modules -b D:\Projects\Qt5toPyQt5\modules\PyAnalogClock.sbf -w -o D:\Projects\Qt5toPyQt5\sip\PyAnalogClock.sip
    5.  
    6. qmake -spec win32-msvc2010
    7. Info: creating stash file D:\Projects\Qt5toPyQt5\src\.qmake.stash
    To copy to clipboard, switch view to plain text mode 


    But when I tried to build the Makefile with nmake (Visual Studio 2015 Pro), it crashed:
    Qt Code:
    1. D:\Projects\Qt5toPyQt5>nmake
    2.  
    3. Microsoft (R) Program Maintenance Utility Version 14.00.23506.0
    4. Copyright (C) Microsoft Corporation. *All rights reserved.
    5.  
    6. * * * *cd src
    7. * * * *"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64\nmake.exe"
    8.  
    9. Microsoft (R) Program Maintenance Utility Version 14.00.23506.0
    10. Copyright (C) Microsoft Corporation. *All rights reserved.
    11.  
    12. * * * *"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64\nmake.exe" -f Makefile.Release
    13.  
    14. Microsoft (R) Program Maintenance Utility Version 14.00.23506.0
    15. Copyright (C) Microsoft Corporation. *All rights reserved.
    16.  
    17. * * * *cl -BxD:\Libs\Qt5.8.0\5.8\msvc2015_64\bin\qmake.exe -nologo -Zc:wchar_t -O2 -MD -GR -W3 -w34100 -w34189 -w44996 -E -Za ..\..\..\Libs\Qt5.8.0\5.8\msvc2015_64\mkspecs\features\data\dummy.cpp 2>NUL >release\moc_predefs.h
    18. * * * *D:\Libs\Qt5.8.0\5.8\msvc2015_64\bin\moc.exe -DUNICODE -DWIN32 -DWIN64 -DANALOGCLOCK_LIBRARY -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DNDEBUG --compiler-flavor=msvc --include release/moc_predefs.h -ID:/Libs/Qt5.8.0/5.8/msvc2015_64/mkspecs/win32-msvc2010 -ID:/Projects/Qt5toPyQt5/src -ID:/Libs/Qt5.8.0/5.8/msvc2015_64/include -ID:/Libs/Qt5.8.0/5.8/msvc2015_64/include/QtWidgets -ID:/Libs/Qt5.8.0/5.8/msvc2015_64/include/QtGui -ID:/Libs/Qt5.8.0/5.8/msvc2015_64/include/QtANGLE -ID:/Libs/Qt5.8.0/5.8/msvc2015_64/include/QtCore -I"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" -I"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" -I"C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" -I"C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" -I"C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\shared" -I"C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\um" -I"C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\winrt" -I"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" -I"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" -I"C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" -I"C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" -I"C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\shared" -I"C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\um" -I"C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\winrt" analogclock.h -o release\moc_analogclock.cpp
    19. * * * *cl -c -nologo -Zc:wchar_t -O2 -MD -GR -W3 -w34100 -w34189 -w44996 -EHsc -DUNICODE -DWIN32 -DWIN64 -DANALOGCLOCK_LIBRARY -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DNDEBUG -I. -I..\..\..\Libs\Qt5.8.0\5.8\msvc2015_64\include -I..\..\..\Libs\Qt5.8.0\5.8\msvc2015_64\include\QtWidgets -I..\..\..\Libs\Qt5.8.0\5.8\msvc2015_64\include\QtGui -I..\..\..\Libs\Qt5.8.0\5.8\msvc2015_64\include\QtANGLE -I..\..\..\Libs\Qt5.8.0\5.8\msvc2015_64\include\QtCore -Irelease -I..\..\..\Libs\Qt5.8.0\5.8\msvc2015_64\mkspecs\win32-msvc2010 -Forelease\ @C:\Users\felix\AppData\Local\Temp\nm6846.tmp
    20. analogclock.cpp
    21. * * * *cl -c -nologo -Zc:wchar_t -O2 -MD -GR -W3 -w34100 -w34189 -w44996 -EHsc -DUNICODE -DWIN32 -DWIN64 -DANALOGCLOCK_LIBRARY -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DNDEBUG -I. -I..\..\..\Libs\Qt5.8.0\5.8\msvc2015_64\include -I..\..\..\Libs\Qt5.8.0\5.8\msvc2015_64\include\QtWidgets -I..\..\..\Libs\Qt5.8.0\5.8\msvc2015_64\include\QtGui -I..\..\..\Libs\Qt5.8.0\5.8\msvc2015_64\include\QtANGLE -I..\..\..\Libs\Qt5.8.0\5.8\msvc2015_64\include\QtCore -Irelease -I..\..\..\Libs\Qt5.8.0\5.8\msvc2015_64\mkspecs\win32-msvc2010 -Forelease\ @C:\Users\felix\AppData\Local\Temp\nm6C2D.tmp
    22. moc_analogclock.cpp
    23. * * * *lib /NOLOGO */OUT:release\analogclock.lib @C:\Users\felix\AppData\Local\Temp\nm6FE6.tmp
    24. * * * *cd D:\Projects\Qt5toPyQt5\modules
    25. * * * *"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64\nmake.exe"
    26.  
    27. Microsoft (R) Program Maintenance Utility Version 14.00.23506.0
    28. Copyright (C) Microsoft Corporation. *All rights reserved.
    29.  
    30. * * * *cl -c -nologo -Zm200 -Zc:wchar_t- -FS -Zc:strictStrings -D_HAS_EXCEPTIONS=0 -O2 -MD -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -DNDEBUG -DAnalogClock_LIBRARY -DQT_CORE_LIB -DQT_GUI_LIB -DQT_WIDGETS_LIB -DUNICODE -DWIN32 -I. -ID:\Projects\Qt5toPyQt5\src -ID:\Libs\Qt5.8.0\5.8\msvc2015_64\include -ID:\Libs\Qt5.8.0\5.8\msvc2015_64\include\QtCore -ID:\Libs\Qt5.8.0\5.8\msvc2015_64\include\QtGui -ID:\Libs\Qt5.8.0\5.8\msvc2015_64\include\QtWidgets -IC:\Python35\include -Fo @C:\Users\felix\AppData\Local\Temp\nm7032.tmp
    31. sipPyAnalogClockcmodule.cpp
    32. sipPyAnalogClockAnalogClock.cpp
    33. Generating Code...
    34. * * * *link /NOLOGO /DYNAMICBASE /NXCOMPAT /DLL /MANIFEST /MANIFESTFILE:PyAnalogClock.pyd.manifest /SUBSYSTEM:WINDOWS /INCREMENTAL:NO /OUT:PyAnalogClock.pyd @C:\Users\felix\AppData\Local\Temp\nm7957.tmp
    35. * Creating library PyAnalogClock.lib and object PyAnalogClock.exp
    36. sipPyAnalogClockAnalogClock.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual struct QMetaObject const * __cdecl AnalogClock::metaObject(void)const " (__imp_?metaObject@AnalogClock@@UEBAPEBUQMetaObject@@XZ) referenced in function "public: virtual struct QMetaObject const * __cdecl sipAnalogClock::metaObject(void)const " (?metaObject@sipAnalogClock@@UEBAPEBUQMetaObject@@XZ)
    37. sipPyAnalogClockAnalogClock.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual void * __cdecl AnalogClock::qt_metacast(char const *)" (__imp_?qt_metacast@AnalogClock@@UEAAPEAXPEBD@Z) referenced in function "public: virtual void * __cdecl sipAnalogClock::qt_metacast(char const *)" (?qt_metacast@sipAnalogClock@@UEAAPEAXPEBD@Z)
    38. sipPyAnalogClockAnalogClock.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual int __cdecl AnalogClock::qt_metacall(enum QMetaObject::Call,int,void * *)" (__imp_?qt_metacall@AnalogClock@@UEAAHW4Call@QMetaObject@@HPEAPEAX@Z) referenced in function "public: virtual int __cdecl sipAnalogClock::qt_metacall(enum QMetaObject::Call,int,void * *)" (?qt_metacall@sipAnalogClock@@UEAAHW4Call@QMetaObject@@HPEAPEAX@Z)
    39. sipPyAnalogClockAnalogClock.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl AnalogClock::AnalogClock(class QWidget *)" (__imp_??0AnalogClock@@QEAA@PEAVQWidget@@@Z) referenced in function init_type_AnalogClock
    40. sipPyAnalogClockAnalogClock.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) protected: virtual void __cdecl AnalogClock::paintEvent(class QPaintEvent *)" (__imp_?paintEvent@AnalogClock@@MEAAXPEAVQPaintEvent@@@Z) referenced in function meth_AnalogClock_paintEvent
    41. sipPyAnalogClockAnalogClock.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static struct QMetaObject const AnalogClock::staticMetaObject" (__imp_?staticMetaObject@AnalogClock@@2UQMetaObject@@B) referenced in function "void __cdecl `dynamic initializer for 'plugin_AnalogClock''(void)" (??__Eplugin_AnalogClock@@YAXXZ)
    42. PyAnalogClock.pyd : fatal error LNK1120: 6 unresolved externals
    43. NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64\link.EXE"' : return code '0x460'
    44. Stop.
    45. NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64\nmake.exe"' : return code '0x2'
    46. Stop.
    To copy to clipboard, switch view to plain text mode 

    Can I somehow cope with it?
    Last edited by Felix-Neko; 25th June 2017 at 14:03.

Similar Threads

  1. help Qt-metacast error
    By ChemistBob in forum Newbie
    Replies: 2
    Last Post: 10th January 2015, 08:34
  2. Qt Creator How do I build project in current directory on Windows?
    By Coolname007 in forum Qt Tools
    Replies: 2
    Last Post: 5th October 2012, 04:48
  3. How to filter QEvent::MetaCall
    By gilamran in forum Newbie
    Replies: 0
    Last Post: 4th January 2011, 19:59
  4. Windows CE 5.0 Application & Build errors
    By augusbas in forum Qt for Embedded and Mobile
    Replies: 3
    Last Post: 23rd August 2010, 14:29
  5. Unexpected build errors in a Qt project
    By prykHetQuo in forum Qt Programming
    Replies: 2
    Last Post: 24th January 2010, 22:33

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.