Severe Problems compiling for Mac

45 views
Skip to first unread message

Tobi

unread,
Sep 17, 2013, 9:42:14 AM9/17/13
to aw...@googlegroups.com
Hi everyone,

I am facing severe problems compiling my game for Mac, iOS, Android, BlackBerry, ...

I don't know if it is an awe6 problem (surely not ;-)), but I think the awe6 group might be of more help than the Openfl group to fix this.


First I am running these haxelibs:

awe6: 2.0.572 [2.1.585]
hxcpp: [3.0.2]
openfl: 1.0.4 1.0.5 [1.0.6]
openfl-compatibility: [1.0.1]
openfl-html5: 1.0.3 1.0.4 [1.0.5]
openfl-native: 1.0.4 1.0.6 [1.0.8]
openfl-samples: [1.0.0] 1.0.0-rc.3
openfl-tools: [1.0.10] 1.0.4 1.0.6


I created a new projected using haxelib run awe6 create project openfl ...


Trying to run this project on a Mac results in an error at compile time:

./src/de/test/gui/Overlay.cpp:183:23: error: lookup of 'super' in member access expression is ambiguous
                                                        return __this->super::_getButton(p_type);
                                                                       ^
include/awe6/core/drivers/openfl/native/Overlay.h:39:47: note: lookup in the object type '::awe6::core::drivers::openfl::native::Overlay_obj' refers here
                typedef ::awe6::core::drivers::AOverlay_obj super;
                                                            ^
include/de/test/gui/Overlay.h:40:62: note: lookup from the current scope refers here
                typedef ::awe6::core::drivers::openfl::native::Overlay_obj super;
                                
                                           ^

Trying to run it for BlackBerry:

DHXCPP_VISIT_ALLOCS -fpic -fPIC -x c++ -frtti -I./obj/blackberry/__pch/haxe ./src/awe6/interfaces/IScene.cpp -o./obj/blackberry/src/awe6/interfaces/IScene.o
./src/awe6/core/Scene.cpp: In member function 'virtual Void awe6::core::Scene_obj::removeEntity(awe6::interfaces::IEntity, awe6::interfaces::EAgenda, hx::Null<bool>)':
./src/awe6/core/Scene.cpp:224:103: error: could not convert 'Dynamic::operator()(const Dynamic&, const Dynamic&, const Dynamic&)((* & Dynamic((*(const hx::ObjectPtr<awe6::interfaces::IEntity_obj>*)(& p_entity)))), (* & Dynamic((*(const hx::ObjectPtr<awe6::interfaces::EAgenda_obj>*)(& p_agenda)))), (* & Dynamic(p_isRemovedFromView)))' from 'Dynamic' to 'Void {aka null}'
ntoarmv7-g++ -Iinclude -c -O2 -I/usr/lib/haxe/lib/hxcpp/3,0,2//include -I/Applications/bbndk/target_10_1_0_1020/qnx6/usr/include -DBLACKBERRY -fvisibility=hidden -fdollars-in-identifiers -DHXCPP_VISIT_ALLOCS -fpic -fPIC -x c++ -frtti -I./obj/blackberry/__pch/haxe ./src/awe6/core/_MessageManager/_HelperMessage.cpp -o./obj/blackberry/src/awe6/core/_MessageManager/_HelperMessage.o


Trying to run for Android (nearly the same error as BlackBerry):
./src/awe6/core/Scene.cpp: In member function 'virtual Void awe6::core::Scene_obj::removeEntity(awe6::interfaces::IEntity, awe6::interfaces::EAgenda, hx::Null<bool>)':
./src/awe6/core/Scene.cpp:224: error: conversion from 'Dynamic' to non-scalar type 'Void' requested


Anybody has some ideas how to fix this?

Rob Fell

unread,
Sep 17, 2013, 1:13:26 PM9/17/13
to aw...@googlegroups.com
 
Hi Tobi, I'd really like your help on fixing this.  We can't replicate on our systems (Windows), but I have seen it on a Mac (but didn't get chance to dig deeper).  It's one of those things that should work, but doesn't ...
 
Since then my thinking was that a workaround could be developed by modifying the journey of the inheritance chain.  At least that might rule some things out?
 
Can you modify "test.gui.Overlay" to extend "awe6.core.drivers.openfl.native.Overlay" (instead of "awe6.core.Overlay") and try a rebuild for cpp.
 
Thanks, Rob

Rob Fell

unread,
Sep 17, 2013, 2:50:49 PM9/17/13
to aw...@googlegroups.com
See also this fix for the return error in Scene.
 

Tobi

unread,
Sep 18, 2013, 2:50:13 AM9/18/13
to aw...@googlegroups.com
I've extended the Overlay class to read "awe6.core.drivers.openfl.native.Overlay" but that doesn't change the error message.

./src/de/test/gui/Overlay.cpp:183:23: error: lookup of 'super' in member access
      expression is ambiguous
  ...return __this->super::_getButton(p_type);
                    ^
include/awe6/core/drivers/openfl/native/Overlay.h:39:47: note: lookup in the
      object type '::awe6::core::drivers::openfl::native::Overlay_obj' refers
      here
                typedef ::awe6::core::drivers::AOverlay_obj super;
                                                            ^
include/de/test/gui/Overlay.h:40:62: note: lookup from the current scope refers
      here
  ...typedef ::awe6::core::drivers::openfl::native::Overlay_obj super;

Tobi

unread,
Sep 18, 2013, 7:42:31 AM9/18/13
to aw...@googlegroups.com
Funny thing is:

An old version of my custom implementation of Overlay (for another game) is working nice:

package game;

import awe6.core.Overlay;
import awe6.core.BasicButton;
import game.scenes.overlays.EExtendedOverlayButton;
import awe6.interfaces.IKernel;
import awe6.interfaces.IView;
import awe6.interfaces.EOverlayButton;
import awe6.interfaces.EScene;
import game.scenes.EExtendedScene;

/**
 * ...
 * @author tr
 */
class MyOverlay extends Overlay{

private var _imprintButton:BasicButton;
public function new( p_kernel:IKernel, ?p_buttonWidth:Float = 30.0, ?p_buttonHeight:Float = 30.0, ?p_border:IView, ?p_backUp:IView, ?p_backOver:IView, ?p_muteUp:IView, ?p_muteOver:IView, ?p_unmuteUp:IView, ?p_unmuteOver:IView, ?p_pauseUp:IView, ?p_pauseOver:IView, ?p_unpauseUp:IView, ?p_unpauseOver:IView, ?p_imprintOver:IView, ?p_imprintUp:IView, ?p_pauseBlur:Float = 8, ?p_pauseColor:Int = 0x000000, ?p_pauseAlpha:Float = .35  ){
_imprintButton = new BasicButton(p_kernel, p_imprintUp, p_imprintOver, p_buttonWidth, p_buttonHeight);
super( p_kernel, p_buttonWidth, p_buttonHeight, p_border, p_backUp, p_backOver, p_muteUp, p_muteOver, p_unmuteUp, p_unmuteOver, p_pauseUp, p_pauseOver, p_unpauseUp, p_unpauseOver, p_pauseBlur, p_pauseColor, p_pauseAlpha );
}
override private function _init(){
super._init();
_imprintButton.onClickCallback =  _openImprint.bind(EOverlayButton.SUB_TYPE(EExtendedOverlayButton.IMPRINT) );
_buttonUnmute.onClickCallback = activateButton.bind(EOverlayButton.UNMUTE );
addEntity( _imprintButton, true, 26 );
}
override private function _getButton( p_type:EOverlayButton ):BasicButton
{
switch( p_type )
{
case SUB_TYPE( l_value ) :
if ( l_value == EExtendedOverlayButton.IMPRINT){
return _imprintButton;
}
default: null;
}
return super._getButton(p_type);
}
private function _openImprint( p_type:EOverlayButton ){
_kernel.scenes.setScene(EScene.SUB_TYPE(EExtendedScene.IMPRINT));
}
override public function activateButton( p_type:EOverlayButton ):Void
{
if (p_type == EOverlayButton.MUTE){
var l_factory:Factory = cast _kernel.factory;
l_factory.stopMusic();
}
else if (p_type == EOverlayButton.UNMUTE){
var l_factory:Factory = cast _kernel.factory;
l_factory.playMusic();
}
super.activateButton(p_type);
}

}


Only real difference seems to me, that I've used a different approach for selecting the button in _getButton.

:-)

Rob Fell

unread,
Sep 18, 2013, 12:43:37 PM9/18/13
to aw...@googlegroups.com
That's useful - I see also the class is named MyOverlay ...
 
Please can you try these tests:
 
1) Rename your Overlay in the freshly created template project to "MyOverlay", and update references in Factory accordingly
test that without further changes, next:
2) Modify the "extends" in MyOverlay so it extends just "Overlay", and add an import to "awe6.core.Overlay" at the top.
test that
 
Please let me know which of 1 & 2 work / don't work.

Tobi

unread,
Sep 19, 2013, 7:55:48 AM9/19/13
to aw...@googlegroups.com
Neither did work.

What does work is changing the _getButton method to:

override private function _getButton( p_type:EOverlayButton ):BasicButton 
{
//return switch( p_type ) 
//{
// case SUB_TYPE( p_value ) :
// switch( p_value ) 
// {
// // case "RESTART" : 
// // _buttonRestart;
// default :
// p_value;
// null;
// }
// default : super._getButton( p_type );
//}


switch( p_type )
{
case SUB_TYPE( p_value ) :
switch(p_value){
default : return p_value;
}
default: null;
}
return super._getButton(p_type);
}


It then compiles successfully.

Tobi

unread,
Sep 19, 2013, 7:57:39 AM9/19/13
to aw...@googlegroups.com
So maybe some kind of difference in hxcpp for the switch statement for OSX and Windows???

Rob Fell

unread,
Sep 19, 2013, 12:22:32 PM9/19/13
to aw...@googlegroups.com
Well done and thank you.  We could compare generated cpp code to see if the difference and then report issue to hxcpp project?
 
In the meanwhile I'll put a workaround into the awe6 template.  Before I do that, can you test this approach for me please:
 
var l_result:BasicButton = switch( p_type )

{
 case SUB_TYPE( p_value ) :
  switch( p_value )
  {
   default : p_value;
  }
 default: super._getButton( p_type );

return l_result;
 
I suspect it will also fail, but if it works it'll be a convention I can apply to avoid other similar issues (so worth an ask).
 
Reply all
Reply to author
Forward
0 new messages