Qt5.12 静态编译最小工程相关依赖库

一、编译

  1. 安装VS2015、Python ruby perl jom相关工具
  2. 解压Qt5.12源码,修改qtbase\mkspecs\common\msvc-desktop.conf中MD为MT,MDd为MTd(移除对VS2015的依赖)
  3. 修改qtvirtualkeyboard\src\plugins\openwnn\3rdparty\openwnn\wnnEngine中文件为UTF8-BOM格式
  4. 编译前配置 configure.bat -static -prefix “f:\qt” -confirm-license -opensource -debug-and-release -platform win32-msvc -nomake examples -nomake tests -plugin-sql-sqlite -plugin-sql-odbc -qt-zlib -qt-libpng -qt-libjpeg -opengl desktop -mp
  5. make 或 jom
  6. make install

二、使用

	#include 
	//相关lib
	#pragma comment( lib, "ws2_32.lib" )
	#pragma comment( lib, "version.lib" )
	#pragma comment( lib, "winmm.lib" )
	#pragma comment( lib, "Netapi32.lib" )
	#pragma comment( lib, "userenv.lib" )
	#pragma comment( lib, "imm32.lib" )
	#pragma comment( lib, "Dwmapi.lib" )
	#pragma comment( lib, "Wtsapi32.lib" )


	#pragma comment( lib, "qtfreetype.lib" )
	#pragma comment( lib, "Qt5Gui.lib" )
	#pragma comment( lib, "Qt5Widgets.lib" )
	#pragma comment( lib, "qtlibpng.lib" )
	#pragma comment( lib, "qtmain.lib" )
	#pragma comment( lib, "Qt5Core.lib" )
	#pragma comment( lib, "qtharfbuzz.lib" )
	#pragma comment( lib, "qtpcre2.lib" )
	#pragma comment( lib, "qwindows.lib" )
	#pragma comment( lib, "Qt5ThemeSupport.lib" )
	#pragma comment( lib, "Qt5FontDatabaseSupport.lib" )
	#pragma comment( lib, "Qt5EventDispatcherSupport.lib" )
	#pragma comment( lib, "Qt5WindowsUIAutomationSupport.lib" )


	// #pragma comment( lib, "qsvgicon.lib" )
	// #pragma comment( lib, "Qt5EdidSupport.lib" )
	Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin)
	int main()
	{
		return 0;
	}

你可能感兴趣的:(非主线笔记)