When BRCC32 throws `Fatal error Illegal macro definition in command line or defines page.` in a DUnitX project
Posted by jpluimers on 2017/04/19
I had a Fatal error Illegal macro definition in command line or defines page. thrown by BRCC32.exe in one of my Delphi projects.
As cgrc.exe could build the .rc file [source in Russian; WayBack], I reproduced it from the console with an Empty.rc file that has no content. That way I could rule out file content: now it had to be command-line arguments which is a different cause than any of the search results I found before.
My project was based on one of the DUnitX test projects. It ran in Delphi XE8, but the Delphi version doesn’t matter as BRCC32 hasn’t been updated since 1999.
Further below are the failure/success examples; this went wrong:
- DUnitX uses the
DUNITX-DEBUGdefine to enable debugging of DUnitX itself inDUnitX.incwhich also supports theDUNITXDEBUGdefine in the same area. - Delphi will translate a .RC file in a project into a BRCC32.exe call adding the project conditional defines and search paths
- BRCC32.exe doesn’t like hyphens in conditional defines throwing a non-descriptive error
Fatal error Illegal macro definition in command line or defines page.
So either removing DUNITX-DEBUG or changing it into DUNITXDEBUG solves the problem. Hence my pull-request.
This fails:
C:\Temp>"c:\program files (x86)\embarcadero\studio\16.0\bin\brcc32.exe" -dDUNITX-DEBUG;DEBUG;TESTINSIGHT -iC:\Users\Public\Documents\Embarcadero\Studio\16.0\SelectiveDebugging\Win32;"c:\program files (x86)\embarcadero\studio\16.0\lib\Win32\release";C:\Users\jeroenp\Documents\Embarcadero\Studio\16.0\Imports;"c:\program files (x86)\embarcadero\studio\16.0\Imports";C:\Users\Public\Documents\Embarcadero\Studio\16.0\Dcp;"c:\program files (x86)\embarcadero\studio\16.0\include";"C:\Program Files (x86)\FastReports\LibD22";"C:\Program Files (x86)\Raize\CS5\Lib\RS-XE8\Win32";"C:\Program Files (x86)\FastReport 5 VCL Enterprise\LIBD22" Empty.rc -foEmpty.res Borland Resource Compiler Version 5.40 Copyright (c) 1990, 1999 Inprise Corporation. All rights reserved. Fatal error Illegal macro definition in command line or defines page.
This works:
C:\Temp>"c:\program files (x86)\embarcadero\studio\16.0\bin\brcc32.exe" -d;DEBUG;TESTINSIGHT -iC:\Users\Public\Documents\Embarcadero\Studio\16.0\SelectiveDebugging\Win32;"c:\program files (x86)\embarcadero\studio\16.0\lib\Win32\release";C:\Users\jeroenp\Documents\Embarcadero\Studio\16.0\Imports;"c:\program files (x86)\embarcadero\studio\16.0\Imports";C:\Users\Public\Documents\Embarcadero\Studio\16.0\Dcp;"c:\program files (x86)\embarcadero\studio\16.0\include";"C:\Program Files (x86)\FastReports\LibD22";"C:\Program Files (x86)\Raize\CS5\Lib\RS-XE8\Win32";"C:\Program Files (x86)\FastReport 5 VCL Enterprise\LIBD22" Empty.rc -foEmpty.res Borland Resource Compiler Version 5.40 Copyright (c) 1990, 1999 Inprise Corporation. All rights reserved.
–jeroen






Leave a comment