Several questions with QtCreator [Solved]



  • I'm working on a project which should have GUI written in Qt. I'm thinking using QtCreator as a development IDE, but there are some problems I'm facing. The project should have a dll file which shouldn't be dependent on any qt library/module, it should use only winapi and it should be compiled with both x86 and x64. So my questions are:
    •Is it possible to use QtCreator to compile a dll which doesn't have any dependency on qt modules. If yes, how?
    •Is it possible to use MinGW x86 & x64 to compile a single project? If so, how can I specify which compiler to use?

    Although, every executable compiled from QtCreator has a dependency on LIBGCC_S_DW2-1.DLL and MSVCRT.DLL. Is it possible to remove a dependency on LIBGCC_S_DW2-1.DLL and link MSVCRT.DLL inside my exe/dll (just like MS VC does).
    This is my first project with Qt, and I'm not a C++ guru, so please describe the details as good as you can :-) Your help is much appreciated.



  • [quote] Is it possible to use QtCreator to compile a dll which doesn’t have any dependency on qt modules. If yes, how? [/quote]
    Yes absolutely, if you want to use qmake, add the following to your .pro file:
    @
    QT -= core gui
    @
    [quote]
    Is it possible to use MinGW x86 & x64 to compile a single project? If so, how can I specify which compiler to use?
    [/quote]
    You'll have to add a seperate build configuration for each x86 and x64 and invoke it appropriately (you cann add build configurations in the "Projects" tab)
    [quote]
    Although, every executable compiled from QtCreator has a dependency on LIBGCC_S_DW2-1.DLL and MSVCRT.DLL. Is it possible to remove a dependency on LIBGCC_S_DW2-1.DLL and link MSVCRT.DLL inside my exe/dll (just like MS VC does).
    [/quote]
    IIRC, MinGW does not allow MSVCRT.DLL to be linked statically due to licensing issues. However on most windows machines I have encountered, it was already installed (AFAIK, it is part of the VC redist, so if it isn't available you can use that). As for libgcc, you can use
    @
    win32 {
    QMAKE_LFLAGS += -static-libgcc
    }
    @
    in your .pro file.



  • Thanks loladiro, your post was helpful :)



  • No problem, feel free to ask any further questions. Also, could you please add [Solved] in front of the title (by editing the first post).



  • Forgot to mention one thing. To instruct qmake to not do anything Qt-spcific, you can/should also add:
    @
    CONFIG -= qt
    @
    to your .pro file


Log in to reply
 

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