PGD Home

Compiling and running older versions of Torque 3D with Visual Studio 2015 (On Windows 10)

by on Jan.09, 2016, under Miscellany, Software and Games, Tutorials

Having recently moved to Windows 10, I had to solve a few fairly minor issues when compiling Torque using the new 2015 edition of Visual Studio 2015. The current version of T3D (3.6.1) seems to compile fine, however, projects built with older versions don’t.

Since I’m sure many developers, like me, are still working with older versions of the engine for various reasons, I decide to create this brief guide to outline how I solved these compiling and linking issues.

Firstly, there will be a lot of errors relating to cstdlib. This is the Standard Library. The problem here is that the new version of cstdlib has a function named “strtok” which conflicts with an identically names function in torque. To fix this, simple navigate to “engine/source/core/strings/stringFunctions.h”.

At line 38, change “#define strtof” to something else. This removes the conflict, and should fix most of the errors.

The second change to make is in “engine/lib/collada/src/dae/daeElement.cpp”. This file complains about a function “max” not being found. This is because the function, once a part of “xutility” has now been removed.

To solve this, simple add this function:

// ALGORITHM STUFF (from <algorithm>)
template<class _Ty> inline
const _Ty& (max)(const _Ty& _Left, const _Ty& _Right)
{ // return larger of _Left and _Right
return (_DEBUG_LT(_Left, _Right) ? _Right : _Left);

To daeElement.cpp, somewhere above line 475, where the only call to “max” appears (in “getNecessaryColumnWidth”.

If you are lucky, this is all you will need to do.

However, if you are unlucky, like I was, and you have third party libraries installed in T3D, you may get linker errors similiar to: “module unsafe for safeseh image”. What this means is that one of these libraries has been compiled using an earlier version of the compiler.

To fix this, either get an up to date version of the library, or go into:
“Project properties>Configuration Properties>Linker>Advanced” and disable “Image has safe exception handlers”.
This should be all you need to do.


Comments are closed.

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!