[Qt-interest] Static compilation disaster (Windows)
Paul England
pengland at cmt-asia.com
Sat Nov 20 04:35:58 CET 2010
On 11/20/10 00:07, Andreas Pakulat wrote:
> On 19.11.10 22:14:34, Paul England wrote:
>
>> Hi. Posted this in a forum at Qt-Centre but got no love. So, here we are.
>>
>> Trying to compile a program for Windows that doesn't need DLLs or the Qt
>> framework.
>>
>> I followed this guide
>> http://www.formortals.com/build-qt-static-small-microsoft-intel-gcc-compiler/
>>
>> The only point of interest in the above is Step 3. I cannot find
>> mingwvars.bat on my machine. :/ Does that matter? Outdated guide?
>>
>> Anyways... I continued on, and things seemed to be peachy. I configured
>> Qt w/ the -static option and built it.
>>
>> In my project file I added
>> CONFIG += static
>>
>> And compiled. I got a nice 10Mb file which ran find on my machine.
>> However, someone w/o the Qt Framework installed on both a 32-bit and
>> 64-bit box tried it and got two different errors.
>>
> I'm just getting an error that libgcc_s_dw2-1.dll is missing which the
> executable links against. And thats true, I don't have mingw installed here
> and hence there's no such dll. I have no idea wether this is mingw
> specific, but there's also libstdc++6 linked in which probably comes from
> mingw too. If you want static binaries that don't depend on anything else
> except MS standard libs, then maybe try building with the MS compile
> toolchain instead. Even then though you'll have to link dynamically against
> the MS runtime library, which means your users may need to install the
> apropriate runtime package from MS before they can run your app.
>
> Andreas
>
>
Hmm... Bummer.
The mingw install was pretty much standard. I assumed the idea of
static compilation was... well.... to not have anything else required:
not DLLs and not other packages. Maybe I'm missing something.
I assume re-distributing Qt DLLs w/ the package is not an option.
Paul
More information about the Qt-interest-old
mailing list