I wanted to build my "CS488-A3-OpenGL 3D modelling engine" on Windows. The Linux build instructions to get started in this assignment says this"
apt-get install qt5-qmake qt5-default libqt5opengl5-dev liblua5.1-0-dev
My first attempt was to open up the files of the project as files in VS2013, use VS to build, and include the sources for the QT-5 and LUA5.1 as "Include Directories". I got compile error that a lot of QT headers I included in my project are undefined. There were a lot of there is too many QT directories to include. By occam's razor, I must not being doing the right thing.
Next I installed QT 5.3 OpenGl and opened the .pro file and changed the include directory to point to the source of LUA5.1 on my Windows environment. I no longer get QT headers error . It gave redefinition error that GLfloat is defined in .../GL/gl.h and ...QtGui/qopengl.h. Looking back, this error was occuring because LUA5.1 uses GLfloat defined in gl.h, but the QT library uses GLfloat defined in qopengl.h. To fix this problem, LUA needs to be statically built so it doesn't interfere with QT operation.
Next I tried building using TDM-GCC compiler, but it didn't go very far because the makefile created DLLs. I needed static .lib as opposed to dynamic .dll.
Finally, I found out that lua for windows, here . After installation, there was lua5.1.lib, and after adding to external library section of .pro file, it compiled. Then I moved the necessary DLL from QT folders for the .exe to work. It seems in Linux, the dynamic libraries are always under /usr/include so it is up to the end user to install the necessary dynamic libraries. For windows, the dynamic libraries are bundled (in the same folder) with the executable.
In summary, the changes in the .pro QT project file is bellow.
linux-g++ {
LIBS += -lGLU -llua5.1
INCLUDEPATH += /usr/include/lua5.1
}
win32{
LIBS += -lglu32
LIBS += "C:\Program Files (x86)\Lua\5.1\lib\lua5.1.lib"
INCLUDEPATH += "C:\Program Files (x86)\Lua\5.1\include"
}
Next, I wanted to build a static exe of my project because the way described above, the Qt dll like QtCore.dll, QtGui.dll needed to be delivered along with the exe.
In VS2015 Command Promt, I executed the following to configure makefile to build all Qt modules but not examples.
configure -static -debug-and-release -platform win32-msvc2015 -nomake examples -opengl desktop
Then, if you have jom, which is Qt's multithreaded version of nmake.
> jom
I built a couple times, to get this right. I found I needed to reconfigure. " If you later need to reconfigure and rebuild Qt from the same location, ensure that all traces of the previous configuration are removed by entering the build directory and typing nmake distclean before running configure again." (1)
http://doc.qt.io/qt-5/windows-building.html