Pelles C forum

Pelles C => Add-ins => Topic started by: TimoVJL on September 21, 2018, 12:40:39 PM

Title: PrjChkMS Add-In
Post by: TimoVJL on September 21, 2018, 12:40:39 PM
I someone is bored to fix that "\Include\Win\winnt.h(105): fatal error #1014: #error: "No Target Architecture"."
then PrjChkMS Add-In example can help and add that option -Ze automatically.
Title: Re: PrjChkMS Add-In
Post by: John Z on November 14, 2025, 02:24:50 PM
Here is the fix - 
one required change in BuildCheck, one recommended notification addition
changes marked //ZZ or just copy and paste in this code replacing the procedure.
void BuildCheck(HWND hWndPrj)
{
//AddIn_WriteOutput(g_hwndMain, TEXT("Build error"));
HWND hWnd = GetDlgItem(g_hwndMain, 0x17B6); // 0x17B6 PC_Build
if (hWnd)
{
//AddIn_WriteOutput(g_hwndMain, TEXT("PC_Build"));
FINDTEXT ft;
ft.chrg.cpMin = 0;
ft.chrg.cpMax = -1;
//ZZ ft.lpstrText = TEXT("#error: \"No Target Architecture\"");
ft.lpstrText = TEXT("fatal error #1014"); //ZZ FIX
HWND hREdit = FindWindowEx(hWnd, NULL, TEXT("RichEdit20W"), NULL);
if (SendMessage(hREdit, EM_FINDTEXT, 1, (LPARAM)&ft) > 0) {
TCHAR szTmp[1024];
AddIn_WriteOutput(g_hwndMain, TEXT("fatal error #1014 -No Target Architecture"));
int nLen = AddIn_GetProjectSymbol(hWndPrj, TEXT("CCFLAGS"), szTmp, 2048);
lstrcpy(szTmp+nLen, TEXT(" -Ze"));
//AddIn_WriteOutput(g_hwndMain, szTmp);
AddIn_SetProjectSymbol(hWndPrj, TEXT("CCFLAGS"), szTmp);
AddIn_WriteOutput(g_hwndMain, TEXT("Fixed error, Build again -"));//ZZ recommend ADD
}
}
}

Tested PellesC V13 on Win 11 24H2 but should work for any other windows version using PellesC V13

John z
Title: Re: PrjChkMS Add-In
Post by: TimoVJL on November 14, 2025, 04:44:19 PM
Thanks,
more informative.