News:

Download Pelles C here: http://www.smorgasbordet.com/pellesc/

Main Menu

PrjChkMS Add-In

Started by TimoVJL, September 21, 2018, 12:40:39 PM

Previous topic - Next topic

TimoVJL

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.
May the source be with you

John Z

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

TimoVJL

May the source be with you