VC6: Error c2065 on compile
by Fenrir Wolf · in Torque Game Engine · 08/26/2003 (2:46 pm) · 6 replies
Well, I followed the instructions for downloading the Torque engine and configuring VC6 for it. I installed SP5, and the DX9 SDK, plus the OpenAL SDK.
Everything compiles fine, except that I get one error each per four files. Here's what I get:
-----------------------------------------------------------
Compiling...
winConsole.cc
c:\torque\engine\platformwin32\winconsole.cc(270) : error C2065: 'strcpy' : undeclared identifier
winGL.cc
c:\torque\engine\platformwin32\wingl.cc(1325) : error C2065: 'strcpy' : undeclared identifier
winInput.cc
c:\torque\engine\platformwin32\wininput.cc(772) : error C2065: 'strcpy' : undeclared identifier
winStrings.cc
c:\torque\engine\platformwin32\winstrings.cc(131) : error C2065: 'strcpy' : undeclared identifier
Error executing cl.exe.
torqueDemo_DEBUG.exe - 4 error(s), 0 warning(s)
----------------------------------------------------------
I've seen these kinds of errors before, but for the life of me I cannot remember how to resolve them. Can anyone help me?
Everything compiles fine, except that I get one error each per four files. Here's what I get:
-----------------------------------------------------------
Compiling...
winConsole.cc
c:\torque\engine\platformwin32\winconsole.cc(270) : error C2065: 'strcpy' : undeclared identifier
winGL.cc
c:\torque\engine\platformwin32\wingl.cc(1325) : error C2065: 'strcpy' : undeclared identifier
winInput.cc
c:\torque\engine\platformwin32\wininput.cc(772) : error C2065: 'strcpy' : undeclared identifier
winStrings.cc
c:\torque\engine\platformwin32\winstrings.cc(131) : error C2065: 'strcpy' : undeclared identifier
Error executing cl.exe.
torqueDemo_DEBUG.exe - 4 error(s), 0 warning(s)
----------------------------------------------------------
I've seen these kinds of errors before, but for the life of me I cannot remember how to resolve them. Can anyone help me?
#2
I'll go back later and change the strcpy's to dStrcpy's, but for now I got it to work by adding this before each file that complained:
It has something to do with the default VC++ name space. I'm new to C++, so I'm not sure why this is giving me (and just me) problems.
Thanks for the suggestions!
08/26/2003 (11:32 pm)
Hmm, that's odd. I used CVS to grab the Release_1_1_2 version -- that is the latest one, right?I'll go back later and change the strcpy's to dStrcpy's, but for now I got it to work by adding this before each file that complained:
extern "C" {
char * strcpy(char *, const char *);
}It has something to do with the default VC++ name space. I'm new to C++, so I'm not sure why this is giving me (and just me) problems.
Thanks for the suggestions!
#3
that version is dated.
remove any "tags" before you get a checkout it will default to head release.
it actually prolly has more to do with string.h not being included at this level.
so instead of that you could have just:
#include
but yea just get the head release.
08/27/2003 (9:37 am)
You should be using the head release.that version is dated.
remove any "tags" before you get a checkout it will default to head release.
it actually prolly has more to do with string.h not being included at this level.
so instead of that you could have just:
#include
but yea just get the head release.
#4
Erf, am I doing something wrong?
08/27/2003 (10:37 am)
I used WinCVS to grab the "HEAD" version (that's the tag I used), but I am still getting errors.Erf, am I doing something wrong?
#5
well when I get the head, I just leave it empty.
which allows it to default to the head release.
I would assume HEAD tag would do the same...
try without Any tag and see.
I'm at work now so there is not much more I can do.
08/27/2003 (12:03 pm)
Hmmm..well when I get the head, I just leave it empty.
which allows it to default to the head release.
I would assume HEAD tag would do the same...
try without Any tag and see.
I'm at work now so there is not much more I can do.
#6
09/04/2003 (12:28 pm)
I had problems with similar errors for another project that I was working on. I had to reinstall VC6 to get it to work properly. This may or may not work for you though...
Torque Owner Badguy
im curious why this code is not using the platform safe dStrcpy method.
the engine base has wrapped or re-written most of the required c standard library functions.
and those are to be used in the engine in place of directly calling the library function..
these functions are prefixed with a lowercase 'd'
the soluction here is to replace strcpy with dStrcpy.
a real Hack would be to simply include string.h
but dont do that.
Edit:
C2065 :
'identifier' : undeclared identifier
The specified identifier was not declared.
Technical Reference:
msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore98/html/c2065.as...
A good tip here.
is when you have an error you dont understand simply select it in the output window in your visual studio and press F1
if you dont have a decent copy of msdn (read : dated)
simply paste the error into the online msdn search.