0
votes

after building Qt using Visual Studio command prompt , my configure string: configure.exe -release

I try to test my first hello world application

#include <QtCore/QCoreApplication>
#include <iostream>
int main(int argc, char *argv[])
{
    QCoreApplication a(argc, argv);
    std::cout<<"hello";
    return a.exec();
}

but I got this error:

Error 1 error LNK1112: module machine type 'x64' conflicts with target machine type 'X86' c:\Users\Kato\documents\visual studio 2010\Projects\qhelloworld\qhelloworld\QtCore4.lib(QtCore4.dll) qhelloworld

any help??

2

2 Answers

2
votes

You have to change your target in project settings to x64 machine. How to do it depends on which IDE you use.

EDIT

So if you use MSVC 2010 you need to go Project->Properties->Linker->Advanced and here you should somewhere have Target machine. Change it to X64 (from the list).

0
votes

If you're using the Qt plugin for Visual Studio (which you really should be doing) the architecture of your Qt version and the architecture you are compiling your program for have to agree.

Look at "Qt -> Qt Project Settings", to see the Qt version your project is using and compare that with the platform entry found in "Project -> Properties".