win32 · Шаг 6. Фаза 4 — сборка FieldView (OpenGL)
На этом шаге собирается FieldView.exe — визуализатор полей — под 32 бита.
Это MFC‑приложение (статическая MFC, MultiByte), использующее OpenGL. Оно
линкуется с библиотеками OpenGL (opengl32, glu32) и теми же TMC‑библиотеками, что
и счётные ядра: sfile95, prepr, exprint, TMCIndan, TMCLibError.
Перед сборкой: все 6 библиотек Фазы 1 готовы; конфигурация Release, платформа Win32.
6.1 Подготовка OpenGL (ничего скачивать не нужно)
Всё необходимое для OpenGL входит в Windows SDK, который вы поставили вместе с
Visual Studio (см. 01-requirements.md, раздел 1.2). Отдельно ставить GLEW, GLFW или
что‑либо ещё не требуется.
Что используется:
- Заголовки
GL.h,GLU.h— подтягиваются из Windows SDK автоматически; вручную прописывать пути к ним не нужно. - Библиотеки линковки
opengl32.libиglu32.lib. Для платформыWin32они берутся из 32‑битной части SDK (um\x86). Visual Studio находит их сама.
Проверить, что библиотеки OpenGL указаны в проекте:
- Правой кнопкой по проекту FieldView → Properties.
- Linker → Input → Additional Dependencies.
- В списке должны быть, помимо TMC‑библиотек:
opengl32.lib
glu32.lib

GLAUX отсутствует — и это нормально. Старая вспомогательная библиотека GLAUX (
glaux.h/glaux.lib) удалена из современного Windows SDK. В коде FieldView ссылка на неё убрана (правка Ф4‑1, см. 6.2). В списке линковкиglaux.libбыть не должно.
6.2 Что уже сделано в проекте FieldView
Правки настроек сборки (.vcxproj/.sln), не код:
- Старый
FldView.vcxproj(формат VS, только Win32, без toolset) переписан по образцу ядер: toolset v145, 4 конфигурации (Win32/x64 × Debug/Release), подключёнbuild\ExeOutput.props. - Удалены жёсткий путь вывода
C:\TMC\EXE\FldView.exeи опция линкера/MACHINE:I386. - Имя exe задаётся через
<TargetName>FieldView</TargetName>(в оригинале былоFldView.exe; приведено к ожидаемому имениFieldView.exe). - Из линкера убран
glaux.lib(см. ниже Ф4‑1); оставленыopengl32.lib,glu32.lib. - Ссылки
..\INCLUDE\...исправлены на..\Include\....
Правка в коде (общая, нужна и для win32) — Ф4‑1:
- В
src\fieldview\TmcGLText.h(строка 12) удалён мёртвый#include <gl\glaux.h>(GLAUX отсутствует в современном SDK → ошибкаC1083). Ни однаaux*‑функция в коде не используется: текст рисуется через GDI (CreateFontIndirect,GetDIBits) и ядро OpenGL (glBitmap,glRasterPos3f). Из линкера убранglaux.lib. Эта правка нужна и для win32, и для win64; математика не затронута.
Примечание: файлы
TmcRTH_BlockList1.cpp/.h(с жёстким путёмz:\work\...) в проект НЕ включены и не компилируются.
6.3 Сборка FieldView (Win32)
- Открыть проект FieldView — файл
FldView.vcxprojиз папкиsrc\fieldview. (FldView.slnссылается на новый.vcxproj— открыть можно и решение, но надёжнее открывать сам.vcxproj.) - Конфигурация Release, платформа Win32.
- Проверить линковку (раздел 6.1):
opengl32.lib,glu32.lib,sfile95.lib,prepr.lib,exprint.lib,TMCIndan.lib,TMCLibError.lib. - Build → Clean Solution, затем Build → Build Solution.
- Результат:
dist\win32\bin\FieldView.exe.
Предупреждения при сборке (
C4996небезопасные CRT,C4477sprintf("%s", CString)) — легаси‑шум, на работу и на расчёты не влияют.
6.4 Итоговая проверка всей 32‑битной сборки
После Фазы 4 в папках должно быть:
dist\win32\lib\ → 6 файлов .lib
sfile95, complex, exprint, TMCLibError, prepr, TMCIndan
dist\win32\bin\ → 6 файлов .exe
TMCROS, TMCGROUT, TMC_DN, tmc_rth, tmc_rtx, FieldView
Запустите FieldView.exe — окно должно открыться и рисовать поля (OpenGL работает).
Прогоните типовые тесты из samples\SAMPLE_R на ядрах.
32‑битная сборка завершена. При проблемах смотрите 07-troubleshooting.md.
win32 · Step 6. Phase 4 — building FieldView (OpenGL)
In this step FieldView.exe — the field visualizer — is built for 32 bits. It is an
MFC application (static MFC, MultiByte) that uses OpenGL. It links against the OpenGL
libraries (opengl32, glu32) and the same TMC libraries as the compute kernels:
sfile95, prepr, exprint, TMCIndan, TMCLibError.
Before building: all 6 libraries from Phase 1 are ready; configuration Release, platform Win32.
6.1 Preparing OpenGL (nothing to download)
Everything needed for OpenGL is part of the Windows SDK you installed together with
Visual Studio (see 01-requirements.md, section 1.2). You do not need to install
GLEW, GLFW or anything else separately.
What is used:
- Headers
GL.h,GLU.h— pulled from the Windows SDK automatically; you do not need to specify paths to them manually. - Link libraries
opengl32.libandglu32.lib. For theWin32platform they are taken from the 32-bit part of the SDK (um\x86). Visual Studio finds them itself.
To check that the OpenGL libraries are specified in the project:
- Right-click the FieldView project -> Properties.
- Linker -> Input -> Additional Dependencies.
- Besides the TMC libraries, the list must contain:
opengl32.lib
glu32.lib

GLAUX is absent — and that is normal. The old helper library GLAUX (
glaux.h/glaux.lib) has been removed from the modern Windows SDK. The reference to it has been removed from the FieldView code (change F4-1, see 6.2).glaux.libmust not be in the link list.
6.2 What has already been done in the FieldView project
Build-settings changes (.vcxproj/.sln), not code:
- The old
FldView.vcxproj(VS format, Win32 only, no toolset) was rewritten following the pattern of the kernels: toolset v145, 4 configurations (Win32/x64 × Debug/Release),build\ExeOutput.propsattached. - The hard output path
C:\TMC\EXE\FldView.exeand the linker option/MACHINE:I386were removed. - The exe name is set via
<TargetName>FieldView</TargetName>(originally it wasFldView.exe; brought to the expected nameFieldView.exe). glaux.libwas removed from the linker (see F4-1 below);opengl32.lib,glu32.libwere kept.- References
..\INCLUDE\...were fixed to..\Include\....
A code change (shared, needed for win32 too) — F4-1:
- In
src\fieldview\TmcGLText.h(line 12) the dead#include <gl\glaux.h>was removed (GLAUX is absent from the modern SDK -> errorC1083). Noaux*function is used in the code: text is drawn via GDI (CreateFontIndirect,GetDIBits) and core OpenGL (glBitmap,glRasterPos3f).glaux.libwas removed from the linker. This change is needed for both win32 and win64; the math is not affected.
Note: the files
TmcRTH_BlockList1.cpp/.h(with the hard pathz:\work\...) are NOT included in the project and are not compiled.
6.3 Building FieldView (Win32)
- Open the FieldView project — the file
FldView.vcxprojfrom the foldersrc\fieldview. (FldView.slnreferences the new.vcxproj— you can open the solution too, but opening the.vcxprojitself is more reliable.) - Configuration Release, platform Win32.
- Check the linking (section 6.1):
opengl32.lib,glu32.lib,sfile95.lib,prepr.lib,exprint.lib,TMCIndan.lib,TMCLibError.lib. - Build -> Clean Solution, then Build -> Build Solution.
- Result:
dist\win32\bin\FieldView.exe.
Warnings during the build (
C4996unsafe CRT,C4477sprintf("%s", CString)) are legacy noise; they do not affect operation or the computations.
6.4 Final verification of the whole 32-bit build
After Phase 4 the folders should contain:
dist\win32\lib\ -> 6 .lib files
sfile95, complex, exprint, TMCLibError, prepr, TMCIndan
dist\win32\bin\ -> 6 .exe files
TMCROS, TMCGROUT, TMC_DN, tmc_rth, tmc_rtx, FieldView
Run FieldView.exe — the window must open and draw fields (OpenGL works). Run the
typical tests from samples\SAMPLE_R on the kernels.
The 32-bit build is complete. For problems, see 07-troubleshooting.md.