久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

如何為 Visual Studio 2010 構建 Qt

How to build Qt for Visual Studio 2010(如何為 Visual Studio 2010 構建 Qt)
本文介紹了如何為 Visual Studio 2010 構建 Qt的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我一直在努力尋找一個如何為在 Visual Studio 2010 中使用 Qt 提供穩定解決方案的方法,因此在收集了所有信息并進行了一些試驗和錯誤之后,我想將我的解決方案寫入指南.

>

問題,或者為什么不能使用預構建的二進制文件?

似乎在某些特殊情況下使用為 Visual Studio 2008 構建的二進制文件可能會起作用,但我發現它們不起作用.在我的情況下,它們編譯正常,但它們會產生運行時錯誤,如下所示:

或從 Visual Studio 2010 啟動時:

更新:我發現了一篇博客文章,分析了為什么它對某些人有效,而對其他人無效.一句話,這取決于你是否在同一臺機器上安裝了 Visual Studio 2008. 以了解使用或不使用的標志.

configure.exe -release -no-webkit -no-phonon -no-phonon-backend -no-script -no-scripttools -no-qt3support -no-multimedia -no-ltcg

一旦 configure.exe 完成(對我來說是 10 分鐘),您需要開始構建過程.使用上述標志大約需要 20-30 分鐘.要啟動它,只需輸入:

nmake

設置環境變量

基本上,我們完成了.你需要做的就是設置你的環境變量(QTDIRPATH),它們告訴程序在哪里可以找到 Qt.如果您使用的是 Windows 7,您可以使用以下命令將 QTDIR 設置為您的安裝目錄.

setx QTDIR e:Qt

對于設置PATH,我強烈建議使用,但我發現它缺少重要信息.

參考文獻

<塊引用>

Qt DevNet 論壇
極簡 Qt 構建的推薦標志
使用 Visual C++ 2010 構建 Qt 4.5
如何將 Qt 編譯為靜態
Qt 4.8:為 Qt 配置選項

中編輯PATH環境變量Windows 沒有痛苦 - op111.net

I struggled finding a how-to which provides a stable solution for using Qt with Visual Studio 2010, so after collecting all the bits of information and some trial and error, I would like to write my solution into a guide.

The problem, or why is it not possible to use prebuilt binaries?

It seems that using binaries built for Visual Studio 2008 might work in some special cases, but I found them not to work. In my case they compiled OK, but they produce runtime errors, like this:

or when started from Visual Studio 2010:

Update: I found a blog post analysing why does it work for some people, while it does not for others. In one word, it depends on whether you have Visual Studio 2008 installed on the same machine, or not. http://blog.paulnettleship.com/2010/11/11/troubleshooting-visual-studio-2010-and-qt-4-7-integration/

The most important thing (that I stupidly didn’t realize) was the fact that you CANNOT use the Visual Studio 2008 compiled libraries and dll’s (available on the Qt webpage) if you don’t have Visual Studio 2008 installed. The reason is because the Qt SDK you download is a debug build which is dependant on the VC9.0 DebugCRT, meaning it needs the Visual C++ 2008 Debug Runtime installed, which is NOT available as a redistributable installer. The only way to install the DebugCRT is to install the entirety of Visual Studio 2008.

解決方案

First of all, it’s very important to understand that for using Qt with Visual Studio 2010, it's not possible to use the pre-built binaries which were made for Visual Studio 2008, but you have to compile it from source.

Downloading Qt

On https://www.qt.io/download/

Update 2017: the latest Qt 4.x branch (Qt 4.8.6) has 2 pre-built packages, which are now in the archive section:

  1. http://download.qt.io/archive/qt/4.8/4.8.6/qt-opensource-windows-x86-vs2010-4.8.6.exe
  2. http://download.qt.io/archive/qt/4.8/4.8.6/qt-opensource-windows-x86-vs2008-4.8.6.exe

You should not download Qt by clicking "Qt libraries 4.8.6 for Windows (Visual Studio 2008, 218 MB)", but by clicking on the "zip" link above it.

On that link, you get a big zip file like "qt-everywhere-opensource-src-4.8.6.zip". Unzip this into a folder and make its path something nice and small, for example "E:Qt"

Visual Studio Command Prompt

Now that we have the sources, we need to build the binaries. To do it, open the Microsoft Visual Studio 2010Visual Studio ToolsVisual Studio Command Prompt (2010) link from your start menu, or even pin it to the taskbar (a good idea). This is a special command prompt which has all the variables set for building with Visual Studio 2010 tools.

Once within the command prompt, navigate to your extracted Qt folder using old-school DOS way, which means you have to change drive letter by E:, enter directories by cd Qt and list dir contents by dir. You can use the tab key for helping you with the directory names. When you have arrived at the correct directory, a dir command should return something like this.

Building Qt

Now it’s time for configure and build. For configuring a minimalist Qt, I'm using the following flags with configure.exe. Just copy and paste it into the command line. Look in the Qt reference manual for what flag to use or not to use.

configure.exe -release -no-webkit -no-phonon -no-phonon-backend -no-script -no-scripttools -no-qt3support -no-multimedia -no-ltcg

Once configure.exe has finished (it was 10 minutes for me), you'll need to start the build process. It will take about 20-30 minutes with the above flags. To start it, just type:

nmake

Setting environment variables

Basically, we are done. All you need to do is to set your environment variables (QTDIR and PATH), which tell programs where to find Qt. If you are on Windows 7, you can use the following command to set QTDIR to your installation dir.

setx QTDIR e:Qt

For setting the PATH, I strongly recommend using Path Editor. Within Path Editor

add the directory of Qtin to your PATH

(it doesn't matter if it's in system path or user path)

If you prefer to use Control PanelSystemEnvironment Variables, then you can set these there, too.

Qt Visual Studio Add-in

Here you go, after a logoff-logon or a restart, all the Qt demo applications should start correctly (I recommend have a look at binqtdemo.exe). Now you can download and install the Visual Studio Add-in (qt-vs-addin-1.1.9.exe) from the Qt download page, it will work perfectly.

Appendix A: Official Instructions:

There is a page at the official wiki at the Qt website called Qt 4.8 Installing Qt for Windows, but I found it lacking important information.

References

Qt DevNet forums
Recommended flags for a minimalistic Qt build
Building Qt 4.5 with Visual C++ 2010
How to compile Qt as static
Qt 4.8: Configure options for Qt
Edit the PATH environment variable in
Windows without pain - op111.net

這篇關于如何為 Visual Studio 2010 構建 Qt的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

How do I set the icon for my application in visual studio 2008?(如何在 Visual Studio 2008 中為我的應用程序設置圖標?)
Convert CString to const char*(將 CString 轉換為 const char*)
Remove secure warnings (_CRT_SECURE_NO_WARNINGS) from projects by default in Visual Studio(默認情況下,在 Visual Studio 中從項目中刪除安全警告 (_CRT_SECURE_NO_WARNINGS))
How do I start a new CUDA project in Visual Studio 2008?(如何在 Visual Studio 2008 中啟動新的 CUDA 項目?)
Exporting classes containing `std::` objects (vector, map etc.) from a DLL(從 DLL 導出包含 `std::` 對象(向量、映射等)的類)
What are some reasons a Release build would run differently than a Debug build(發布版本與調試版本的運行方式不同的一些原因是什么)
主站蜘蛛池模板: 日韩在线免费播放 | 欧美精品在线播放 | 免费看淫片 | 五月天婷婷久久 | 黄色片在线看 | 超级黄色一级片 | 欧美一级久久精品 | 毛片免费看 | 国产精品视频免费观看 | 国产专区视频 | 欧美精品一区在线发布 | 在线观看中文字幕 | 欧美aaaaaaaaaa | 91精品国产欧美一区二区成人 | 久久久久久久久91 | 日韩中文字幕久久 | 国产a爽一区二区久久久 | 国产在线中文字幕 | 日韩一区二区在线视频 | 91国在线视频 | 成人在线视频免费观看 | 午夜欧美一区二区三区在线播放 | 国产精品一区久久久久 | 亚洲免费人成在线视频观看 | 国产精品一区二区在线 | 狠狠插天天干 | 国产精品九九 | 日本久久网 | 国产农村一级片 | 国产欧美精品区一区二区三区 | 欧美一区视频在线 | av在线电影网站 | 国产成人综合在线 | 国产美女免费视频 | 一区二区精品电影 | 中文字幕人成人 | 欧美精品中文字幕久久二区 | 久草网在线视频 | 精品国产一区二区三区免费 | 成人免费日韩 | 一区二区三区日韩精品 |