Compiling tools under MSVC++ 7.0
by Jason Elison · in Torque Game Engine · 06/14/2002 (10:26 am) · 21 replies
I am using the MSVC++ 7.0 (.Net) compiler. Most of it compiles fine, a few warnings but nothing major, mostly signed/unsigned comparisons. Four of the projects will not compile successfully, however. They are the three Max exporters and the Milkshape exporter. The 3DS Max exporters all complain about a missing header file (ctl3d.h). I am assumming there is a .Net version of this header (since it is the header for 3D common controls), but I haven't looked for it since I don't have 3DS Max anyways. The Milkshape exporter has more problems. In DTSShape.cpp, around line 450, there is the following code...
It dies with the following error message, saying it cannot convert pos++ to a const char *. I am not sure why this is the case, since pos is a const_iterator over a std::string, it is in essence a const char *. I was able to fix the compile error by changing the section to
I don't like this, since if &(*pos) is a const char *, so is pos... Any suggestions here?
The olther problem is everywhere the std::vector::assign() method gets called (lots of places). Everytime, it is called with 1 parameter (always an int). std::vector::assign() should take two parameters (either void assign(size_type _Count, const Type& _Val) or template void assign(InputIterator _First, InputIterator _Last)). The documentation for this method under MSVC++ 6.0 is the same, so I don't see how it can compile correctly under MSVC++ 6.0, either... Looking at the code, it always goes like this...
My guess is that it is supposed to be creating a vector with enough memory allocated to hold numNodes Node classes? But then it only reads 1 node from the input stream into the vector? Anybody got a hint for me as to what it is doing here so I can try to fix it?
Thanks,
Jason
std::string::const_iterator pos = mat->name.begin() ;
while (pos != mat->name.end())
out.write (pos++, 1) ;It dies with the following error message, saying it cannot convert pos++ to a const char *. I am not sure why this is the case, since pos is a const_iterator over a std::string, it is in essence a const char *. I was able to fix the compile error by changing the section to
std::string::const_iterator pos = mat->name.begin() ;
while (pos != mat->name.end())
{
out.write (&(*pos), 1) ;
pos++ ;
}I don't like this, since if &(*pos) is a const char *, so is pos... Any suggestions here?
The olther problem is everywhere the std::vector::assign() method gets called (lots of places). Everytime, it is called with 1 parameter (always an int). std::vector::assign() should take two parameters (either void assign(size_type _Count, const Type& _Val) or template
nodes.assign(numNodes) ; stream >> nodes ; stream.readCheck(2) ;
My guess is that it is supposed to be creating a vector with enough memory allocated to hold numNodes Node classes? But then it only reads 1 node from the input stream into the vector? Anybody got a hint for me as to what it is doing here so I can try to fix it?
Thanks,
Jason
Associate Ron Yacketta
I have renamed my personal copy of torque to TGE and maintain a up to date version of the head in torque
-Ron