chriscalef Posted July 28, 2015 Posted July 28, 2015 Hey,I think I may have stumbled across a problem related to the console function / engine function changes... I haven't really paid adequate attention to that subject, but I was just trying to merge current trunk into my pre-3.7 build of OpenSimEarth, and came across this problem in SQLiteObject.cc (the old sqlite resource): 1>F:/T3D/Torque3D/Engine/source/console/console.h(885): error C2079: 'callback' uses undefined struct '_EngineConsoleExecCallbackHelper<P1>' 1> with 1> [ 1> P1=SQLiteObject * 1> ] 1> F:\T3D\Torque3D\Engine\source\console\SQLiteObject.cc(189) : see reference to function template instantiation 'ConsoleValueRef Con::executef<SQLiteObject*,const char*,const char*,char*>(A,B,C,D)' being compiled 1> with 1> [ 1> A=SQLiteObject *, 1> B=const char *, 1> C=const char *, 1> D=char * 1> ] 1>F:/T3D/Torque3D/Engine/source/console/console.h(885): error C2440: 'initializing' : cannot convert from 'SQLiteObject *' to 'int' 1> There is no context in which this conversion is possible The function causing the error is "Con::executef(this, ..." where this is the local SQLiteObject pointer: bool SQLiteObject::OpenDatabase(const char* filename) { // check to see if we already have an open database, and // if so, close it. CloseDatabase(); // We persist the error string so that the script may make a // GetLastError() call at any time. However when we get // ready to make a call which could result in a new error, // we need to clear what we have to avoid a memory leak. ClearErrorString(); int isOpen = sqlite3_open(filename, &m_pDatabase); if (isOpen == SQLITE_ERROR) { // there was an error and the database could not // be opened. m_szErrorString = (char *)sqlite3_errmsg(m_pDatabase); Con::executef(this, "2", "onOpenFailed()", m_szErrorString); //PROBLEM, cannot accept "this" SQLiteObject* as int return false; } else { //sqlite3_activate_cerod("!THIS$IS$NOT$YOUR$DATABASE!"); //int res1=sqlite3_key(m_pDatabase,"ASD",1); //int res2=sqlite3_rekey(m_pDatabase,"ASD",1); // database was opened without error Con::executef(this, "1", "onOpened()"); } return true; } Just wondering if anybody might have some insight on this issue before I get my shovel and start digging... :-P Quote
chriscalef Posted July 30, 2015 Author Posted July 30, 2015 Whew, successful self-rescue! In case anyone stumbles across anything similar, the clue was the following comment in console.h: 00874: /// 00875: /// NOTE: if you get a rather cryptic template error coming through here, most likely you are trying to 00876: /// convert a parameter which EngineMarshallType does not have a specialization for. 00877: /// Another problem can occur if you do not include "console/simBase.h" and "console/engineAPI.h" 00878: /// since _EngineConsoleExecCallbackHelper and SimConsoleThreadExecCallback are required. Turned out I was lacking "console/engineAPI.h", after adding it things went much better. Quote
buckmaster Posted August 1, 2015 Posted August 1, 2015 Glad you found the issue! Thanks for posting the solution :) Quote
ruzgar61_aska Posted December 2, 2015 Posted December 2, 2015 Hi I try to entegrate sqlite in tge3.8. I receive error "div by zero attempted" at Torque3d/Engine/Source/math/mpoint2.h (example line : AssertFatal(div != 0, "Error, div by zero attempted"); what is the problem? :!: Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.