Jump to content

[SOLVED] Unknown class member when loading second world (Unigine 2.0 beta2)


photo

Recommended Posts

Hello,

 

I have a strange world loading/compiler error issue. I have a executable loading two unigine worlds via console->run("world_load xxxx") and the second later with console->run("world_load yyy"). When loading the second world I get a strange compiler error:

 

line.addCurve(line_curve_n);
core/systems/tracker/editor/tracker_editor_parameter_track.h:87: Interpreter::parse_user_class(): unknown "Line" class member "addCurve"
World::loadWorld(): can't load "yyy.cpp" world script
 
That is strange because both of them start with the same to lines:


#include <core/unigine.h>
#include <core/systems/tracker/editor/tracker_editor.h>

so I would expect that either both of the trigger a compiler error or none of them.

 

Both world_load commands are using the same extern functions and defines (specified via Interpreter::addExternDefine() and Interpreter::addExternFunction()). The editor.cpp is loading correctly as well (in case I start with the EDITOR defined).
 
The project is actually older, I updated it to Unigine 2.0 beta2 with the update.usc script (I also updated the binaries and copied the core folder from the recent sdk)
 
Everything is working fine if I do not include the tracker_editor.h in yyy.cpp.
 
Unfortunately it is not so easy to reproduce, I inserted the include for the tracker_editor.h into some of the sdk samples, but all of them were working fine.
 
I wonder if I'm doing something stupid without noticing it ... Is there any way to debug this efficiently (like figuring out which defines have been set or which files are included)?
 
Thank you and cheers
 Helmut
 
Link to comment

Hello Silent,

 

Thank you for offering this! I don't think that it makes sense to handle the whole project over to you in its current shape. (Its hard to configure, it maintains a network connection to another process, all of this has to be configured and setup properly before it can even run...).

But I will try to isolate it (by taking out stuff not needed to reproduce my problem). This way I will either figure it out myself or if not I can provide you with a much smaller and cleaner project.

I don't believe that this is a unigine script compiler bug, I would suspect that a preprocessor define is cached somewhere or gets lost before the second world_load command is triggered.

 

Thank you and cheers!

 Helmut

Link to comment

Hello Silent,

 

Good news, I figured it out!

It seems that it was caused by a namespace conflict, I had my own class 'Line' defined in some header file (and without any use actually). It would guess it collided with the line class from core\systems\widgets\widget_line.h.

It is still not totally clear to me in terms of the order in which the files are included but I think I have to rework my programming style in the future and put all my classes into a separate namespace in order to be on the save side regarding naming conflicts.

 

Thank you and cheers

 Helmut

Link to comment
×
×
  • Create New...