[howto] distinguish between console- and windows-application?



  • the Qt suite fails to build inside the qml-viewer, ''it'' thinks that the qmlviewer.exe is a windows-application and thus the linker fails finding "wmain()" - it should have looked for "main()" instead...

    how is this handled?

    • the qml.pro TEMPLATE is set to "app" <-- is this a console application or a windows application?

    in my qmake.conf I have seperate entries for each:

    QMAKE_LFLAGS_CONSOLE = /SUBSYSTEM:WINDOWSCE,7.00 /MACHINE:THUMB /ENTRY:mainACRTStartup
    QMAKE_LFLAGS_WINDOWS = /SUBSYSTEM:WINDOWSCE,7.00 /MACHINE:THUMB /ENTRY:mainWCRTStartup

    so, for console applications "mainACRTStartup" is called which in turn calls "main()"; for windows applications "mainWCRTStartup" is called which in turn calls "wmain()"...

    what must be changed to use "QMAKE_LFLAGS_CONSOLE" i.s.o. "QMAKE_LFLAGS_WINDOWS" when building qml ??



  • I found that out by myself - no help from here :-(

    actually a "CONFIG += console" was missing for a lot of "TEMPLATE = app" project files, don't know why but that was what was missing...

    problem only existed for my WinEA7 cross-compilation installment, my native Windows installment went thru without complaining...



  • [quote author="joergs1968" date="1305571951"]I found that out by myself - no help from here :-([/quote]

    Crying will most probably not change this....



  • [quote author="Volker" date="1305580370"]
    [quote author="joergs1968" date="1305571951"]I found that out by myself - no help from here :-([/quote]

    Crying will most probably not change this....[/quote]
    lol



  • very funny...

    what should have I done to get some help?



  • Sometimes no one has an answer to one's problems. This is live - you will not change it. But yelling at people that they were not of help will most probably make them ignore your posts in the future completely, even if one would have an answer.

    Always remember:
    This forum, and the entire DevNet lives from volunteeers, doing the support in their spare time for nothing than fun and a little badge here and then.

    Oh, and I personally, would be proud to have found the solution myself, instead of blaming others not having helped.



  • First of all: thank you for reporting back with your solution at all. That is useful for future reference.

    Then, note the page in Volkers signature. That webpage, although geared towards mailing lists or usenet forums, gives you a lot of information on how to formulate questions in such a way as to invoke the interest of (skilled) readers. Perhaps a better start post or a clearer topic item might have invoked more reactions, though to be honest, it is not the worst one I have seen around here.

    Read that page. If nothing else, I found it a fun read.



  • my bad, sorry

    actually it was my fault from the beginning, as I thought in windows terms:

    console application: main() gets called...
    windows application: WinMain() gets called...

    apparently this is not the case for Qt as it's main purpose is to be portable, meaning: main() gets called everywhere

    for the ":-(" I'd like to appologize, I simply over-reacted...


  • Moderators

    I think your frustration culminated just in this thread of yours. I have been wondering after your first reply why it hasn't triggered any feedback in the first place.

    Andre is completely right there are other threads being worde, but they trigger responses.

    However, to give this a different focus.
    Is there a way to trigger responses from Qt's experts?
    I left out the adjective "professional" in order to avoid aversions by others. Because the responses are from professionals volunteering to do so in the forum. And certainly I do not intend to steer up things.

    The other thread of joergs1968 seem to be more the reason of his frustration. And response from someone with deep insight to the compilation guts of Qt would have been probably helpful.


  • Moderators


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.