@echo off rem --------------------------------------------------------------------------- rem Builds qlclglwidget.dll natively on Windows with MSVC. rem rem Use this when the target Qt6 / libQt6Pas is an MSVC build (the official rem Qt online-installer binaries are MSVC). A MinGW-built DLL cannot link rem against MSVC Qt DLLs - the C++ ABIs are incompatible. rem rem How to run: rem 1. Open "x64 Native Tools Command Prompt for VS" (vcvars64 environment). rem 2. set QTDIR=C:\Qt\6.7.2\msvc2019_64 (your MSVC Qt kit) rem 3. build-msvc.bat rem rem Output: ..\qlclglwidget.dll (put it next to the application executable). rem --------------------------------------------------------------------------- if "%QTDIR%"=="" ( echo error: set QTDIR to your MSVC Qt kit first, e.g.: echo set QTDIR=C:\Qt\6.7.2\msvc2019_64 exit /b 1 ) if not exist "%QTDIR%\include\QtOpenGLWidgets" ( echo error: %QTDIR%\include\QtOpenGLWidgets not found - is QTDIR an MSVC Qt6 kit? exit /b 1 ) cl /nologo /LD /EHsc /std:c++17 /permissive- /Zc:__cplusplus /MD /O2 ^ /I"%QTDIR%\include" ^ /I"%QTDIR%\include\QtCore" ^ /I"%QTDIR%\include\QtGui" ^ /I"%QTDIR%\include\QtWidgets" ^ /I"%QTDIR%\include\QtOpenGL" ^ /I"%QTDIR%\include\QtOpenGLWidgets" ^ qlclglwidget.cpp /Fe:..\qlclglwidget.dll ^ /link /LIBPATH:"%QTDIR%\lib" Qt6Widgets.lib Qt6OpenGLWidgets.lib Qt6Gui.lib Qt6Core.lib if errorlevel 1 ( echo build FAILED exit /b 1 ) del qlclglwidget.obj ..\qlclglwidget.exp ..\qlclglwidget.lib 2>nul echo built ..\qlclglwidget.dll