I'm using QT (4.7.3) and I'd like to make normal VS solution/project files, build it, and step through the code with debugger to learn the code while reading tutorial...
Instead I have that yet another make qmake which supposed to be able to generate vs solution/project files but it seems that all it generates is some junk empty project files.
Here's what I did (from QT command promt):
cd c:\qt\4.7.3\examples\tutorial
qmake -t vcsubdirs
qmake -t vcapp
qmake -tp vc
but all of them generate random junk or errors...
I assume that I can also generate such solution for entire QT (from c:\qt\4.7.3) to build it from source...
What's the proper way to do it? It has tight integration with VS (designer, add-in etc) it just doesn't make sen开发者_开发百科se that there is no normal solutions/project files there.
Did I do something wrong, or VS is kind of unsupported build platform? :)
Except for a few modes, like -project
, qmake expects a valid project file to exist before you run those options. You'll also want to make sure that you're using a QMAKESPEC that corresponds to one of the MSVC versions. This SO post has some good details. To summarize:
- Create your project file
- Set your QMAKESPEC
- Generate the solution file from the project file
That might look something like this:
$ qmake -project
$ set QMAKESPEC=win32-msvc2008
$ qmake -tp vc
qmake -project
will regenerate the project file, so don't do that if you have modified your project file at all. The qtnode website also has some good information on using Qt4 with visual studio.
精彩评论