win32 · Шаг 7. Решение проблем
Здесь собраны проблемы, реально встреченные при сборке и запуске TMC Suite под 32 бита, и их решения. Все решения уже внесены в проект; раздел нужен, если вы собираете из «голого» исходника или столкнулись с тем же симптомом.
7.1 Кнопка «Статистика» крашит программу (H и X моды) — Баг #1 · РЕШЁН
- Где:
kernels\PlanarRT_H\TmcDialogStatistics.cppиkernels\PlanarRT_X\TmcDialogStatistics.cpp, конструкторCTmcDialogStatistics::CTmcDialogStatistics, инициализация поляcsTolerance. - Затронуто:
tmc_rth.exe,tmc_rtx.exe. - Симптом: при нажатии «View statistics» (Shift+F4) окно статистики пытается открыться, и вся программа молча закрывается без сообщения об ошибке. Одинаково в H и X.
- Причина (установлена отладкой): в конструкторе стояло
csTolerance.Format("100 %");. Строка"100 %"передаётся вCString::Formatкак строка формата. Символ%начинает спецификатор преобразования, пробел трактуется как флаг, а затем строка заканчивается — получается незавершённый спецификатор. Современный UCRT (движокprintf:__stdio_common_vsprintf_s→format_validation) считает это недопустимым параметром: - в Debug срабатывает
_CRT_ASSERT; - в Release срабатывает обработчик недопустимого параметра CRT → молчаливое завершение процесса (ровно наблюдаемый симптом).
В старом компиляторе, где писался код, printf не валидировал формат так строго,
поэтому раньше не падало.
- Исправление (правка кода, математика не затронута): в обоих файлах
csTolerance.Format("100 %"); заменено на прямое присваивание:
csTolerance = "100 %";
Результат тот же текст «100 %», но движок форматирования не задействуется.
(Альтернатива — Format("100 %%"), но присваивание чище.)
- Проверено: после фикса окно «Statistics» открывается полностью; обработчик
недопустимого параметра больше не срабатывает.
- Статус: закрыто.
Примечание: в файлах
CLAUDE.md/BUILD_ORDER.mdэтот баг может быть помечен как «не исправлен» — это устаревшая отметка. Актуальный статус по журналуISSUES.md— исправлен.
7.2 Вьюверы: «Encountered an improper argument» при запуске — Баг #5 · РЕШЁН
- Где: TMCGROUT, TMCROS, TMC_DN (общий код вьювера).
- Симптом: при запуске — окно ошибки MFC «Encountered an improper argument»;
после OK приложение стартует, но при «вызове графика из файла» — та же ошибка. При
явном открытии
horns.socнаблюдался жёсткий аварийный выход0xC0000409(STATUS_STACK_BUFFER_OVERRUN). Проявлялось одинаково на win32 и win64 — значит, это не разрядность, а непортированный исходный код вьюверов. - Причина:
1.
CTMCGROUTDoc::MakeDocFileName()вызывалSetPathName(GetTitle())иSetPathName(ch1)без второго аргументаbAddToMRU. По умолчанию онTRUE→ MFC пытается добавить в список недавних файлов неполный путь (GetTitle()— это заголовок вида «TMCGROUT1»). ВнутриCRecentFileList::AddвызываетсяGetFullPathName/AfxFullPathс недопустимым путём → срабатывает CRT‑обработчик недопустимого параметра → исключениеCInvalidArgException(«Encountered an improper argument»). 2. ВInitInstance()не былоAfxOleInit()(нужен для Shell/COM вCRecentFileListна Windows 7+) иSetRegistryKey()(без него настройки/MRU пишутся в%WINDIR%\*.INI— недоступный для записи путь). 3. ВStdAfx.hне было#include <afxdisp.h>(нужен дляAfxOleInit). - Исправление (правки в код, математика не затронута):
MakeDocFileName:SetPathName(GetTitle(), FALSE)иSetPathName(ch1, FALSE).InitInstance: добавленыAfxOleInit();иSetRegistryKey("<имя_программы>")(ключи:TMCGROUT,TMCROS,TMC_DN).StdAfx.h: добавлен#include <afxdisp.h>.- Файлы: в каждой из папок
Tmcgrout,Tmcrtout,DiaNapGr—TMCGROUT.cpp/TMCGROUT.CPP,TMCGROUTDoc.cpp,StdAfx.h. - Проверено: все вьюверы запускаются без ошибки и открывают
horns.socбез аварийного выхода. - Статус: закрыто.
7.3 Ядра (tmc_rth/tmc_rtx) и FieldView крашатся при открытии файла — Баг #6 · РЕШЁН
- Где:
kernels\PlanarRT_H\PlanRT_H.cppиkernels\PlanarRT_X\PlanRT_H.cpp(функцияCPlanRT_HApp::InitInstance);fieldview\FldView.cpp(CFldViewApp::InitInstance). - Затронуто:
tmc_rth.exe,tmc_rtx.exe,FieldView.exe. - Симптом: при открытии любого расчётного файла
.tpl(для ядер) или файла поля.dat(для FieldView) Windows показывает «Параметр задан неверно», программа молча закрывается, файл~$Prepr$~не создаётся. Код завершения процесса —0xC0000409(STATUS_STACK_BUFFER_OVERRUN). Запуск без файла работает; краш только при открытии документа. Дополнительный эффект: из ядра FieldView «не вызывается» — кнопка «View Field and topology» вроде срабатывает, но окно не появляется и ошибки нет: ядро запускает FieldView черезCreateProcess(успешно), а сам FieldView мгновенно падает по той же причине. - Причина: это тот же дефект, что Баг #5 (раздел 7.2), но не применённый к ядрам
и FieldView. В
InitInstanceестьLoadStdProfileSettings(список недавних файлов, MRU) иRegisterShellFileTypes, но нетAfxOleInit()(у ядер ещё и нетSetRegistryKey). При открытии документа MFC вызываетCDocument::SetPathName→CWinApp::AddToRecentFileList→CRecentFileList::Add, и тот бросает необработанное исключениеCInvalidArgException(AfxThrowInvalidArgException). Никто его не ловит →terminate()→0xC0000409→ система показывает «Параметр задан неверно». Краш происходит вSetPathNameдо чтения данных, поэтому препроцессор и не создаёт~$Prepr$~. В старом компиляторе/окружении это не падало. - Исправление (правка кода инициализации, математика не затронута):
- В
CPlanRT_HApp::InitInstance(обе папки ядер) в начало добавленыAfxOleInit();иSetRegistryKey("PlanarRT_H")/SetRegistryKey("PlanarRT_X"). - В
CFldViewApp::InitInstanceдобавленAfxOleInit();, дефолтныйSetRegistryKey("Local AppWizard-Generated Applications")заменён наSetRegistryKey("FieldView"). - В
kernels\PlanarRT_H\StdAfx.hиkernels\PlanarRT_X\StdAfx.hдобавлен#include <afxdisp.h>(в FieldView он уже был). - Эффект: настройки и MRU теперь пишутся в реестр
HKCU\Software\<ключ>, а не в недоступный%WINDIR%\*.INI. - Проверено: все 4 конфигурации ядер (tmc_rth/tmc_rtx × win32/win64) и FieldView
(win32/win64) пересобраны; открытие
.tpl/.datбольше не вызывает краш,~$Prepr$~создаётся, FieldView запускается и рисует поля. - Статус: закрыто.
Примечание: подробный символизированный стек падения — в журнале
ISSUES.md(Баг #6).
7.4 «Параметр задан неверно» при открытии TEST_EPS.TPL (выход за границу строки в ReadSmatrix) — Баг #7 · РЕШЁН
- Где:
src\libs\TMCIndan\TmcRTH_IndanOutput.cpp, методCTmcRTH_IndanOutput::ReadSmatrix, цикл поиска точки-расширения в имени S-файла (примерно строки 468–475). - Затронуто:
tmc_rth.exe,tmc_rtx.exe(код в общей библиотеке TMCIndan). - Симптом: после исправления Бага #6 ядра открывают почти все
.tpl, но конкретноsamples\TPL\TEST_EPS.TPLпри открытии показывает модальное окно «Параметр задан неверно.» с кнопкой ОК. Это не краш — процесс остаётся жив (ждёт нажатия ОК). Другие.tplсчитаются нормально. - Причина: опечатка индекса — в цикле обращение
csFileNameSMatrix[i]вместоcsFileNameSMatrix[j]. Цикл должен перебирать символы имени поj, но читает фиксированный индексi— смещение разбора строки SMATRIX (≈17), тогда как имяtest1071имеет длину 8. В современной MFCCString::operator[]при индексе строго больше длины строки бросаетAtlThrow(E_INVALIDARG)→COleExceptionс кодом0x80070057(этоHRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER)). Исключение бросается при чтении секции OUTPUT (вOnInitialUpdate→ReadData), его ловит штатный обработчик MFCCWinApp::ProcessWndProcException→CException::ReportError→AfxMessageBoxпоказывает системный текст «Параметр задан неверно». Старый компилятор в Release индекс не проверял (молча читал мусор), поэтому раньше «работало». - Почему только TEST_EPS: исключение возникает лишь когда индекс больше длины имени.
У соседнего метода чтения FILE (
ReadFile) аналогичный цикл стартует с индекса, равного длине строки (это допустимо —operator[]при индексе, равном длине, возвращает'\0'и не бросает), поэтому он безопасен для всех файлов. ВReadSmatrixиндекс заметно превышал длину именно для этого файла/имени. - Исправление (опечатка индекса, не математика): битый цикл заменён на безопасную
проверку наличия точки в имени через
strchr:
n = ( strchr( szBuf, '.' ) != NULL ) ? 1 : 0;
(где szBuf — то же имя файла). Смысл сохранён: если в имени нет точки-расширения,
ниже к нему добавляется .s.
- Пересборка: пересобрана библиотека TMCIndan.lib (win32+win64), затем
перелинкованы ядра tmc_rth/tmc_rtx (win32+win64) и FieldView.
- Проверено: все 4 ядра открывают TEST_EPS.TPL без окна ошибки, ~$Prepr$~
создаётся; контрольный прогон показал, что окно сообщения больше не вызывается.
- Статус: закрыто.
7.5 Ошибки сборки библиотек (Фаза 1) и их решения
Эти правки уже внесены (см. 03-build-libs.md, раздел 3.0). Если собираете из
неподготовленного исходника, можете встретить:
C1041— несколькоcl.exeпишут в один.pdb. Причина — устаревшие переопределенияObjectFileName/ProgramDataBaseFileName=.\Release/. Решение: снять эти переопределения (использовать дефолты изIntDir).- Toolset
v100не найден — проект ссылается на VS2010, которой нет. Решение: переключить Platform Toolset на v145 (свойства проекта → General). - Жёсткие пути
E:\WORK,D:\work,Z:\work,d:\tmc\lib— заголовки/библиотеки не находятся. Решение: удалить эти пути, подключитьbuild\Common.props/LibOutput.props. C2143/C2059вMAINWNDW.H(макросETIME) — правка С‑1: передenum ST_ITEMSдобавить#ifdef ETIME / #undef ETIME / #endif.C1083: error.h не найденвSFILE95\Sadd.cpp— правка С‑2: заменить#include <error.h>на#include <Error1.h>.
7.6 Ошибки сборки ядер (Фаза 3) и FieldView (Фаза 4)
error C3861: 'outp'/'inp' не найденвPL_GLFUN.CPP/Pl_glfun.cpp— правка П‑3: ветку доступа к портам заменить наBeep(freq, time)(см.05-build-kernels.md, раздел 5.0)./MACHINE:I386в линкере — убрать (лишняя; на x64 несовместима).C1083: gl\glaux.h не найденв FieldView — правка Ф4‑1: удалить#include <gl\glaux.h>и убратьglaux.libиз линкера (см.06-build-fieldview.md, раздел 6.2).
7.7 Линковка падает: «не найдена библиотека *.lib»
Проверьте:
- Все 6 библиотек Фазы 1 действительно лежат в
dist\win32\lib. - В свойствах проекта подключён
build\Common.props(он добавляетdist\win32\libв Library Directories). - Конфигурация Release и платформа Win32 совпадают и у библиотек, и у программы. Нельзя линковать 32‑битную программу с библиотекой, собранной под x64.
7.8 X‑мода: «рябь»/неустойчивость поля — сборка во float вместо double — Баг #11 · РЕШЁН КЛЮЧЕВОЕ
Это обязательный момент при сборке из «голого» исходника. Если его пропустить, X‑мода (
tmc_rtx) считает с виду нормально, но поле постепенно идёт «ребристостью» и расходится.
- Затронуто:
tmc_rtx.exe(X‑мода). H‑мода устойчива и во float, поэтому симптом виден только в X. - Симптом: на расчёте (напр.
samples\SAMPLE_R\ABSORBER\POLY.TPL) в FieldView поле покрывается растущей «ребристостью», волна «замирает», амплитуда со временем нарастает; одиночный импульс не гаснет до конца, а потом снова раскачивается. - Причина: в общем заголовке
src\Include\Typerth.hбыла активна одинарная точность_PREC_FLOAT(_real=float, 4 байта) вместо двойной_PREC_DOUBLE(double, 8 байт). 6‑компонентная схема рассеяния X‑моды бездиссипативная, маргинально устойчивая (собственное число оператора такта ≈ 1.0): воfloatошибка округления систематически накапливается и медленно раскачивает поле; вdoubleполе остаётся ограниченным. Это НЕ компилятор — сборка тех же исходников на VS2008 воfloatломается так же; A/B‑проверка x87 (/arch:IA32) SSE2 даёт идентичный рост. Числовая сверка с эталонной версией 2006 г.:double‑сборка совпадает с ней до ~6 значащих цифр и гасит импульс,float‑сборка расходится. Полный разбор —ISSUES.md, Баг #11. - Решение (применено): в
src\Include\Typerth.hоставить//#define _PREC_FLOAT #define _PREC_DOUBLEи пересобрать ВСЕ компоненты (6 библиотек + ядра + вьюверы + FieldView), т.к._realвходит в общие структуры (ABI) и в формат файлов. Размер элемента поляsizeof(_real)становится 8 байт (заголовок#TMCGROFLD_Accuracy 8); все читатели (вьюверы, FieldView) тоже собраны под double и читают его корректно (формат самоописывающийся). - Проверка: сверьте, что после расчёта в файле поля стоит
#...Accuracy 8, а импульсный расчёт затухает. - Статус: закрыто. Математика расчёта не менялась — восстановлена исходная двойная точность.
win32 · Step 7. Troubleshooting
This collects problems actually encountered while building and running TMC Suite for 32 bits, and their solutions. All solutions are already applied in the project; this section is for building from a "bare" source or if you hit the same symptom.
7.1 The "Statistics" button crashes the program (H and X modes) — Bug #1 · FIXED
- Where:
kernels\PlanarRT_H\TmcDialogStatistics.cppandkernels\PlanarRT_X\TmcDialogStatistics.cpp, the constructorCTmcDialogStatistics::CTmcDialogStatistics, initialization of the fieldcsTolerance. - Affected:
tmc_rth.exe,tmc_rtx.exe. - Symptom: pressing "View statistics" (Shift+F4) tries to open the statistics window, and the whole program closes silently with no error message. Identical in H and X.
- Cause (established by debugging): the constructor had
csTolerance.Format("100 %");. The string"100 %"is passed toCString::Formatas a format string. The%character begins a conversion specifier, the space is treated as a flag, and then the string ends — producing an incomplete specifier. The modern UCRT (theprintfengine:__stdio_common_vsprintf_s->format_validation) treats this as an invalid parameter: - in Debug a
_CRT_ASSERTfires; - in Release the CRT invalid-parameter handler fires -> silent process termination (exactly the observed symptom).
In the old compiler where the code was written, printf did not validate the format so
strictly, so it did not crash before.
- Fix (code change, math not affected): in both files csTolerance.Format("100 %");
was replaced with a direct assignment:
csTolerance = "100 %";
The resulting text is the same "100 %", but the formatting engine is not involved.
(An alternative is Format("100 %%"), but assignment is cleaner.)
- Verified: after the fix the "Statistics" window opens fully; the invalid-parameter
handler no longer fires.
- Status: closed.
Note: in
CLAUDE.md/BUILD_ORDER.mdthis bug may be marked "not fixed" — that is an outdated note. The current status per theISSUES.mdlog is fixed.
7.2 Viewers: "Encountered an improper argument" at startup — Bug #5 · FIXED
- Where: TMCGROUT, TMCROS, TMC_DN (shared viewer code).
- Symptom: at startup — the MFC error window "Encountered an improper argument";
after OK the application starts, but on "calling up a graph from a file" — the same
error. When explicitly opening
horns.soc, a hard abort0xC0000409(STATUS_STACK_BUFFER_OVERRUN) was observed. It appeared identically on win32 and win64, which means this is not bitness but unported viewer source code. - Cause:
1.
CTMCGROUTDoc::MakeDocFileName()calledSetPathName(GetTitle())andSetPathName(ch1)without the second argumentbAddToMRU. By default it isTRUE-> MFC tries to add an incomplete path to the recent-files list (GetTitle()is a title like "TMCGROUT1"). InsideCRecentFileList::Add,GetFullPathName/AfxFullPathis called with an invalid path -> the CRT invalid-parameter handler fires -> aCInvalidArgException("Encountered an improper argument"). 2.InitInstance()lackedAfxOleInit()(needed for Shell/COM inCRecentFileListon Windows 7+) andSetRegistryKey()(without it, settings/MRU are written to%WINDIR%\*.INI— a path not writable). 3.StdAfx.hlacked#include <afxdisp.h>(needed forAfxOleInit). - Fix (code changes, math not affected):
MakeDocFileName:SetPathName(GetTitle(), FALSE)andSetPathName(ch1, FALSE).InitInstance: addedAfxOleInit();andSetRegistryKey("<program name>")(keys:TMCGROUT,TMCROS,TMC_DN).StdAfx.h: added#include <afxdisp.h>.- Files: in each of the folders
Tmcgrout,Tmcrtout,DiaNapGr—TMCGROUT.cpp/TMCGROUT.CPP,TMCGROUTDoc.cpp,StdAfx.h. - Verified: all viewers start without the error and open
horns.socwithout an abort. - Status: closed.
7.3 Kernels (tmc_rth/tmc_rtx) and FieldView crash when opening a file — Bug #6 · FIXED
- Where:
kernels\PlanarRT_H\PlanRT_H.cppandkernels\PlanarRT_X\PlanRT_H.cpp(the functionCPlanRT_HApp::InitInstance);fieldview\FldView.cpp(CFldViewApp::InitInstance). - Affected:
tmc_rth.exe,tmc_rtx.exe,FieldView.exe. - Symptom: when opening any computation file
.tpl(for the kernels) or a field file.dat(for FieldView), Windows shows "The parameter is incorrect", the program closes silently, and the file~$Prepr$~is not created. The process exit code is0xC0000409(STATUS_STACK_BUFFER_OVERRUN). Starting without a file works; the crash is only when opening a document. An additional effect: FieldView "is not called" from the kernel — the "View Field and topology" button seems to trigger, but no window appears and there is no error: the kernel launches FieldView viaCreateProcess(successfully), and FieldView itself crashes instantly for the same reason. - Cause: this is the same defect as Bug #5 (section 7.2), but not applied to the
kernels and FieldView. In
InitInstancethere isLoadStdProfileSettings(the recent-files list, MRU) andRegisterShellFileTypes, but noAfxOleInit()(the kernels also lackSetRegistryKey). When a document is opened, MFC callsCDocument::SetPathName->CWinApp::AddToRecentFileList->CRecentFileList::Add, and it throws an unhandledCInvalidArgException(AfxThrowInvalidArgException). Nobody catches it ->terminate()->0xC0000409-> the system shows "The parameter is incorrect". The crash happens inSetPathNamebefore the data is read, which is why the preprocessor never creates~$Prepr$~. In the old compiler/environment this did not crash. - Fix (initialization code change, math not affected):
- In
CPlanRT_HApp::InitInstance(both kernel folders),AfxOleInit();andSetRegistryKey("PlanarRT_H")/SetRegistryKey("PlanarRT_X")were added at the beginning. - In
CFldViewApp::InitInstance,AfxOleInit();was added, and the defaultSetRegistryKey("Local AppWizard-Generated Applications")was replaced withSetRegistryKey("FieldView"). - In
kernels\PlanarRT_H\StdAfx.handkernels\PlanarRT_X\StdAfx.h,#include <afxdisp.h>was added (FieldView already had it). - Effect: settings and MRU are now written to the registry
HKCU\Software\<key>, not to the inaccessible%WINDIR%\*.INI. - Verified: all 4 kernel configurations (tmc_rth/tmc_rtx × win32/win64) and FieldView
(win32/win64) were rebuilt; opening
.tpl/.datno longer crashes,~$Prepr$~is created, FieldView launches and draws fields. - Status: closed.
Note: the detailed symbolized crash stack is in the
ISSUES.mdlog (Bug #6).
7.4 "The parameter is incorrect" when opening TEST_EPS.TPL (out-of-range string access in ReadSmatrix) — Bug #7 · FIXED
- Where:
src\libs\TMCIndan\TmcRTH_IndanOutput.cpp, the methodCTmcRTH_IndanOutput::ReadSmatrix, the loop searching for the extension dot in the S-file name (around lines 468–475). - Affected:
tmc_rth.exe,tmc_rtx.exe(code in the shared library TMCIndan). - Symptom: after fixing Bug #6 the kernels open almost all
.tpl, but specificallysamples\TPL\TEST_EPS.TPLshows, on opening, a modal window "The parameter is incorrect." with an OK button. This is not a crash — the process stays alive (waiting for OK). Other.tplfiles compute normally. - Cause: an index typo — in the loop the access is
csFileNameSMatrix[i]instead ofcsFileNameSMatrix[j]. The loop should iterate over the name characters viaj, but it reads a fixed indexi— the parse offset of the SMATRIX line (~17), whereas the nametest1071is 8 characters long. In modern MFC,CString::operator[]with an index strictly greater than the string length throwsAtlThrow(E_INVALIDARG)->COleExceptionwith code0x80070057(which isHRESULT_FROM_WIN32(ERROR_INVALID_PARAMETER)). The exception is thrown while reading the OUTPUT section (inOnInitialUpdate->ReadData); the standard MFC handlerCWinApp::ProcessWndProcException->CException::ReportError->AfxMessageBoxshows the system text "The parameter is incorrect". The old compiler in Release did not check the index (it silently read garbage), so it "worked" before. - Why only TEST_EPS: the exception arises only when the index exceeds the name length.
The neighboring FILE reading method (
ReadFile) has a similar loop that starts at an index equal to the string length (which is allowed —operator[]with an index equal to the length returns'\0'and does not throw), so it is safe for all files. InReadSmatrixthe index noticeably exceeded the length for this particular file/name. - Fix (index typo, not math): the broken loop was replaced with a safe check for the
presence of a dot in the name via
strchr:
n = ( strchr( szBuf, '.' ) != NULL ) ? 1 : 0;
(where szBuf is the same file name). The meaning is preserved: if the name has no
extension dot, .s is appended below.
- Rebuild: the TMCIndan.lib library was rebuilt (win32+win64), then the kernels
tmc_rth/tmc_rtx (win32+win64) and FieldView were relinked.
- Verified: all 4 kernels open TEST_EPS.TPL without the error window, ~$Prepr$~ is
created; a control run showed that the message window is no longer raised.
- Status: closed.
7.5 Library build errors (Phase 1) and their solutions
These changes are already applied (see 03-build-libs.md, section 3.0). If you build from
unprepared sources, you may encounter:
C1041— severalcl.exewriting into one.pdb. Cause — obsolete overridesObjectFileName/ProgramDataBaseFileName=.\Release/. Solution: remove these overrides (use the defaults fromIntDir).- Toolset
v100not found — the project references VS2010, which is absent. Solution: switch Platform Toolset to v145 (project properties -> General). - Hard paths
E:\WORK,D:\work,Z:\work,d:\tmc\lib— headers/libraries are not found. Solution: remove these paths, attachbuild\Common.props/LibOutput.props. C2143/C2059inMAINWNDW.H(theETIMEmacro) — change C-1: beforeenum ST_ITEMSadd#ifdef ETIME / #undef ETIME / #endif.C1083: error.h not foundinSFILE95\Sadd.cpp— change C-2: replace#include <error.h>with#include <Error1.h>.
7.6 Kernel build errors (Phase 3) and FieldView (Phase 4)
error C3861: 'outp'/'inp' not foundinPL_GLFUN.CPP/Pl_glfun.cpp— change P-3: replace the port-access branch withBeep(freq, time)(see05-build-kernels.md, section 5.0)./MACHINE:I386in the linker — remove (unnecessary; incompatible with x64).C1083: gl\glaux.h not foundin FieldView — change F4-1: remove#include <gl\glaux.h>and removeglaux.libfrom the linker (see06-build-fieldview.md, section 6.2).
7.7 Linking fails: "library *.lib not found"
Check:
- All 6 Phase 1 libraries are actually in
dist\win32\lib. build\Common.propsis attached in the project properties (it addsdist\win32\libto Library Directories).- The Release configuration and Win32 platform match for both the libraries and the program. You cannot link a 32-bit program with a library built for x64.
7.8 X-mode: field "ripple"/instability — building in float instead of double — Bug #11 · FIXED · KEY
This is a mandatory point when building from a "bare" source. If you skip it, the X-mode (
tmc_rtx) computes seemingly normally, but the field gradually develops "rippling" and diverges.
- Affected:
tmc_rtx.exe(X-mode). The H-mode is stable even in float, so the symptom is only visible in X. - Symptom: in a computation (e.g.
samples\SAMPLE_R\ABSORBER\POLY.TPL) the field in FieldView becomes covered with growing "rippling", the wave "freezes", the amplitude grows over time; a single pulse does not fully decay and then swings up again. - Cause: in the shared header
src\Include\Typerth.h, single precision_PREC_FLOAT(_real=float, 4 bytes) was active instead of double_PREC_DOUBLE(double, 8 bytes). The 6-component X-mode scattering scheme is non-dissipative, marginally stable (the eigenvalue of the step operator ≈ 1.0): infloatthe rounding error systematically accumulates and slowly swings the field; indoublethe field stays bounded. This is NOT the compiler — building the same sources on VS2008 infloatbreaks the same way; an A/B check of x87 (/arch:IA32) vs SSE2 gives identical growth. A numerical comparison with the 2006 reference version: thedoublebuild matches it to ~6 significant digits and damps the pulse, thefloatbuild diverges. Full analysis —ISSUES.md, Bug #11. - Solution (applied): in
src\Include\Typerth.hkeep//#define _PREC_FLOAT #define _PREC_DOUBLEand rebuild ALL components (6 libraries + kernels + viewers + FieldView), because_realis part of the shared structures (ABI) and of the file format. The field element sizesizeof(_real)becomes 8 bytes (header#TMCGROFLD_Accuracy 8); all readers (viewers, FieldView) are also built as double and read it correctly (the format is self-describing). - Check: verify that after the computation the field file has
#...Accuracy 8, and the pulse computation decays. - Status: closed. The computation math was not changed — the original double precision was restored.