[Qt-creator] Building a plugin on windows.

Hugo Parente Lima hugo.pl at gmail.com
Wed Apr 20 16:31:47 CEST 2016



On Wed, Apr 20, 2016 at 5:30 AM, Eike Ziller <Eike.Ziller at qt.io> wrote:
> 
>>  On Apr 20, 2016, at 10:27 AM, Eike Ziller <eike.ziller at qt.io> wrote:
>> 
>>> 
>>>  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.
> 
> And I should add:
> 
> On Windows the Qt Creator packages do not contain all the necessary 
> files (*.lib) to develop against it anyhow.
> You need to do your own build of Qt Creator and link against that, 
> even when using MSVC2013.

This was exactly what happened, I compiled it against the QtC 
installed, not a custom build, so just a final question:

Will the plugin compiled with MinGW, linked against a QtC built with 
MinGW, load on the original QtC binary distribution?

I'm asking this because my final target is just to create a small 
installer for the plugin that works with some original QtC binary 
windows distribution.

Thanks everyone for the help.

- Hugo




More information about the Qt-creator mailing list