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 указаны в проекте:

  1. Правой кнопкой по проекту FieldView → Properties.
  2. Linker → Input → Additional Dependencies.
  3. В списке должны быть, помимо TMC‑библиотек:

opengl32.lib glu32.lib

Linker → Input для FieldView (opengl32.lib, glu32.lib + TMC‑библиотеки)
Linker → Input для FieldView (opengl32.lib, glu32.lib + TMC‑библиотеки)

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)

  1. Открыть проект FieldView — файл FldView.vcxproj из папки src\fieldview. (FldView.sln ссылается на новый .vcxproj — открыть можно и решение, но надёжнее открывать сам .vcxproj.)
  2. Конфигурация Release, платформа Win32.
  3. Проверить линковку (раздел 6.1): opengl32.lib, glu32.lib, sfile95.lib, prepr.lib, exprint.lib, TMCIndan.lib, TMCLibError.lib.
  4. Build → Clean Solution, затем Build → Build Solution.
  5. Результат: dist\win32\bin\FieldView.exe.

Предупреждения при сборке (C4996 небезопасные CRT, C4477 sprintf("%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.lib and glu32.lib. For the Win32 platform 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:

  1. Right-click the FieldView project -> Properties.
  2. Linker -> Input -> Additional Dependencies.
  3. Besides the TMC libraries, the list must contain:

opengl32.lib glu32.lib

Linker -> Input for FieldView (opengl32.lib, glu32.lib + TMC libraries)
Linker -&gt; Input for FieldView (opengl32.lib, glu32.lib + TMC libraries)

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.lib must 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.props attached.
  • The hard output path C:\TMC\EXE\FldView.exe and the linker option /MACHINE:I386 were removed.
  • The exe name is set via <TargetName>FieldView</TargetName> (originally it was FldView.exe; brought to the expected name FieldView.exe).
  • glaux.lib was removed from the linker (see F4-1 below); opengl32.lib, glu32.lib were 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 -> error C1083). No aux* function is used in the code: text is drawn via GDI (CreateFontIndirect, GetDIBits) and core OpenGL (glBitmap, glRasterPos3f). glaux.lib was 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 path z:\work\...) are NOT included in the project and are not compiled.


6.3 Building FieldView (Win32)

  1. Open the FieldView project — the file FldView.vcxproj from the folder src\fieldview. (FldView.sln references the new .vcxproj — you can open the solution too, but opening the .vcxproj itself is more reliable.)
  2. Configuration Release, platform Win32.
  3. Check the linking (section 6.1): opengl32.lib, glu32.lib, sfile95.lib, prepr.lib, exprint.lib, TMCIndan.lib, TMCLibError.lib.
  4. Build -> Clean Solution, then Build -> Build Solution.
  5. Result: dist\win32\bin\FieldView.exe.

Warnings during the build (C4996 unsafe CRT, C4477 sprintf("%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.