Game Development Community

Compiling TSE with Visual Studio 2005 (Beta)

by Peter Simard · in Torque Game Engine Advanced · 02/05/2005 (7:03 am) · 13 replies

Hi,

I was just over at the TGE thread discussing the new VS 2005 and how to compile TGE. I haven't seen anything similar in the TSE threads. I've been able to compile TSE with VS 2005 following the steps listed in the http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=5957 thread. The only other things that have to be checked are some enums. MS has become more strict with enum declarations and have a new enum type used within CLR. If you need to know what's going on check out http://msdn2.microsoft.com/library/a6cskb49.aspx. This is the enum class description (new CLR type) but describes the semanitcs of enum in general and how the "older" enum type will be handled in VS 2005.

From the MS doc:

"The enumerators of a standard enum are strongly injected into the enclosing scope. That is, if there is another symbol with the same name as an enumerator in the enclosing scope, the compiler will generate an error.

In Visual C++ 2002 and Visual C++ 2003, enumerators were weakly injected (visible in the enclosing scope unless there was another identifier with the same name)."

In short the enum declarations in TSE don't need to be qualified with enum tag name because they are "standard" enums are now strongly injected into the enclosing scope.

MS enum doc does say that if the project is compiled with the /clr switch "standard" enums will be compiled as "managed" enums. I've tried this in a test app and it does work but I could not get TSE to compile with the TSE switch on. Maybe someone else will have better luck.


Peter

About the author

Recent Threads


#1
05/28/2005 (3:26 am)
Ok I am using VS2005 beta 2 with no problems in compiling TGE or TSE.

However, (drumroll) , when I launch TSE_DEBUG.exe I get the lovely error of : entry point _invoke_watson not found in dynamic link library MSVCR80D.dll.

Yay for me.

Any ideas old chaps ?

-Paul

(edited to correct my poor spelling)
#2
05/29/2005 (6:21 am)
In the project properties, "C/C++ -> Code Generation", change "Runtime Library" from "Multi-threaded Debug Dll" to "Multi-threaded Debug". You should do the same for the Release version, linking with the release libraries of course.

With this change, instead of linking with the Dll version of the C Runtime library (msvcr80.dll, or msvcr80d.dll in debug mode), which are not part of the standard Windows libraries, it links the C Runtime statically into the executable.
#3
08/23/2005 (2:03 am)
I am getting tons of errors. Among them are these out of scope references:

DTSShape.cpp line 587
for (int i = 0 ; i < detailLevels.size() ; i++)
{
if (detailLevels[i].size < pixels)
break ;
}
smallestDetailLevel = i ;

'i' undeclared identifier. There are tons of these - you guys are not hitting them??
#4
08/23/2005 (9:58 am)
Yup I got these too.

What you need to do is go and define i outside the loop itself so :

int i = 0;
for (i ; i < detailLevels.size() ; i++)
{
if (detailLevels[i].size < pixels)
break ;
}
smallestDetailLevel = i ;
#5
08/23/2005 (5:29 pm)
Weird that you are getting that, I recently went through TSE and made sure it compiled OK with VC8.
#6
02/26/2006 (9:03 am)
Nope, doesnt compile on VS.NET 2005 Pro.
#7
02/26/2006 (7:01 pm)
The TSE compiles just fine on VS 2005 Pro. That's what everyone on my team is working with. So if you have some specific error that you are getting Westy why not post it and we can all see if we can help.
#8
03/21/2006 (1:36 pm)
I've got TSE and it compiles pretty neatly even with VC++ 2005 Express Edition. (Extremely cheapo development ;)
#9
11/08/2006 (2:24 pm)
Ok new to torque and need a hand.

Problems getting the code to compile with Visual Studio 2005 professional.
I have gone though and check on all in the instructions for Express.
Doing the items where not already done.

I am getting alot of error, but thankfully there are alot of dups:

Error 201 error C2440: '=' : cannot convert from 'const char [8]' to 'LPCWSTR' c:\torque\sdk\engine\platformwin32\winoglvideo.cc 1091
---
Error 127 error C2440: '=' : cannot convert from 'LPCSTR' to 'LPCWSTR' c:\torque\sdk\engine\platformwin32\winredbook.cc 124
---
Error 124 error C2440: 'return' : cannot convert from 'const char *' to 'char *' c:\torque\sdk\engine\platformwin32\winstrings.cc 195
---
Error 164 error C2440: 'return' : cannot convert from 'WCHAR [260]' to 'const char *' c:\torque\sdk\engine\platformwin32\windinputdevice.cc 559
---
Error 401 error C2447: '{' : missing function header (old-style formal list?) c:\torque\sdk\engine\game\player.cc 2090
---
Error 34 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\torque\sdk\lib\dtssdk\dtsmatrix.h 115
---
Error 67 fatal error C1083: Cannot open include file: 'vorbis/codec.h': No such file or directory c:\torque\sdk\engine\audio\vorbisstream.h 26
(Lots of these for various files. I think that if I can figure out what I missed/screwed up.

Out of 421 errors these are the unique ones.

Then warnings there are 3:
Warning 16 warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/INCREMENTAL:NO' specification glu2d3d.obj

Warning 19 warning C4018: '<' : signed/unsigned mismatch c:\torque\sdk\lib\dtssdk\dtsshape.cpp 554

Warning 28 warning C4244: '=' : conversion from 'int' to 'float', possible loss of data c:\torque\sdk\lib\dtssdk\dtsshape.cpp 734



thanks!!
#10
11/09/2006 (3:53 am)
Set Treat WChar_T as built in type to no. Properties->C/C++->Language.

That should take care of several of those errors.
#11
11/10/2006 (10:01 pm)
Hi, just got the latest milestone from the download section of of the my accounts page and am getting the following error when compiling (this is using dx9 october sdk with windows xp sp2, platform sdk and using visual studio 2005 pro). Have tried a reboot and a clean but still getting this.

1>------ Skipped Build: Project: dtsSDK, Configuration: Release Win32 ------
1>Project not selected to build for this solution configuration
2>------ Skipped Build: Project: TSE Lib, Configuration: Release Win32 ------
2>Project not selected to build for this solution configuration
3>------ Skipped Build: Project: max2dtsExporter Max4, Configuration: Release Win32 ------
3>Project not selected to build for this solution configuration
4>------ Skipped Build: Project: ms2dtsExporter, Configuration: Release Win32 ------
4>Project not selected to build for this solution configuration
5>------ Skipped Build: Project: map2dif plus, Configuration: Release Win32 ------
5>Project not selected to build for this solution configuration
6>------ Skipped Build: Project: map2dif, Configuration: Release Win32 ------
6>Project not selected to build for this solution configuration
7>------ Skipped Build: Project: max2dtsExporter Max3, Configuration: Release Win32 ------
7>Project not selected to build for this solution configuration
8>------ Build started: Project: Torque Shader Engine, Configuration: Release Win32 ------
8>Linking...
8>gfxD3DDevice.obj : error LNK2019: unresolved external symbol "class RefPtr __cdecl OsLoadLibrary(char const *)" (?OsLoadLibrary@@YA?AV?$RefPtr@VDLibrary@@@@PBD@Z) referenced in function "public: static void __cdecl GFXD3DDevice::enumerateAdapters(class Vector &)" (?enumerateAdapters@GFXD3DDevice@@SAXAAV?$Vector@UGFXAdapter@@@@@Z)
8>../example/TSE.exe : fatal error LNK1120: 1 unresolved externals
8>Build log was saved at "file://c:\tse\engine\out.vc8.win32.release\BuildLog.htm"
8>Torque Shader Engine - 2 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 5 up-to-date, 7 skipped ==========

Can someone help?
#12
11/10/2006 (10:10 pm)
Try here.
#13
11/11/2006 (4:42 am)
Thanks that worked a treat