Game Development Community

TGEA 1.7 Bug: cannot enable DSO generation

by Jeff Faust · in Torque Game Engine Advanced · 04/13/2008 (4:49 am) · 7 replies

The setting for DSO generation in TGEA has defaulted to off for some time. It's supposed to be governed by whether TORQUE_NO_DSO_GENERATION is defined or not. If you want DSOs generated, you find where TORQUE_NO_DSO_GENERATION is defined, comment it out and rebuild.

Upon closer examination, I've found that TORQUE_NO_DSO_GENERATION is not defined anywhere in stock TGEA 1.7.0, yet DSOs are not generated. What is really preventing DSO generation is this piece of code, at line 936 in consoleFunctions.cpp:
if(dStrnicmp(scriptFileName, prefsPath, dStrlen(prefsPath)) == 0)
      compiled = false;
This bit of code happens for every script that is executed by the exec command and the setting for the compiled flag determines if a DSO is saved. In all the cases I checked, scriptFileName contained a valid path to a script and prefsPath contained the empty string, "". Presumably it's an anomaly of passing a zero length for the comparison, but when prefsPath is the empty string, dStrnicmp() indicates that the strings match. This sets compiled to false which causes the DSO to not be generated.

About the author

Jeff Faust creates special effects indie middleware and games for Faust Logic. --- Blog: Effectronica.com --- Twitter: @FaustLogic


#1
04/13/2008 (5:01 am)
As a follow-up, I changed the above code to this:
if (prefsPath && prefsPath[0] != '[[62820f993ad63]]')
     if(dStrnicmp(scriptFileName, prefsPath, dStrlen(prefsPath)) == 0)
       compiled = false;
With this change, DSO files are once again generated, and they can be turned off again by defining TORQUE_NO_DSO_GENERATION somewhere. The project specific torqueConfig.h is probably a good place for it.
#2
04/13/2008 (5:09 am)
Final comment... Defining TORQUE_NO_DSO_GENERATION causes the compiler to report a bunch of "unreachable code" warnings when compiling codeBlock.cpp, but otherwise, it does appear to work correctly.
#3
06/19/2008 (5:41 am)
This has been fixed in TGEA 1.7.1 You only need to remove the #define statement now.
#4
07/27/2008 (10:22 am)
YO big life saver dude...thanks a lot..
#5
01/08/2009 (5:45 am)
Hi All

I am working with TGEA 1.7.1. I tried removing the #define from torqueConfig.h, to be able to generate dso, and rebuilt the exe, which was successful, but the exe won't open ( or it opens up and closes immediately. Can't figure it out). I also tried removing the #ifndef TORQUE_NO_DSO_GENERATION condition in the consoleFunctions.cpp file, which also resulted the same way. Please help.
#6
01/08/2009 (11:50 am)
Did you check the console.log? Delete the console.log, run Torque, then check the console log for errors.
#7
01/08/2009 (11:55 pm)
Thanks Tom. The console log helped a lot. I found that it was still tracing a printf I had already deleted from the original source. The problem could've been with Visual Studio, since it was building old sources even after I cleaned and rebuilt the solution several times yesterday, but it works now after restarting Windows.

Thanks again for your immediate response :-)