Game Development Community

WinStrings.cc(195) : error C2440

by Paul Grant · in Torque Game Engine · 12/08/2005 (12:30 pm) · 9 replies

I am using Microsoft Visual C++ 2005 Express Edition. After succesfully compiling TGE 1.4, I went on to try and compile it with the lighting pack 1.3.5.

I am getting one error:

"..\engine\platformWin32\winStrings.cc(195) : error C2440: 'return' : cannot convert from 'const char *' to 'char *'
Conversion loses qualifiers"

Can anyone shed some light on how to fix this?

Thanks!

#1
12/08/2005 (1:38 pm)
Hi Paul,

This is not the correct way to fix the issue (1.4 resolves the problem the right way), but try this:

return [b](char *)[/b]strstr(str1,str2);

-John
#2
12/08/2005 (2:42 pm)
Okay, that seems to work, now I'm getting the following:

"Compiling resources...
.\TorqueDemo.rc(3) : fatal error RC1015: cannot open include file 'resource.h'."

I'm going to try some things and see if I can't fix it.

Thanks for the help John!
#3
12/08/2005 (3:01 pm)
I put the resource.h file from the vc6 folder into the vc7 folder and it gets a little further. Now it can't seem to find "afxres.h", and I can't either.
#4
12/08/2005 (3:45 pm)
Okay, I found an afxres.h and winres.h (supposed to be interchangable according to http://www.winprog.org/tutorial/errors.html#RC1015) and rebuilt Torque Demo. Am I supposed to have a new TorqueDemo application in the example folder now? I have something called synapseGaming, which loads torqueDemo. It seems to work great that way. The demo's all look really cool! :-) Did I get it all compiled right?
#5
12/09/2005 (5:53 am)
Hi Paul,

Building the demo creates the file "SynapseGaming.exe", which is the TLK + TGE engine, so sounds like everything worked.

-John
#6
12/09/2005 (7:54 am)
Edit: John, sorry to be such a pain. I actually got it working. Let's just say I was doing something stupid and leave it at that. ;-) My only problem now is everytime I try to connect to a server it crashes. This is with just compiling the 1.3.5 TLK code.

-Paul
#7
12/11/2005 (4:17 pm)
Here's the console log (relevant section) in case it helps:


ServerQuery: start Querying master server 0
No master servers found in this region, trying IP:216.116.32.49:28002.
Requesting the server list from master server IP:216.116.32.49:28002 (2 tries left)...
Received server list packet 1 of 1 from the master server (4 servers).
Pinging Server IP:35.8.191.105:28000 (3)...
Pinging Server IP:35.8.191.107:28000 (3)...
Pinging Server IP:216.19.209.19:28000 (3)...
Pinging Server IP:217.160.250.205:28000 (3)...
ServerQuery: ping Pinging servers: 3 left... 0.125
ServerQuery: ping Pinging servers: 2 left... 0.25
ServerQuery: ping Pinging servers: 1 left... 0.375
Pinging Server IP:35.8.191.107:28000 (2)...
Pinging Server IP:35.8.191.107:28000 (1)...
Pinging Server IP:35.8.191.107:28000 (0)...
Ping to server IP:35.8.191.107:28000 timed out.
ServerQuery: query Querying servers: 3 left... 0.5
Querying Server IP:216.19.209.19:28000 (3)...
Querying Server IP:35.8.191.105:28000 (3)...
ServerQuery: query Querying servers: 2 left... 0.666667
Querying Server IP:217.160.250.205:28000 (3)...
ServerQuery: query Querying servers: 1 left... 0.833333
ServerQuery: query Querying servers: 0 left... 1
ServerQuery: done 3 servers found. 1
Server query canceled.
Adding a pending connection
Sending Connect challenge Request
Got Connect challenge Response
Sending Connect Request
#8
12/12/2005 (12:58 am)
Try running the debug build in VC and see where the code halts. Posting that info and the call stack, will help figure out what's going on.

Btw: have you looked at the VC 2005 issue threads here on the GG site? There are a number of them floating around, each discussing various TGE problems with the compiler (including crashes).
#9
12/12/2005 (7:06 am)
I sent you an email with the information you requested. Let me know if there is anything else I can do. Thanks!