[Qt-creator] Building a plugin on windows.

Eike Ziller Eike.Ziller at qt.io
Wed Apr 20 10:27:47 CEST 2016


> On Apr 20, 2016, at 10:25 AM, Eike Ziller <eike.ziller at qt.io> wrote:
> 
>> 
>> On Apr 20, 2016, at 7:44 AM, Hugo Parente Lima <hugo.pl at gmail.com> wrote:
>> 
>> Hi,
>> 
>> I'm a newbie about Windows but started to try to compile my QtC plugin under a Windows7 VM, I did the following steps:
>> 
>> 1. Installed Qt + QtCreator (checked some MSVC runtime libraries too).
>> 2. Cloned QtC and checked it to version 3.6.1.
>> 3. Cloned my plugin[1] and checked it to branch qtc-3.6.
>> 4. Did open the plugin project (.pro) into QtCreator.
>> 5. Added QTC_SOURCE and QTC_BUILD variables to the qmake call.
>> 
>> Triggered the compilation and everything went fine until... link time, on Windows my plugin is looking for some dependencies unknow to me, here the linker output.
>> 
>> 
>> 02:30:05: Starting: "C:\Qt\Tools\mingw492_32\bin\mingw32-make.exe"
>> C:/Qt/Tools/mingw492_32/bin/mingw32-make -f Makefile.Release
>> mingw32-make[1]: Entering directory 'C:/Users/IEUser/Documents/GitHub/build-ruby-Desktop_Qt_5_6_0_MinGW_32bit-Release'
>> g++ -Wl,-s -shared -Wl,-subsystem,windows -mthreads -Wl,--out-implib,C:\Qt\Tools\QtCreator\lib\qtcreator\plugins\libRuby.a -o C:\Qt\Tool
>> s\QtCreator\lib\qtcreator\plugins\Ruby.dll object_script.Ruby.Release  -LC:\Qt\Tools\QtCreator\lib\qtcreator -LC:\Qt\Tools\QtCreator\lib
>> \qtcreator\plugins -lCore -lTextEditor -lProjectExplorer -lAggregation -lExtensionSystem -lQtcSsh -lUtils -LC:\Qt\5.6\mingw49_32\lib C:\
>> Qt\5.6\mingw49_32\lib\libQt5Widgets.a C:\Qt\5.6\mingw49_32\lib\libQt5Gui.a C:\Qt\5.6\mingw49_32\lib\libQt5Concurrent.a C:\Qt\5.6\mingw49
>> _32\lib\libQt5Network.a C:\Qt\5.6\mingw49_32\lib\libQt5Core.a
>> C:/Qt/Tools/mingw492_32/bin/../lib/gcc/i686-w64-mingw32/4.9.2/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lAggregation
>> C:/Qt/Tools/mingw492_32/bin/../lib/gcc/i686-w64-mingw32/4.9.2/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lExtensionSystem
>> C:/Qt/Tools/mingw492_32/bin/../lib/gcc/i686-w64-mingw32/4.9.2/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lQtcSsh
>> C:/Qt/Tools/mingw492_32/bin/../lib/gcc/i686-w64-mingw32/4.9.2/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lUtils
>> collect2.exe: error: ld returned 1 exit status
>> Makefile.Release:168: recipe for target 'C:\Qt\Tools\QtCreator\lib\qtcreator\plugins\Ruby.dll' failed
>> mingw32-make[1]: *** [C:\Qt\Tools\QtCreator\lib\qtcreator\plugins\Ruby.dll] Error 1
>> mingw32-make[1]: Leaving directory 'C:/Users/IEUser/Documents/GitHub/build-ruby-Desktop_Qt_5_6_0_MinGW_32bit-Release'
>> makefile:34: recipe for target 'release’ failed
> 
> To me it looks like you tried to build your plugin in Release against a Qt Creator in Debug, so it tries to find e.g. Aggregation.dll where there is only Aggregationd.dll etc (note the additional ‘d’ at the end).

Hm, actually it looks like you built against the release build of Qt Creator that comes with the Qt package
C:\Qt\Tools\QtCreator\lib\qtcreator\plugins

The Qt Creator packages are built with MSVC2013. You cannot link a MinGW compiled plugin against that.

> Br, Eike
> 
>> Ugly as an usual linker output, but these 3 plugins were not in Windows QtC install, however these plugins exists when I compile QtC on Linux. should I add some Windows specific flag in the .pro?
>> 
>> Thanks in advance.
>> 
>> [1] https://github.com/hugopl/RubyCreator/
>> 
>> _______________________________________________
>> Qt-creator mailing list
>> Qt-creator at qt-project.org
>> http://lists.qt-project.org/mailman/listinfo/qt-creator
> 
> -- 
> Eike Ziller
> Principal Software Engineer
> 
> The Qt Company GmbH
> Rudower Chaussee 13, D-12489 Berlin
> Geschäftsführer: Mika Pälsi, Juha Varelius, Tuula Haataja
> Sitz der Gesellschaft: Berlin, Registergericht: Amtsgericht Charlottenburg, HRB 144331 B

-- 
Eike Ziller
Principal Software Engineer

The Qt Company GmbH
Rudower Chaussee 13, D-12489 Berlin
Geschäftsführer: Mika Pälsi, Juha Varelius, Tuula Haataja
Sitz der Gesellschaft: Berlin, Registergericht: Amtsgericht Charlottenburg, HRB 144331 B





More information about the Qt-creator mailing list