Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 727759
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T06:36:14+00:00 2026-05-14T06:36:14+00:00

After reading this article http://lukast.mediablog.sk/log/?p=155 I decided to use mingw on linux to compile

  • 0

After reading this article http://lukast.mediablog.sk/log/?p=155 I decided to use mingw on linux to compile windows applications. This means I can compile, test, debug and release directly from Linux.

I hacked this build script which will cross compile the application and even package it in a ZIP file. Note that I am using out of source builds for QMake (did you even know this is supported? wow…). Also note that the script will pull the needed DLLs automagically. Here is the script for you all internets to use and abuse:

#! /bin/sh

set -x
set -e

VERSION=0.1
PRO_FILE=blabla.pro
BUILD_DIR=mingw_build
DIST_DIR=blabla-$VERSION-win32

# clean up old shite
rm -fr $BUILD_DIR
mkdir $BUILD_DIR
cd $BUILD_DIR

# start building
QMAKESPEC=fedora-win32-cross qmake-qt4 QT_LIBINFIX=4 config=\"release\ quiet\" ../$PRO_FILE
#qmake-qt4 -spec fedora-win32-cross
make

DLLS=`i686-pc-mingw32-objdump -p release/*.exe  | grep dll | awk '{print $3}'`
for i in $DLLS mingwm10.dll ; do 
    f=/usr/i686-pc-mingw32/sys-root/mingw/bin/$i
    if [ ! -f $f ]; then continue; fi
    cp -av $f release
done

mkdir -p $DIST_DIR
mv release/*.exe $DIST_DIR
mv release/*.dll $DIST_DIR
zip -r ../$DIST_DIR.zip $DIST_DIR

The compiled binary works on the Windows7 machine I tested. Now to the questions:

  • When I execute the application on Windows, the theme is not the Windows7 theme. I assume I am missing a style module, I am not really sure yet.
  • The application gets a console window for some reason.

The second point (the console window) is critical. How can I remove this background window? Please note that the extra config lines are not working for me, what am I missing there?

Edit 1 (planning a few):

The compilation line is:

i686-pc-mingw32-g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc -Wl,-s -o release/font_export.exe object_script.font_export.Release  -L"/usr/i686-pc-mingw32/sys-root/mingw/lib" -lQtGui4 -lQtCore4 

The -subsystem,windows switch is added only when “CONFIG+=windows” and this is ignored in other OSes. My guess is that the MinGW port of Qt is getting confused “I am running on Linux, I need to ignore the windows/console configuration”. This means I need to edit the corresponding qmake.spec file. arhg… I hate bugs. I still need to verify that this fixes the problem….

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T06:36:15+00:00Added an answer on May 14, 2026 at 6:36 am

    I suspect that your theme problem is te result of a missing application manifest

    The reason that your app gets a console is simple. Windows apps come in two flavors, Console and GUI. The difference is a bit in the PE header of the EXE. GCC’s default is to generate a Console app, and e8johan explains how to change that (-Wl,-subsystem,windows). There’s also some fooling around with entry points (GUI’s are expected to use WinMain(), and console apps main()) but MinGW should take care of that

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

After reading this article http://camendesign.com/code/developpeurs_sans_frontieres I have decided to follow what it says and
After reading this article I don't have a clear answer: http://palizine.plynt.com/issues/2010Oct/bypass-xss-filters/ Will browsers interpret
After reading this: http://docs.djangoproject.com/en/dev/ref/contrib/csrf/#how-to-use-it I came to the conclusion that it is not valid
I was looking at using Amazon's EC2 service after reading this article: http://www.ibm.com/developerworks/java/library/j-javadev2-4/index.html But
I'm asking the question after reading this article http://stevehanov.ca/blog/index.php?id=95 Also isn't it a penalty
after reading this article: http://css-tricks.com/absolute-positioning-inside-relative-positioning/ i am trying to achieve vertically stacked divs each
After reading this article, it makes sense to rebase to gather changes from the
After reading this article on thedailywtf.com, I'm not sure that I really got the
I was under the impression, after reading this article that it is better to
After reading this post, and the suggestion to use Team Edition for Database Professionals

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.