The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My work

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,841 other followers

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:

  1. DUnitX uses the DUNITX-DEBUG define to enable debugging of DUnitX itself in DUnitX.inc which also supports the DUNITXDEBUG define in the same area.
  2. Delphi will translate a .RC file in a project into a BRCC32.exe call adding the project conditional defines and search paths
  3. 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 Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: