sergey.pozhidaev Posted February 7, 2014 Share Posted February 7, 2014 Is it ok what this code is not work? class Gr { }; class Foo { void a(Bar bar) { Gr gr = bar.getGr(); } }; class Bar:Unigine::Widgets::Window { Gr getGr() { } }; But this code is work class Gr { }; class Foo { void a(Bar bar) { Gr gr = bar.getGr(); } }; class Bar { Gr getGr() { } }; Link to comment
azagniy Posted February 7, 2014 Share Posted February 7, 2014 Hi, this is a simple mistake :) The "Foo" class don't knows about "Bar" class You need declare class "Foo" below a class "Bar", like this: class Gr { }; // class Bar declaration class Bar:Unigine::Widgets::Window { Gr getGr() { } }; // class Foo declaration class Foo { void a(Bar bar) { Gr gr = bar.getGr(); } }; and all to be alright Link to comment
sergey.pozhidaev Posted February 8, 2014 Author Share Posted February 8, 2014 Bar need to have pointer to Foo & Foo need to have pointer to Bar. Bar is main class and Foo is utility class. all includes done in Bar class file, so it is not so good to include it after Bar class definition. So we put all our code into Unigine::Widgets namespace & all becomes fine. But anyway, all of this solutions are hacks to prevent this compiler bug. Link to comment
frustum Posted February 10, 2014 Share Posted February 10, 2014 Will be fixed in the next SDK update. Link to comment
Recommended Posts