{"action":"created","issue":{"url":"https://api.github.com/repos/VSoftTechnologies/DUnitX/issues/158","repository_url":"https://api.github.com/repos/VSoftTechnologies/DUnitX","labels_url":"https://api.github.com/repos/VSoftTechnologies/DUnitX/issues/158/labels{/name}","comments_url":"https://api.github.com/repos/VSoftTechnologies/DUnitX/issues/158/comments","events_url":"https://api.github.com/repos/VSoftTechnologies/DUnitX/issues/158/events","html_url":"https://github.com/VSoftTechnologies/DUnitX/issues/158","id":175712054,"number":158,"title":"When BRCC32 throws `Fatal error Illegal macro definition in command line or defines page.` in a DUnitX project","user":{"login":"jpluimers","id":2033367,"avatar_url":"https://avatars.githubusercontent.com/u/2033367?v=3","gravatar_id":"","url":"https://api.github.com/users/jpluimers","html_url":"https://github.com/jpluimers","followers_url":"https://api.github.com/users/jpluimers/followers","following_url":"https://api.github.com/users/jpluimers/following{/other_user}","gists_url":"https://api.github.com/users/jpluimers/gists{/gist_id}","starred_url":"https://api.github.com/users/jpluimers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpluimers/subscriptions","organizations_url":"https://api.github.com/users/jpluimers/orgs","repos_url":"https://api.github.com/users/jpluimers/repos","events_url":"https://api.github.com/users/jpluimers/events{/privacy}","received_events_url":"https://api.github.com/users/jpluimers/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-09-08T09:54:02Z","updated_at":"2016-09-08T13:39:40Z","closed_at":null,"body":"I had a [Fatal error Illegal macro definition in command line or defines page.](https://www.google.com/search?q=\"Fatal+error+Illegal+macro+definition+in+command+line+or+defines+page.\") thrown by [BRCC32.exe](https://www.google.com/search?q=BRCC32.exe) in one of my Delphi projects.\r\n\r\nAs [cgrc.exe could build the .rc file](http://www.progtown.com/post37220712.html#p37220712) [[source](http://www.sql.ru/forum/1112611/msbuild-opciya-dlya-rc-faylov) in Russian; [WayBack](http://web.archive.org/web/20160908092623/http://www.sql.ru/forum/1112611/msbuild-opciya-dlya-rc-faylov)], 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](https://www.google.com/search?q=\"Fatal+error+Illegal+macro+definition+in+command+line+or+defines+page.\") I found before.\r\n\r\nMy project was based on one of the [DUnitX test projects](https://github.com/VSoftTechnologies/DUnitX/blob/master/Tests/DUnitXTest_XE8.dproj). It ran in [Delphi XE8](https://wiert.me/2016/02/13/bldn-december-2015-xe7xe8-update-subscription-update-got-released-20160211-with-backported-10-seattle-fixes/), but the Delphi version doesn't matter as BRCC32 hasn't been updated since 1999.\r\n\r\nFurther below are the failure/success examples; this went wrong:\r\n\r\n- DUnitX uses the `DUNITX-DEBUG` define to enable debugging of DUnitX itself [in DUnitX.inc](https://github.com/VSoftTechnologies/DUnitX/blob/master/DUnitX.inc#L254) which also supports the `DUNITXDEBUG` define [in the same area](https://github.com/VSoftTechnologies/DUnitX/blob/master/DUnitX.inc#L255).\r\n- Delphi will translate a .RC file in a project into a BRCC32.exe call adding the project conditional defines and search paths\r\n- 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.`\r\n\r\nSo either removing `DUNITX-DEBUG` or changing it into `DUNITXDEBUG` solves the problem. Hence my pull-request.\r\n\r\nThis fails:\r\n\r\n```\r\nC:\\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\r\nBorland Resource Compiler Version 5.40\r\nCopyright (c) 1990, 1999 Inprise Corporation. All rights reserved.\r\n\r\nFatal error Illegal macro definition in command line or defines page.\r\n```\r\n\r\nThis works:\r\n\r\n```\r\nC:\\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\r\nBorland Resource Compiler Version 5.40\r\nCopyright (c) 1990, 1999 Inprise Corporation. All rights reserved.\r\n```\r\n\r\n--jeroen"},"comment":{"url":"https://api.github.com/repos/VSoftTechnologies/DUnitX/issues/comments/245600189","html_url":"https://github.com/VSoftTechnologies/DUnitX/issues/158#issuecomment-245600189","issue_url":"https://api.github.com/repos/VSoftTechnologies/DUnitX/issues/158","id":245600189,"user":{"login":"jpluimers","id":2033367,"avatar_url":"https://avatars.githubusercontent.com/u/2033367?v=3","gravatar_id":"","url":"https://api.github.com/users/jpluimers","html_url":"https://github.com/jpluimers","followers_url":"https://api.github.com/users/jpluimers/followers","following_url":"https://api.github.com/users/jpluimers/following{/other_user}","gists_url":"https://api.github.com/users/jpluimers/gists{/gist_id}","starred_url":"https://api.github.com/users/jpluimers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpluimers/subscriptions","organizations_url":"https://api.github.com/users/jpluimers/orgs","repos_url":"https://api.github.com/users/jpluimers/repos","events_url":"https://api.github.com/users/jpluimers/events{/privacy}","received_events_url":"https://api.github.com/users/jpluimers/received_events","type":"User","site_admin":false},"created_at":"2016-09-08T13:39:40Z","updated_at":"2016-09-08T13:39:40Z","body":"@rmcginty thanks. Basically it's just eliminating causes in a structured way (:\r\n\r\nJust checked: `DUNITX_DEBUG` as a conditional define works fine with BRCC32.exe.\r\n\r\nI think the cause of the BRCC32.exe error is that defines need to be an \"identifier\" for the resource compiler. Just like in the Object Pascal language, underscores are fine in identifiers, but hyphens are not.\r\n\r\nThe Object Pascal apparently has other rules for conditional defines than for regular identifiers, though looking at your comment in https://github.com/VSoftTechnologies/DUnitX/blob/master/DUnitX.inc#L249 those rules aren't handled consistently in the Delphi tool-chain."}}
{"actor":{"display_login":"jpluimers"}}