Qt+VS2012+Win8 64Bit installation

Learning Qt Bird, I didn't listen to @ Coding_Peon ( http://weibo.com/u/1764451551?topnav=1&wvr=5&topsug=1 ) and learn QT and Python well, and I still have to learn it now. . .

So I started looking for the installation file of Qt. In early July 2013, Qt5.1.0 was released, so I directly looked for the latest download. During the download process, I found that there are http://qt-project.org  and  qt .digia.com , among which qt-project is the open source version, and digia is the commercial version, so if you want to go to the project for free, because nokia sells qt to digia, so there have been some changes in the finishing of the previous concentration.

Download separately, Qt installation file http://mirrors.ustc.edu.cn/qtproject/official_releases/qt/5.1/5.1.0/qt-windows-opensource-5.1.0-msvc2012_opengl-x86_64-offline.exe

 

and VS plugin  http://download.qt-project.org/official_releases/vsaddin/qt-vs-addin-1.2.2-opensource.exe  

Links to many resources can be found here: http://www.qtcn.org/bbs/read.php?tid=1075

Just install it by default.

(Please correct me if there are any omissions or mistakes below)   

First up: platform issues  x86 and  64

Since the download is 64 -bit, it is necessary to modify the project properties to correspond to 64 -bit. There are a few things that need to be modified

The first is that Qt  Versions  has installed Qt  and  vs add in , but it has not been added automatically. It needs to be added manually before use. You can click on the add shown in the figure below to select the installation path.

Select path directly in the box that pops up after add

In addition , the places where 64 -bit needs to be set are in the properties of the project:

Inside Linker

Sometimes it will be found that the prompt does not match. It may be restored in some places, or it needs to be set again after reset. For example, the Qt  Project Settings here needs to be re-selected after changing from 32 -bit to 64 -bit.

 

 Here are some others that are often encountered when compiling and linking:

  1. The header file contains problems such as include\QtWidgets include\QtANGLE, etc. When encountering these problems, the include path is not set completely. If it is not too troublesome, you can write the full path where the error is prompted. For example, if the prompt  

Cannot open “GLES2/gl2.h” 如果将路径修改成#include<QtANGLE/GLES2/gl2.h>

但这样太过繁琐,其实只需要在包含目录里面将对应路径包含即可,比如添加了QtANGLE那么gl2的提示就不存在了,后续可能还需要QLabel需要添加QWidget的目录,到时候缺什么添什么

  1. 环境变量问题,因为直接安装后是在VS里面可以看到是C:\Qt\Qt5.1.0\5.1.0\msvc2012_64  如果直接添加C:\Qt\Qt5.1.0为环境变量不知什么效果
  2. 链接错误error LNK2019: unresolved external symbol "__declspec(dllimport) 之类

我们可以看到在

在这里有$(QTDIR)\lib那么说明lib的路径是设置了,但是这里提示找不到,对应的lib,说明有地方没有设置正确,由于这里提示的是Qwidget,于是在这里添加了(关于QTDIR可以在很多地方通过查询宏查看,比如设置的时候点击edit选择macros

Qt5Widget.lib

  1. 报如下的错误

原来是如http://blog.csdn.net/muyuyuzhong/article/details/7034301

或者如:

nimingzhe2008 wrote:

I got it.I should use QApplication instead of QCoreApplication in main.cpp.

Yeah That’s Correct. QCoreApplication is used for non GUI Applications. For more details check this QCoreApplication Class Reference. [qt-project.org]

 

来自 <http://qt-project.org/forums/viewthread/21624>

如下面的代码:

//#include <QtCore/QCoreApplication>

#include <QApplication>

#include <QtGui>

#include <QLabel>

 

int main(int argc, char *argv[])

{

//QCoreApplication a(argc, argv);

QApplication a(argc, argv);

QLabel *label = new QLabel(QObject::tr("Hello world!"));

label->show();

return a.exec();

}

 结果:

 

相关的一些配置链接:http://evilpenguin.cn/archives/505

                            http://blog.csdn.net/xiaozz_m608c/article/details/9214741

 

顺便说下:在对于买手机上问了下师兄,我说Mate大屏好啊,然后问有1G版和2G版本,但差价比较大怎么破,他说关系也不很大,如果1G的话可能就是你前面开的应用后面再开其他的时候会被关掉鸟。不过很重要的一点是要买港行不要买国行,我说Why,国航哪里烂!

他说:国航把GSM给阉割了,而GSM是谷歌的统一处理平台,因为我们有很多APP都有消息需要接收并分发,但是如果每个进程都留一个后台程序保持常连接在手机中那这负担也就太大了,虽然可以及时收到信息。而通过GSm平台相当于有一个管家在综合负责所有这些app的消息接收以及分发,因此就不用没人一管家,再加上谷歌设计的轻便因此会有很好的优化,此外有了这个GSM才可以进行谷歌账号联网并进行一些谷歌提供的服务等,但在国行都被阉割掉了,都木有了。。

而国内各家自成一体又不可能协商一致做个统一平台,因此只有你一个后台我一个后台等等,或者隔一段时间去咨询下有没消息之类,因此在耗电的同时也带来了较多的延迟,wp也是一样的。由于这么多后台因此什么省电模式也不见得真能保持这种省电状态。

此外,WPIOS都是伪多线程,也就是只有他们自家的进程才可以后台运行,而外面的进程在切换后都是挂起的!那怎么办呢,怎么能听歌呢?其实这时候就是说外面的程序可以调用系统的一些进程,因此比如你千千静听,然后切换就调用了系统自带的播放软件这样也达到了后台播放的效果。也因此IOS上没有BT下载,因为ios本身不支持bt下载。不过如果你的手机可以刷带GSM的包,那其实也可以哦!



转  http://www.cnblogs.com/dawnWind/p/QT_00.html

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324855331&siteId=291194637