Jump to content

[SOLVED] debug my own C++ plugin with debug version of engine will always crash.


photo

Recommended Posts

I've just found a strange problem, when I use debug version of engine, and when my plugin was about to run the code

 

Interpreter::addExternClass("CaptureDevice", device);

 

engine crashes, this happens when I use release version of engine with debug version of plugin, or with debug version of engine/plugin, but engine will run correctly when I both use release version of engine and plugin.

 

If I use debug version of engine/plugin the engine will crash at UnigineInterpreter.h line 3564.

 

So is this a bug or I'm doing something wrong? on windows, I'm using my customized build script. but on mac, I'm using original files, they both crash at this line.

 

This seems happened in both 2013-10-01 and 2013-08-16 version.

 

and another question, the extern info is only avaliable in debug version of engine? is there any possible to include extern info in release version of engine?

Link to comment

Release and debug plugins are different. Debug plugins provide additional information for extern_info.h file generation.

Debug plugin must contain UNIGINE_EXTERN_INFO define while compiling:

 

 

#if !defined(NDEBUG) && !defined(UNIGINE_EXTERN_INFO)
    #define UNIGINE_EXTERN_INFO
#endif

 

I will remove this problem in the next SDK update and Debug/Release plugins will be compatible with each other.

But now be sure that debug plugin is compiled with NDEBUG preprocessor option enabled.

Link to comment

thanks for the quick reply.

 

do you mean in next version, both debug/release version will have extern info included?

 

and do you suggest I need to add NDEBUG define in debug/release version of plugin?

 

and another strange thing happend, I just recompiled the debug version of engine, with debug version of plugin, both works under windows.

Link to comment

Only debug version will have extern info as before. But release plugins will have empty extern info related functions for plugins compatibility.

 

NDEBUG define should exist only for debug plugin version.

 

Yep, release engine works with release plugins. debug engine works with debug plugins.

Link to comment

thanks, crash problem solved, because the stupid ccache's cache, after I cleaned the ccache's cache, debug engine with debug plugin now don't crash.

 

Hope that you can make release version also have extern info.

Link to comment
×
×
  • Create New...