Building ActiveQt Applications (COM) with MinGW

I am using Qt 4.6.3 with MinGW on Windows to create Qt applications and now you need to add a COM interface to my application. I enabled ActiveQt, but was getting post-link errors because I was missing a copy of the MIDL compiler. I downloaded a copy of the latest MS Windows SDK, which includes MIDL, but now MIDL complains that it cannot find cl.exe. The only conclusion I can make is that you can only create ActiveQt applications using the MS compiler, which I would prefer to avoid. Is there a way to get this to work with MinGW or am I out of luck?

+3
source share
5 answers

Using the MS compiler and tools seems to be the only reliable way to make this work.

+2
source

Well, you can create ActiveQt with MinGW, but using a bunch of COM files on top of this may not be possible because it may or may not be present in MinGW. Some thoughts:

  • Using any MS SDK tools with MinGW will not work (the exception is mingw.org + DXSDK, which should work most of the time).

  • Are you sure that when compiling you link all the necessary libraries? I can no longer help if you are not showing the exact error messages.

  • mingw-w32/w64 "Windows SDK GCC"; /, . x64 x86 DX. COM-, , , mingw.org. , .

+1

Wine midl, widl. . Windows.

, wine-prgs-0.9.14-mingw.zip , .

+1
+1

:

QtCreator, Msys2 VS2015.

Qt Creator script:

@echo off
call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86 8.1

setlocal
set MSYSTEM=MINGW32
set MSYS2_PATH_TYPE=inherit
start "" "C:\msys64\usr\bin\mintty" -i /msys2.ico -e /usr/bin/bash --login -c "/c/Qt/Tools/QtCreator/bin/qtcreator.exe"

exit /b 0

QtCreator Msys2 envioronment, Unix, . Msys2 .

: WinSDK 10.0 ( ), midl.exe PATH.

PATH Qt Creator ( gcc Qt), Msys2 next ( Unix) MSVC WinSDK 8.1 ( midl-).

dll WinSDK, .

0

Source: https://habr.com/ru/post/1752226/


All Articles