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?

jaho
  • 4,852
  • 6
  • 40
  • 66
  • I don't think you can, Microsoft distributes the DX SDK for Visual Studio ABI, QT and the biggest part of the rest of the world use gcc/mingw ABI, you have to stick with Visual Studio since Microsoft doesn't share the source and you can't recompile the DX. – user1849534 Dec 17 '12 at 21:31
  • The linker errors I get above are from winapi and not directx. I'm including `Windows.h`, but I assume I also need to link some libraries. There's no `Windows.lib` in windows API. – jaho Dec 17 '12 at 21:40
  • it's the same thing, in a nutshell if you want to code with technologies made by Microsoft you have to stick with VS. You don't have an alternative solution. – user1849534 Dec 17 '12 at 21:45
  • According to this question it's possible: http://stackoverflow.com/questions/1641286/using-qt-with-directx?rq=1 – jaho Dec 17 '12 at 21:51
  • it's basically the same solution as with OpenGL, you create a new context everytime you need OpenGL, it's basically an handler for what happens outside the program and it's used to draw inside the window. It's not a solution, show me how to code in DirectX with QT, not how to handle DirectX inside QT. – user1849534 Dec 17 '12 at 21:55
  • Why you can't stand VS as s C++ IDE? – zdd Dec 18 '12 at 02:54
  • It's lack of many of the features that other IDEs have just makes me a lot less productive. To name a few: refactoring (e.g. rename the symbol under cursor), auto-completion for function signatures (e.g. I have `f(int a, int b)` in the header file, in cpp when I type `f(` i get the option to autocomplete to `int a, int b)`), a shortcut to switch between header and cpp file, – jaho Dec 18 '12 at 17:24
  • automatically updating function signatures (e.g. I change f() to `f(int a, int b, int c)` in cpp/h file, others get automatically changed if I want), having to press ctrl+enter for auto-complete instead of just enter, highlighting all variable occurrences in a file by selecting it etc. A lot of tiny things (except refactoring which I just don't get why it's missing) that annoy me at every step. – jaho Dec 18 '12 at 17:25
  • 1
    you are just solving one problem by creating a bigger one. you can use the Visual Assistant X for visual studio or found some plugins for VS which will improve your productivity. – zdd Dec 19 '12 at 05:40
  • @zdd: it seems like the best solution. – jaho Dec 20 '12 at 01:14

1 Answers1

0

Are you sure your Windows SDK is installed right? You can get it from here: http://www.microsoft.com/en-us/download/details.aspx?id=8279. To get it installed I had to take out a more recent Visual C++ distributable, but it went back in after. All your link problems seem to be from core Win32 stuff, so that's my guess as to what's wrong.

I just decided to give QT Creator a try and came across this page while I was getting stuff set up, but it's working now and my project file is almost identical to yours, so I would check the installation. I am using DX9 instead of 10 (plan to support 9 and 11), but like I said your link errors aren't coming from DirectX.

The msvc compilers in the SDK supposedly work with QT Creator, but I haven't tried them. I am using MINGW, works fine, COM works across compilers, that's the whole point of the funky C style interface. I made the switch because I have an idea that is a lot easier using the c++11 "default" keyword that isn't supported in msvc yet. I can have constructors for my basic data classes, and still be able to use memset and memcpy, and use them in unions, etc.