0

I need to create a Win32/DirectX project, which I started in VS2010, but I just can't stand it as a C++ IDE, so I'd prefer to use QtCreator instead.

I've tried two ways of doing it: creating a VS project in VS2010 and using Qt plugin to generate .pro file, and creating a plain C++ project in QtCreator and adding all dependencies myself. Unfortunately neither of this ways worked.

In the first case the option to generate a .pro file ("Create basic .pro file) from VS project is just disabled (even though I can open and build projects created in QtCtreator).

In the second case I'm not sure what do I need in my .pro file to avoid linker errors. For example below is an output of compiling an application that just shows a simple empty window together with my pro file:

enter image description here

Finally in QtCreator I have to explicitly specify all string as LPCSTR with L"string" while VS doesn't seem to complain about it. Any way around this?

4

1 回答 1

0

您确定您的 Windows SDK 安装正确吗?你可以从这里得到它:http: //www.microsoft.com/en-us/download/details.aspx?id=8279。为了安装它,我不得不取出一个更新的 Visual C++ 分发包,但它后来又回来了。您所有的链接问题似乎都来自核心 Win32 的东西,所以这是我对出了什么问题的猜测。

我刚决定试一试 QT Creator,在设置东西时遇到了这个页面,但它现在可以工作了,我的项目文件几乎和你的一样,所以我会检查安装。我使用的是 DX9 而不是 10(计划支持 9 和 11),但就像我说的那样,您的链接错误不是来自 DirectX。

SDK 中的 msvc 编译器据说可以与 QT Creator 一起使用,但我还没有尝试过。我正在使用 MINGW,工作正常,COM 可以跨编译器工作,这就是时髦的 C 风格界面的重点。我进行了切换,因为我有一个想法,使用 msvc 尚不支持的 c++11“默认”关键字更容易。我可以为我的基本数据类使用构造函数,并且仍然可以使用 memset 和 memcpy,并在联合等中使用它们。

于 2013-02-10T23:35:23.693 回答