Skip to content
This repository has been archived by the owner on May 16, 2020. It is now read-only.

Windows MSVC dev setup

rakslice edited this page Jun 19, 2017 · 9 revisions

Unfortunately, there isn't a scripted Windows build environment setup at the moment.

But if you want to get it set up manually, here's what I'm using for 64-bit MSVC builds:

When installing VS, you'll need to make sure to select these optional components:

  • Programming Languages -> Visual C++
    • Common Tools for Visual C++ 2015
    • Windows XP Support for C++

When installing Qt, you'll need to make sure to select these optional components:

  • Qt5.8
    • msvc2015

My build script, named build.cmd and dropped in the source dir (adjust the variables at the top for your paths):

set QTDIR=i:\qt\5.8\msvc2015_64
set MPVDIR=i:\mpv
set SSLDIR=c:\OpenSSL-Win64
rem The Microsoft SDKs are from the Visual Studio 2015 Community install (make sure Windows XP support for C++ is selected)
set SDKDIR=C:\Program Files (x86)\Microsoft SDKs
set WINKITSDIR=C:\Program Files (x86)\Windows Kits

set VCINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC

set VCBINS=%VCINSTALLDIR%\bin\amd64

set PATH=%PATH%;%QTDIR%\bin;%VCBINS%;%SDKDIR%\Windows\v7.1A\Bin
set INCLUDE=%VCINSTALLDIR%\include;%SDKDIR%\Windows\v7.1A\Include;%WINKITSDIR%\10\Include\10.0.10150.0\ucrt;%MPVDIR%\include
set LIB=%QTDIR%\lib;%VCINSTALLDIR%\lib\amd64;%SDKDIR%\Windows\v7.1A\lib\x64;%WINKITSDIR%\10\Lib\10.0.10150.0\ucrt\x64;%MPVDIR%

set TARGET=%1

if "%1"=="" (
	echo "specify release or debug"
	exit /b
)

if exist %TARGET%\orion.exe erase %TARGET%\orion.exe

if not exist libs mkdir libs

copy /y "%MPVDIR%\mpv-1.dll" libs
copy /y "%SSLDIR%\libeay32.dll" libs
copy /y "%SSLDIR%\ssleay32.dll" libs

lib /def:%MPVDIR%\mpv.def /name:%MPVDIR%\mpv-1.dll /out:%MPVDIR%\mpv.lib /MACHINE:X64 || (pause; exit /b 1)

%QTDIR%\bin\qmake orion.pro
"%VCBINS%\nmake" %TARGET% || (pause; exit 1)

%QTDIR%\bin\windeployqt --qmldir src\qml %TARGET%\orion.exe

copy /y "libs\mpv-1.dll" %TARGET%
copy /y "libs\ssleay32.dll" %TARGET%
copy /y "libs\libeay32.dll" %TARGET%

My MSVC project settings:

Configuration All Configurations**, x64**:

  • General -> Configuration Type: Makefile **
  • NMake -> Include Search Path e.g.
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Include
C:\Program Files (x86)\Windows Kits\10\Include\10.0.10150.0\ucrt
i:\qt\5.8\msvc2015_64\include\QtQml
i:\qt\5.8\msvc2015_64\include\QtQuick
i:\qt\5.8\msvc2015_64\include\QtGui
i:\qt\5.8\msvc2015_64\include\QtNetwork
i:\qt\5.8\msvc2015_64\include\QtWidgets
i:\qt\5.8\msvc2015_64\include\QtCore
i:\qt\5.8\msvc2015_64\include\QtWebEngine
i:\qt\5.8\msvc2015_64\include
i:\mpv\include

For Configuration Debug:

  • NMake -> Build Command Line build.cmd debug
  • NMake -> Rebuild Command Line build.cmd debug

For Configuration Release:

  • NMake -> Build Command Line build.cmd release
  • NMake -> Rebuild Command Line build.cmd release

(**You'll need to save and reopen the project config dialog after these changes to see the right sections & fields)

Clone this wiki locally