1 Compiling LyX 2.4 for Win32 and creating Windows installer
2 ==========================================================
4 It's recommended to compile LyX using Microsoft Visual C++ 2017 and CMake.
7 Compiling with Microsoft Visual C++ (MSVC)
8 ===================================
10 The easiest way to install LyX with MSVC is to follow this Wiki page:
12 http://wiki.lyx.org/Windows/Compilation
14 If you find there any errors please write a mail to the lyx-devel mailing list.
16 ----------------------------------------------------------------------------
18 The following instructions assume the LyX source code is in C:\LyX\lyx-24
19 You can also use another directory if you prefer.
23 If you don't have Visual C++ 2017 installed, get the free Community edition
24 from https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=Community&rel=15
28 Download the latest Qt for Open Source C++ development on Windows (VS2017)
29 from https://qt.io/download-open-source/
30 Qt 5.12.x is recommended, but 5.9.x or later versions should work as well.
31 If you want to build LyX as 32bit application, you need Qt x86.
32 If you want to build LyX as 64bit application, you need Qt x64.
33 Make sure that the bin subfolder of the Qt installation (e.g.
37 Install the latest Python 3.x version from
38 https://www.python.org/downloads/
39 Assure that you use the installer option "Add Python 3.x to PATH"
43 Install the latest CMake from http://www.cmake.org
45 5 Download dependencies
47 Download the LyX for Windows build dependencies from
48 ftp.lyx.de/LyXWinInstaller/lyx-windows-deps-msvc2017.zip
49 and extract it e.g. to
50 C:\LyX\lyx-24\lyx-windows-deps-msvc2017
56 - Set the source code path to C:\LyX\lyx-24
57 Set the build path to C:\LyX\lyx-24-build
58 Click Configure and set the generator to "Visual Studio 15 2017" to
59 build a 32bit LyX or add the x64 option to build a 64bit LyX.
61 - Set LYX_USE_QT to QT5 and click Configure.
63 - You will now get an error about missing GNUWIN32 directory.
65 - Set GNUWIN32_DIR to the folder that contains the dependencies.
66 (This alternative does currently not work:
67 Enable LYX_DEPENDENCIES_DOWNLOAD and click Configure.
68 Pre-compiled dependencies will automatically be downloaded.)
70 - set CMAKE_PREFIX_PATH to the path of Qt
71 e.g. to C:/Qt/Qt5.12.5/5.12.5/msvc2017
73 - Enable the LYX_INSTALL option and click Configure.
79 A Microsoft Visual C++ solution should has been generated at
80 C:\LyX\lyx-23-build\lyx.sln
81 - Open the lyx.sln by double-clicking on it
82 - Use the menu BUILD -> Build Solution
87 C:\LyX\lyx-24\lyx-windows-deps-msvc2017\bin
88 C:\LyX\lyx-24\lyx-windows-deps-msvc2017\imagemagick
89 C:\LyX\lyx-24\lyx-windows-deps-msvc2017\Python
90 C:\LyX\lyx-24\lyx-windows-deps-msvc2017\ghostscript
91 C:\LyX\lyx-24\lyx-windows-deps-msvc2017\Resources
92 to C:\LyX\lyx-24-build\LYX_INSTALLED
93 (allow the request to overwrite)
95 - Copy from the Qt bin directory (see section 2 "Install Qt" above) these files:
101 Qt5Cored.dll (if compiling Debug version)
102 Qt5Guid.dll (if compiling Debug version)
103 Qt5Svgd.dll (if compiling Debug version)
104 Qt5Widgetsd.dll (if compiling Debug version)
105 Qt5WinExtrasd.dll (if compiling Debug version)
106 to C:\LyX\lyx-24-build\LYX_INSTALLED\bin
108 - Copy from this Qt directory
109 C:\Qt\Qt5.12.5\5.12.5\msvc2017\plugins
110 these subdirectories:
114 to C:\LyX\lyx-24-build\LYX_INSTALLED\bin
118 C:\LyX\lyx-24-build\LYX_INSTALLED\bin\lyx.exe
120 10 Define path prefix
122 In LyX use the menu Tools->Preferences
123 There input the the following the the field "Path prefix":
125 "$LyXDir\bin;$LyXDir\Python;$LyXDir\imagemagick;$LyXDir\ghostscript"
127 You may also add the location of your LaTeX installation if it's not on the
128 system PATH, and the location of JabRef.
131 Creating the Installer
132 ======================
134 - Get NSIS from http://nsis.sourceforge.net
135 - In the LyX source directory, go to development\Win32\packaging\installer
136 - Follow the steps in the file Readme.txt
139 Compiling with GCC with MinGW64 + MSYS2 Environment using autotools
140 ===================================================================
141 1 Install MSYS2, MINGW64, Qt5+
142 https://wiki.qt.io/MSYS2
143 2 Install bc (Bench calculater), which autotools uses for some reason to compile LyX
145 3 Run the standard autotools install (Adapt paths and arguments accordingly)
147 ./configure --without-x --enable-qt5 --disable-debug --enable-optimization --prefix=/mingw64
152 Cross-Compiling on unix with MXE using autotools
153 =================================================
154 1 Install MXE: http://mxe.cc
155 You can either install from sources, the generic .tar binaries or debian .deb packages.
156 Installing the following .deb packages will drag in all needed dependencies:
157 mxe-x86-64-w64-mingw32.shared-file
158 mxe-x86-64-w64-mingw32.shared-gcc
159 mxe-x86-64-w64-mingw32.shared-libiconv
160 mxe-x86-64-w64-mingw32.shared-qtimageformats
161 mxe-x86-64-w64-mingw32.shared-qtsvg
162 mxe-x86-64-w64-mingw32.shared-qtwinextras
163 Of course you can also use the static and/or 32bit versions.
164 2 Run the standard autotools install (Adapt paths and arguments accordingly)
168 PATH="/usr/lib/mxe/usr/bin:$PATH" ../configure --host=x86-64-w64-mingw32.shared --with-qt-dir=/usr/lib/mxe/usr/x86_64-w64-mingw32.shared/qt5 --enable-qt5 --with-included-boost --with-included-hunspell --with-included-mythes --disable-debug --enable-optimization --prefix=/mingw64
169 PATH="/usr/lib/mxe/usr/bin:$PATH" make
170 PATH="/usr/lib/mxe/usr/bin:$PATH" DESTDIR=/tmp/lyxinstall make install
171 This uses the paths from the 64bit shared MXE version installed from .deb packages.
172 3 If you want to run the resulting lyx.exe from the build directory using wine,
173 create symlinks for all needed .dlls:
174 cd builddir-mingw/src
175 ln -s /usr/lib/mxe/usr/x86_64-w64-mingw32.shared/bin/*.dll .
176 ln -s /usr/lib/mxe/usr/x86_64-w64-mingw32.shared/qt5/bin/*.dll .