win64 · Шаг 6. Фаза 4 — сборка FieldView (OpenGL)

На этом шаге собирается FieldView.exe — визуализатор полей (OpenGL) — под 64 бита. MFC‑приложение (статическая MFC, MultiByte). Линкуется с OpenGL (opengl32, glu32) и TMC‑библиотеками sfile95, prepr, exprint, TMCIndan, TMCLibError.

Перед сборкой: все 6 библиотек Фазы 1 готовы; конфигурация Release, платформа x64.

В FieldView под 64 бита применены те же правки разрядности, что во вьюверах (П‑1, П‑2), плюс общая правка Ф4‑1. Все — в 08-porting-changes.md.


6.1 Подготовка OpenGL (x64) — ничего скачивать не нужно

OpenGL входит в Windows SDK (см. 01-requirements.md, раздел 1.2).

  • Заголовки GL.h, GLU.h — подтягиваются автоматически (общие для x86/x64).
  • Библиотеки opengl32.lib, glu32.lib — для платформы x64 берутся из um\x64 части SDK. Имя файла остаётся opengl32.lib (отдельной «OpenGL64» нет); нужную разрядность Visual Studio выбирает сама по платформе сборки.

Проверить линковку: Properties → Linker → Input → Additional Dependencies — помимо TMC‑библиотек должны быть:

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

Скриншот общий с инструкцией win32 — список тот же. Открывайте свойства при выбранной платформе x64 (opengl32.lib/glu32.lib для x64 берутся из um\x64, имя файла то же).

glaux.lib в списке быть не должно — GLAUX удалён из современного SDK (правка Ф4‑1).


6.2 Что уже сделано в проекте FieldView

Настройки сборки (.vcxproj/.sln): FldView.vcxproj переписан по образцу ядер (toolset v145, 4 конфигурации Win32/x64 × Debug/Release, подключён build\ExeOutput.props); удалён жёсткий путь C:\TMC\EXE\FldView.exe и опция /MACHINE:I386; имя exe — <TargetName>FieldView</TargetName>; из линкера убран glaux.lib; ссылки ..\INCLUDE\.....\Include\...; .sln пересохранён с x64‑платформами.

Правки кода:

  • Ф4‑1 (общая, нужна и для win32): в src\fieldview\TmcGLText.h удалён мёртвый #include <gl\glaux.h> (C1083). Ни одна aux*‑функция не используется; текст рисуется через GDI и ядро OpenGL. Математика не затронута.
  • П‑1 (64 бит): в TMCDialogPropet.h/.cpp int DoModal()INT_PTR DoModal() (override CPropertySheet::DoModal, ошибка C2555).
  • П‑2 (64 бит): в FldViewView.h/.cpp OnTimer(UINT)OnTimer(UINT_PTR) (C2440/C2737).

Здесь применены изменения для 64 бит — см. 08-porting-changes.md, пункты П‑1, П‑2 (раздел «Фаза 4») и общая Ф4‑1.

Примечание: файлы TmcRTH_BlockList1.cpp/.h (жёсткий путь z:\work\...) в проект НЕ включены.


6.3 Сборка FieldView (x64)

  1. Открыть решение из src\fieldview.
  2. Конфигурация Release, платформа x64.
  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\win64\bin\FieldView.exe.

Предупреждения (C4996, C4477) — легаси‑шум, на работу/расчёты не влияют.


6.4 Итоговая проверка всей 64‑битной сборки

После Фазы 4:

dist\win64\lib\   → 6 файлов .lib
                    sfile95, complex, exprint, TMCLibError, prepr, TMCIndan

dist\win64\bin\   → 6 файлов .exe
                    TMCROS, TMCGROUT, TMC_DN, tmc_rth, tmc_rtx, FieldView

Запустите FieldView.exe — окно должно открыться и рисовать поля. Прогоните тесты samples\SAMPLE_R на ядрах.

64‑битная сборка завершена. При проблемах — 07-troubleshooting.md. Полный журнал изменений ради 64 бит — 08-porting-changes.md.

win64 · Step 6. Phase 4 — building FieldView (OpenGL)

In this step FieldView.exe — the field visualizer (OpenGL) — is built for 64 bits. An MFC application (static MFC, MultiByte). It links against OpenGL (opengl32, glu32) and the TMC libraries sfile95, prepr, exprint, TMCIndan, TMCLibError.

Before building: all 6 Phase 1 libraries are ready; configuration Release, platform x64.

In FieldView for 64 bits the same bitness changes as in the viewers (P-1, P-2) are applied, plus the shared change F4-1. All in 08-porting-changes.md.


6.1 Preparing OpenGL (x64) — nothing to download

OpenGL is part of the Windows SDK (see 01-requirements.md, section 1.2).

  • Headers GL.h, GLU.h — pulled automatically (shared for x86/x64).
  • Libraries opengl32.lib, glu32.lib — for the x64 platform they are taken from the um\x64 part of the SDK. The file name remains opengl32.lib (there is no separate "OpenGL64"); Visual Studio picks the right bitness itself based on the build platform.

Check the linking: Properties -> Linker -> Input -> Additional Dependencies — besides the TMC libraries there must be:

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)

The screenshot is shared with the win32 guide — the list is the same. Open the properties with the x64 platform selected (opengl32.lib/glu32.lib for x64 are taken from um\x64, the file name is the same).

glaux.lib must not be in the list — GLAUX has been removed from the modern SDK (change F4-1).


6.2 What has already been done in the FieldView project

Build settings (.vcxproj/.sln): FldView.vcxproj was rewritten following the kernels' pattern (toolset v145, 4 configurations Win32/x64 × Debug/Release, build\ExeOutput.props attached); the hard path C:\TMC\EXE\FldView.exe and the /MACHINE:I386 option were removed; the exe name is <TargetName>FieldView</TargetName>; glaux.lib was removed from the linker; references ..\INCLUDE\... -> ..\Include\...; the .sln was re-saved with x64 platforms.

Code changes:

  • F4-1 (shared, needed for win32 too): in src\fieldview\TmcGLText.h the dead #include <gl\glaux.h> was removed (C1083). No aux* function is used; text is drawn via GDI and core OpenGL. The math is not affected.
  • P-1 (64-bit): in TMCDialogPropet.h/.cpp, int DoModal() -> INT_PTR DoModal() (override of CPropertySheet::DoModal, error C2555).
  • P-2 (64-bit): in FldViewView.h/.cpp, OnTimer(UINT) -> OnTimer(UINT_PTR) (C2440/C2737).

The 64-bit changes are applied here — see 08-porting-changes.md, items P-1, P-2 (the "Phase 4" section) and the shared F4-1.

Note: the files TmcRTH_BlockList1.cpp/.h (hard path z:\work\...) are NOT included in the project.


6.3 Building FieldView (x64)

  1. Open the solution from src\fieldview.
  2. Configuration Release, platform x64.
  3. Check the linking (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\win64\bin\FieldView.exe.

Warnings (C4996, C4477) are legacy noise; they do not affect operation/computations.


6.4 Final verification of the whole 64-bit build

After Phase 4:

dist\win64\lib\   -> 6 .lib files
                    sfile95, complex, exprint, TMCLibError, prepr, TMCIndan

dist\win64\bin\   -> 6 .exe files
                    TMCROS, TMCGROUT, TMC_DN, tmc_rth, tmc_rtx, FieldView

Run FieldView.exe — the window must open and draw fields. Run the tests in samples\SAMPLE_R on the kernels.

The 64-bit build is complete. For problems — 07-troubleshooting.md. The full log of changes made for 64 bits — 08-porting-changes.md.