LNK1112: module machine type 'x64' conflicts with target machine type 'X86': Qt creator



  • I have a application running on linux which I am trying to import on windows. I have set up all the libraries and also made changes to the .pro file. Now when I try to build the project I get this error:

    error: LNK1112: module machine type 'x64' conflicts with target machine type 'X86'

    I am not sure what is causing this issue.I am using the 32-bit Qt creator.I am using Qt creator and running the project through the Qt UI. So I am not sure what changes have to be done for the project properties through Qt if this has to be resolved.



  • I can't point directly how to solve the problem, but I doubt this is related to which QtCreator version you are using.
    All I can say this is result of the your executable linking against wrong lib (dll).
    This may be QT, CRT or any other libraries.
    Unfortunately we can't use Creator for development so I am not experienced enough with it to advice where to check it. Might be a good idea to check Projects\Dependencies or Projects\Build & Run

    Regards,
    Alex


  • Lifetime Qt Champion

    Hi,

    Are you by any chance linking to an external library that's built in 64bit and you project uses a 32bit Qt ?

    Like alex_malyu wrote, the fact that Qt Creator is 32bit has nothing to do with building your application.



  • I went through it and could not find a place where the linker properties could be changed. Do you know where I can change the qmake or linker properties in QT?



  • I am actually using omniORB4 and this error which is generated is from that .lib file(omniORB4d.lib). This is the configuration I have in my .pro file:

    win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../../../../../../../tango-root/tango/win64/lib/vc10/ -lomniORB4
    else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../../../../../../../tango-root/tango/win64/lib/vc10/ -lomniORB4d
    else:unix: LIBS += -L$$PWD/../../../../../../../../tango-root/tango/win64/lib/vc10/ -lomniORB4

    INCLUDEPATH += $$PWD/../../../../../../../../tango-root/tango/win64/lib/vc10
    DEPENDPATH += $$PWD/../../../../../../../../tango-root/tango/win64/lib/vc10



  • -L$$PWD/../../../../../../../../tango-root/tango/*win64/*lib/vc10/ -lomniORB4

    Having win64 in the path mostly guarantee that library was built as 64 bit, when your application seems as 32 bit.



  • My application is a 32bit because it is using Qt which is 32-bit.In that case how I can resolve this issue?How can we use libraries which are built on 64 bit on 32-bit applications.


  • Lifetime Qt Champion

    You can't mix architecture. If that libraries doesn't come in 32bit then use a Qt 64 bit package and from what I see, you should get the VS2010 version



  • I looked for a qt-64 bit package but I could not find any.could you let me know where I can get that package?


  • Lifetime Qt Champion

    My bad, there's only the Visual Studio 2013 that are available in 64bit however you can find "here":http://www.tver-soft.org/qt64 a set of user generated 64 builds



  • Thanks.Also do i need to have visual studio 2013 on my machine.I have 2008 and 2010 on my machine.



  • keep in mind that 32 bit will run on both 32 and 64 bit Windows when 64 bit only on 64 bit Windows.

    You can build Qt on your own if there are not binaries to download, also I guess you can either find or build 32 bit version of the 3rd party library yourself.



  • Yeah I got it but in that case when my Qt is 32-but why is it not able to execute libraries which are 64-bit?For external libraries which are 64-bit do we need Wt which is only 64-bit?



  • You need all modules be the same architecture.
    Either 32 bit or 64 bit.

    64 bit Windows allows you to run 32 bit application, but you still can't mix different binaries on any platform.

    You have to have all binaries built with the same architecture and most of the time with the same compiler with very little exceptions which are not applied to statically linked libraries.

    AFAIK if you have access to the already built libraries you need to make sure you get Qt version (as other dependencies) built with the same compiler including platform (32 or 64 bit).



  • I installed Qt 64-bit and I still have the same problem. When I configured the project it asked me to select a kit and I chose "Visual Studio 2010" which is the only kit that i have and it is 32-bit. So basically the compiler is 32-bit,is that why I am getting the same error?


  • Lifetime Qt Champion

    Did you add a new Kit that uses your newly installed Qt 64bit ?



  • Visual Studio 2010 has 2 compiler versions (in fact 3)
    32 bit, 64 bit and 32 bit compiler which produces 64 bit code.
    You need to make sure you configured creator to use proper compiler.

    As I mentioned I am not using creator, so can't give you direct advice how.


Log in to reply
 

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