• Hey! Guest! The 39th GMC Jam will take place between November 26th, 12:00 UTC and November 30th, 12:00 UTC. Why not join in! Click here to find out more!
  • Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

GMS 2.3+ 2.3 YYC Mac build Xcode error: Unknown type name 'var'

meltypixel

Member
I recently upgraded to GMS 2.3, and I'm running a separate install of the beta just in case I needed to roll back easily. I'm attempting to export with YYC, but I'm getting an Xcode error: Unknown type name 'var' in the very first piece of code that the game attempts to compile. This game compiled fine last week, and has zero issues on Windows. Here is the full error report from Xcode:

Code:
/Users/myname/GameMakerStudio2/Mac/GMS2MAC/Mixolumia/Mixolumia/Mixolumia/Game/gml_Object_game_obj_Create_0.gml.cpp:1034:145: error: unknown type name 'var'
(*sself_current_player)=(/* context id changed from 3948 to 185*/(*sself_demo_mode).asBool() ? YYRValue((const char*)g_pString5899_97B01BCA) :  YYCOMPOUNDEXPR_BEGIN sself_demo_mode = &((CInstanceBase*)pSelf)->GetYYVarRef(kVARID_self_demo_mode); /* set ContextID to 4008 */
                                                                                                                                                ^
In file included from /Users/myname/GameMakerStudio2/Mac/GMS2MAC/Mixolumia/Mixolumia/Mixolumia/Game/gml_Object_game_obj_Create_0.gml.cpp:1:
Mixolumia/YYGML.h:35:32: note: expanded from macro 'YYCOMPOUNDEXPR_BEGIN'
#define YYCOMPOUNDEXPR_BEGIN    ({var a =
                                  ^
1 error generated.
This is the game code it seems to be getting hung up on:
Code:
demo_mode = false;
current_player = demo_mode ? "guest" : undefined;
I really don't know what to do with this info and I'm at a loss as to how to compile on Mac anymore.
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
Moderator
Not much I can say other than please file a bug report and include a link to download the YYZ of the project with the issue.
 

meltypixel

Member
I've submitted a bug report with a test project that fails to build via YYC on mac for me, but just in case someone else is having this issue: I think I've narrowed it down to an issue with ternary operators where one of the values is undefined.
 

Mool

Member
@meltypixel Does YYC work for you on android? For me, my compiled scripts get not cached: means I need per compile 30min, because it always start from the beginning
 

rologfos

Member
I am getting the same issue. Xcode gets hung up on this line of code:

GML:
draw_set_color(selector == i ? c_white : global.color_gray);
Compiled fine before GM 2.3

Neither of the values here are undefined so maybe it's just an issue with ternary operators?
EDIT: Well actually the global isn't defined when compiled, so maybe it is that.
 

meltypixel

Member
I am getting the same issue. Xcode gets hung up on this line of code:

GML:
draw_set_color(selector == i ? c_white : global.color_gray);
Compiled fine before GM 2.3

Neither of the values here are undefined so maybe it's just an issue with ternary operators?
EDIT: Well actually the global isn't defined when compiled, so maybe it is that.
Yeah, I wound up replacing all of the ternary operators in my project with if/else statements, which included combing through Juju Adams' scribble library. It was a nightmare! But I had to ship! Not my favorite moment using GMS.
 

meltypixel

Member
Oh no! Give me a ping next time and I'll do all that boring legwork for you.
Ah, that's kind of you! This really didn't seem to be in the realm of being your problem, and from patch notes it looks like YoYo has cleared up the issue, though. Thanks for all your super helpful projects on github and generally being a source of cool GMS stuff.
 
Top