Author Topic: [Solved] (Autogenerated) "Macro 'DEBUG' is already defined"  (Read 203 times)

Hello,

when editing a game and choosing "Build/Rebuild all files", I get the message:
Code: Adventure Game Studio
  1. Failed to save room room1.crm; details below
  2. _AutoGenerated.ash(67): Macro 'DEBUG' is already defined

The online help says that the most likely cause is two things with the same name. In that case, I'm at a loss what those names might be.

I can't read _Autogenerated.ash, so I can only guess at what the code tries to autogenerate.

So how do I hunt down the misalignment?

AGS version 3.4.1
Windows 10
« Last Edit: 11 May 2018, 22:25 by fernewelten »

Crimson Wizard

  • AGS Project Tracker Admins
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    •  
    • Lifetime Achievement Award Winner
    •  
    • Crimson Wizard worked on a game that was nominated for an AGS Award!
      Crimson Wizard worked on a game that won an AGS Award!
Re: (Autogenerated) Macro 'DEBUG' is already defined
« Reply #1 on: 11 May 2018, 19:39 »
The online help says that the most likely cause is two things with the same name. In that case, I'm at a loss what those names might be.

It's "DEBUG" name, as the error reports.

Make sure that you do not have any GUIs, characters, views, variables, etc called "DEBUG".

Also, AGS silently creates a number of numeric constants for characters, views, gui and something else, by taking out first letter in their name, for example if you have character cDebug, it will create DEBUG constant, that could also cause this error.
« Last Edit: 11 May 2018, 19:41 by Crimson Wizard »

Re: (Autogenerated) Macro 'DEBUG' is already defined
« Reply #2 on: 11 May 2018, 19:48 »
Also did you know you can highlight a word in a script and right click an option to find all uses of that word in all scripts? Useful tool, although if it is the name of a view etc, that's not going to find it that way. Just incase you weren't aware, that's all.

Re: (Autogenerated) Macro 'DEBUG' is already defined
« Reply #3 on: 11 May 2018, 22:24 »
Also, AGS silently creates a number of numeric constants for characters, views, gui and something else, by taking out first letter in their name, for example if you have character cDebug, it will create DEBUG constant, that could also cause this error.

Thanks a lot: That pinpointed the problem. :-D Although I didn't have DEBUG for anything, I did have a GUI named gDebug (for showing debugging variables on-screen). Renaming that GUI to gDebugx made the error go away.

Also, special thanks to you and to ManicMatt for the ultra fast response time! 8-)