Microsoft Visual Studio .NET (C++)
by Chris · in General Discussion · 08/17/2003 (7:11 pm) · 25 replies
Well I have VS .net to program stuff and have been hearing that for TGE V C++ 6.0 would have been a better choice. With VS.net i find I run into many problems when compiling things that people can compile easily with V C++ 6.0. Did I make a mistake buying MS V .net instead of going with 6.0?
About the author
#2
08/17/2003 (8:11 pm)
Well first off when i was taking my AP course (i have yet to buy TGE but am looking to) I had .h files that allowed for string editing. They essentail made console programs easier for change vectors, matric, strings. They allowed me to find its length easily, change it, find substrings without doing a whole lot. 6.0 allowed me to compile it (it was only a trail version though) without a problem while V.net cant seem to compile it. I was woundering if there was a way I can configure the compiler to act just like 6.0 compiler.
#3
Post some of your errors. I am almost 99.9% positive that we (those in the cimmunity using .NET) have run into the same issues and have solutions.
-Ron
08/17/2003 (8:12 pm)
Chris,Post some of your errors. I am almost 99.9% positive that we (those in the cimmunity using .NET) have run into the same issues and have solutions.
-Ron
#4
[code]
#include
#include "apstring.h"
#include "apvector.h"
int main(void)
{
apstring string;
cout << "Enter string: ";
cin >> string;
int length = string.length();
cout << "Your string " << string << " is " << length << " units long.";
apvector vect(10, 1);
int i = 0;
for(i=0; i<10; i++)
vect[i] = i+1;
cout << "Here is your Vector: " << vect;
return 0;
}
[code]
The apvector doesnt work, apstring works fine. But i got them from here: http://www.collegeboard.com/ap/students/compsci/classes.html
They should work as they worked on 6.0 but it doesnt work with .net
Hope that helps. if you need more tell me.
08/17/2003 (8:35 pm)
Here is an example my main code:[code]
#include
#include "apstring.h"
#include "apvector.h"
int main(void)
{
apstring string;
cout << "Enter string: ";
cin >> string;
int length = string.length();
cout << "Your string " << string << " is " << length << " units long.";
apvector
int i = 0;
for(i=0; i<10; i++)
vect[i] = i+1;
cout << "Here is your Vector: " << vect;
return 0;
}
[code]
The apvector doesnt work, apstring works fine. But i got them from here: http://www.collegeboard.com/ap/students/compsci/classes.html
They should work as they worked on 6.0 but it doesnt work with .net
Hope that helps. if you need more tell me.
#5
------ Build started: Project: Error, Configuration: Debug Win32 ------
Compiling...
apvector.cpp
c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\useoldio.h(29) : warning C4995: '_OLD_IOSTREAMS_ARE_DEPRECATED': name was marked as #pragma deprecated
c:\Documents and Settings\Chris\My Documents\Visual Studio Projects\Error\apvector.cpp(27) : error C2995: 'apvector::__ctor' : template function has already been defined
c:\Documents and Settings\Chris\My Documents\Visual Studio Projects\Error\apvector.h(32) : see declaration of 'apvector::__ctor'
c:\Documents and Settings\Chris\My Documents\Visual Studio Projects\Error\apvector.cpp(37) : error C2995: 'apvector::__ctor' : template function has already been defined
c:\Documents and Settings\Chris\My Documents\Visual Studio Projects\Error\apvector.h(33) : see declaration of 'apvector::__ctor'
c:\Documents and Settings\Chris\My Documents\Visual Studio Projects\Error\apvector.cpp(52) : error C2995: 'apvector::__ctor' : template function has already been defined
c:\Documents and Settings\Chris\My Documents\Visual Studio Projects\Error\apvector.h(34) : see declaration of 'apvector::__ctor'
c:\Documents and Settings\Chris\My Documents\Visual Studio Projects\Error\apvector.cpp(65) : error C2995: 'apvector::__ctor' : template function has already been defined
c:\Documents and Settings\Chris\My Documents\Visual Studio Projects\Error\apvector.h(35) : see declaration of 'apvector::__ctor'
c:\Documents and Settings\Chris\My Documents\Visual Studio Projects\Error\apvector.cpp(72) : error C2995: 'apvector::~__dtor' : template function has already been defined
c:\Documents and Settings\Chris\My Documents\Visual Studio Projects\Error\apvector.h(36) : see declaration of 'apvector::~__dtor'
c:\Documents and Settings\Chris\My Documents\Visual Studio Projects\Error\apvector.cpp(95) : error C2995: 'apvector::operator'='' : template function has already been defined
c:\Documents and Settings\Chris\My Documents\Visual Studio Projects\Error\apvector.h(39) : see declaration of 'apvector::operator'=''
c:\Documents and Settings\Chris\My Documents\Visual Studio Projects\Error\apvector.cpp(103) : error C2995: 'apvector::length' : template function has already been defined
c:\Documents and Settings\Chris\My Documents\Visual Studio Projects\Error\apvector.h(42) : see declaration of 'apvector::length'
c:\Documents and Settings\Chris\My Documents\Visual Studio Projects\Error\apvector.cpp(119) : error C2995: 'apvector::operator'[]'' : template function has already been defined
08/17/2003 (8:36 pm)
Here are the errors when i compile it------ Build started: Project: Error, Configuration: Debug Win32 ------
Compiling...
apvector.cpp
c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\useoldio.h(29) : warning C4995: '_OLD_IOSTREAMS_ARE_DEPRECATED': name was marked as #pragma deprecated
c:\Documents and Settings\Chris\My Documents\Visual Studio Projects\Error\apvector.cpp(27) : error C2995: 'apvector
c:\Documents and Settings\Chris\My Documents\Visual Studio Projects\Error\apvector.h(32) : see declaration of 'apvector
c:\Documents and Settings\Chris\My Documents\Visual Studio Projects\Error\apvector.cpp(37) : error C2995: 'apvector
c:\Documents and Settings\Chris\My Documents\Visual Studio Projects\Error\apvector.h(33) : see declaration of 'apvector
c:\Documents and Settings\Chris\My Documents\Visual Studio Projects\Error\apvector.cpp(52) : error C2995: 'apvector
c:\Documents and Settings\Chris\My Documents\Visual Studio Projects\Error\apvector.h(34) : see declaration of 'apvector
c:\Documents and Settings\Chris\My Documents\Visual Studio Projects\Error\apvector.cpp(65) : error C2995: 'apvector
c:\Documents and Settings\Chris\My Documents\Visual Studio Projects\Error\apvector.h(35) : see declaration of 'apvector
c:\Documents and Settings\Chris\My Documents\Visual Studio Projects\Error\apvector.cpp(72) : error C2995: 'apvector
c:\Documents and Settings\Chris\My Documents\Visual Studio Projects\Error\apvector.h(36) : see declaration of 'apvector
c:\Documents and Settings\Chris\My Documents\Visual Studio Projects\Error\apvector.cpp(95) : error C2995: 'apvector
c:\Documents and Settings\Chris\My Documents\Visual Studio Projects\Error\apvector.h(39) : see declaration of 'apvector
c:\Documents and Settings\Chris\My Documents\Visual Studio Projects\Error\apvector.cpp(103) : error C2995: 'apvector
c:\Documents and Settings\Chris\My Documents\Visual Studio Projects\Error\apvector.h(42) : see declaration of 'apvector
c:\Documents and Settings\Chris\My Documents\Visual Studio Projects\Error\apvector.cpp(119) : error C2995: 'apvector
#6
::operator'[]''
c:\Documents and Settings\Chris\My Documents\Visual Studio Projects\Error\apvector.cpp(135) : error C2995: 'apvector::operator'[]'' : template function has already been defined
c:\Documents and Settings\Chris\My Documents\Visual Studio Projects\Error\apvector.h(46) : see declaration of 'apvector::operator'[]''
c:\Documents and Settings\Chris\My Documents\Visual Studio Projects\Error\apvector.cpp(160) : error C2995: 'apvector::resize' : template function has already been defined
c:\Documents and Settings\Chris\My Documents\Visual Studio Projects\Error\apvector.h(49) : see declaration of 'apvector::resize'
error.cpp
c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\useoldio.h(29) : warning C4995: '_OLD_IOSTREAMS_ARE_DEPRECATED': name was marked as #pragma deprecated
c:\Documents and Settings\Chris\My Documents\Visual Studio Projects\Error\error.cpp(19) : error C2679: binary '<<' : no operator found which takes a right-hand operand of type 'apvector' (or there is no acceptable conversion)
with
[
itemType=int
]
Generating Code...
Build log was saved at "file://c:\Documents and Settings\Chris\My Documents\Visual Studio Projects\Error\Debug\BuildLog.htm"
Error - 11 error(s), 2 warning(s)
---------------------- Done ----------------------
Build: 0 succeeded, 1 failed, 0 skipped
(!! max char for posts lol)
08/17/2003 (8:36 pm)
C:\Documents and Settings\Chris\My Documents\Visual Studio Projects\Error\apvector.h(45) : see declaration of 'apvectorc:\Documents and Settings\Chris\My Documents\Visual Studio Projects\Error\apvector.cpp(135) : error C2995: 'apvector
c:\Documents and Settings\Chris\My Documents\Visual Studio Projects\Error\apvector.h(46) : see declaration of 'apvector
c:\Documents and Settings\Chris\My Documents\Visual Studio Projects\Error\apvector.cpp(160) : error C2995: 'apvector
c:\Documents and Settings\Chris\My Documents\Visual Studio Projects\Error\apvector.h(49) : see declaration of 'apvector
error.cpp
c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\useoldio.h(29) : warning C4995: '_OLD_IOSTREAMS_ARE_DEPRECATED': name was marked as #pragma deprecated
c:\Documents and Settings\Chris\My Documents\Visual Studio Projects\Error\error.cpp(19) : error C2679: binary '<<' : no operator found which takes a right-hand operand of type 'apvector
with
[
itemType=int
]
Generating Code...
Build log was saved at "file://c:\Documents and Settings\Chris\My Documents\Visual Studio Projects\Error\Debug\BuildLog.htm"
Error - 11 error(s), 2 warning(s)
---------------------- Done ----------------------
Build: 0 succeeded, 1 failed, 0 skipped
(!! max char for posts lol)
#7
but your problems are more related to using old deprecated syntax and headers syntax that was probably not standards compliant anyway.
VS .Net has a much more compliant compiler and is much more picky about what it will and will not compile. That code was probably wrong and VS 6 compiled it anyway when it should not have to begin with.
Get a good UP TO DATE book on C++ on what the correct syntax and standards should be.
08/17/2003 (8:59 pm)
Actually it is pretty much a moot point, Microsoft does not sell VS 6.0 anymore anyway, and it is only one version away from being dropped from support as well.but your problems are more related to using old deprecated syntax and headers syntax that was probably not standards compliant anyway.
VS .Net has a much more compliant compiler and is much more picky about what it will and will not compile. That code was probably wrong and VS 6 compiled it anyway when it should not have to begin with.
Get a good UP TO DATE book on C++ on what the correct syntax and standards should be.
#9
08/17/2003 (10:10 pm)
For what it's worth, when I do my C++ work in school, I usually use something like Bloodshed or something simple like that. It seems that .NET (or visual studio in general) likes to add a bunch of crap to the binary, and it makes the filesize huge.
#10
Anyway to answer the original question...
Visual Studio .NET 2003 has arguably the best (in terms of performance and standards compliance) C++ compiler of all the time, but the price you pay is that it is real picky about old, obsolete non-standard code.
In your specific case, move to rather than . As a general rule, if you're including a standard C++ header and it has a .h at the end, it is obsolete and the alternative standard compliant implementation uses the same name, but without the .h at the end. Also you'll need to either append std:: to the cout/cin uses, or just add a "using namespace std;" declaration before using them.
Other than that it should work fine for you in VS.NET 2003, though I have no idea what problems might be lurking in the apstring/apvector headers.
08/17/2003 (10:50 pm)
VC++ doesn't "add a bunch of crap to the binary". It simply links in the C runtime libs, which gcc (or any other C/C++ compiler) does too. Both give you the option of linking to the runtime libs dynamically to keep the base executable size down. In fact, VS.NET adds far less 'crap' than other compilers when static linking because it has a great link-time optimizer.Anyway to answer the original question...
Visual Studio .NET 2003 has arguably the best (in terms of performance and standards compliance) C++ compiler of all the time, but the price you pay is that it is real picky about old, obsolete non-standard code.
In your specific case, move to
Other than that it should work fine for you in VS.NET 2003, though I have no idea what problems might be lurking in the apstring/apvector headers.
#11
After i build it I try to debug it and get this error:
Unable to start debugging
The Machine Debug Manager Service is disabled
I have never seen this error before, I tried everything that the documentation said about configing the compiler (even though it's for vc++ 6.0, it didnt work before it either)
has anyone else had this problem?
08/18/2003 (3:57 pm)
When i try to compile the torque engine, I can build it.After i build it I try to debug it and get this error:
Unable to start debugging
The Machine Debug Manager Service is disabled
I have never seen this error before, I tried everything that the documentation said about configing the compiler (even though it's for vc++ 6.0, it didnt work before it either)
has anyone else had this problem?
#12
I'm not currently on an XP box and I don't remember where exactly "Services" lives on XP off the top of my head -- it exists but I believe it is located in a different place now.
At any rate, if you scroll down the list of services that will be shown when you run the Services control panel you should see
"Machine Debug Manager" listed. Select it and then use the "Start" button (looks like the Play button on a VCR) to start it up. You should also look at its current "Startup Type" -- if it is not set to Automatic, right mouse click over the Machine Debug Manager line and select Properties from the context menu. Then when it pops up select "Automatic" from the Startup Type selection box, then ok.
Hope this helps.
08/18/2003 (4:48 pm)
You need to restart the machine debug manager. You can do this from the Services control panel. Exactly how you bring up the Services control panel depends upon your OS version. In Windows 2000 you should be able to go to the standard Control Panel (Start menu->Settings->Control Panel), double click the "Administrative Tools" icon then double click the "Services" icon.I'm not currently on an XP box and I don't remember where exactly "Services" lives on XP off the top of my head -- it exists but I believe it is located in a different place now.
At any rate, if you scroll down the list of services that will be shown when you run the Services control panel you should see
"Machine Debug Manager" listed. Select it and then use the "Start" button (looks like the Play button on a VCR) to start it up. You should also look at its current "Startup Type" -- if it is not set to Automatic, right mouse click over the Machine Debug Manager line and select Properties from the context menu. Then when it pops up select "Automatic" from the Startup Type selection box, then ok.
Hope this helps.
#13
For anyone else whos looking for Machine Debug Manager for XP
right click start menu -> explore all users -> programs -> admin tools -> services
The Machine Debug Manager should be there.
08/18/2003 (5:13 pm)
Thankyou George,For anyone else whos looking for Machine Debug Manager for XP
right click start menu -> explore all users -> programs -> admin tools -> services
The Machine Debug Manager should be there.
#14
08/18/2003 (6:46 pm)
Actually in XP just right click on the My Computer icon and select manage, most XP installations DON'T have Admin Tools in the start menu by default.
#15
*******************
c:\compiler\Torque\tools\ms2dtsExporter\dtsSDK\DTSShape.cpp(131): error C2660: 'std::vector >::assign' : function does not take 1 parameters
*******************
I get lots of errors like this, when compiling Torque SDK 1.1.2.
09/13/2003 (9:11 pm)
Alrighty, how about this one: :)*******************
c:\compiler\Torque\tools\ms2dtsExporter\dtsSDK\DTSShape.cpp(131): error C2660: 'std::vector
*******************
I get lots of errors like this, when compiling Torque SDK 1.1.2.
#16
Visual Studio .NET (the first one, not 2003).
09/13/2003 (9:13 pm)
Whoops! Guess I should specify which compiler I'm using.Visual Studio .NET (the first one, not 2003).
#17
09/13/2003 (10:31 pm)
If you don't have the right SDKs installed, a lot of the exporter projects won't install. Don't worry about them unless you're trying to build the milkshape/max exporters.
#18
Now it compiles just fine in Visual C.Net... :)
09/14/2003 (12:19 pm)
I discovered what HEAD meant last night, and downloaded the latest and greatest torque code...Now it compiles just fine in Visual C.Net... :)
#19
thanks
09/27/2003 (6:56 pm)
I am trying to compile torque using .net, any one here knows how to resolve the "custom build step error" ?thanks
#20
thanks
09/27/2003 (8:01 pm)
I am trying to compile torque using .net, any one here knows how to resolve the "custom build step error" ?thanks
Torque Owner Ben Swanson