Sign in to follow this  
Evil Steve

Burn in hell, MSVC 6.0 (VC 2003 / VC 2005 question)

Recommended Posts

Ugh, I hate MSVC 6.0. I just spent 3 hours trying to find out why my code only worked in debug mode and not in release mode. I have a CD3DDevice (wrapper around a D3D device), and a CSoundMgr (wrapper for DirectSound). They're both singletons. In debug mode it all works fine, but in release mode when I called a virtual function (everything was valid, I checked and re-checked), the CD3DDevice::Shutdown() function had been called before I got into the function. I also couldn't help notice that at program termination, the device was getting it's destructor called twice - which is never a good thing. Anyway, I fixed it by #including the CD3DDevice header in the file that had the virtual function. It seems as if MSVC had created 2 instances of my singleton in the same address, and was messing about with them. And similarly with my CSoundMgr So, my question is: Should I buy VC 2003? I know you can use the 2003 toolkit with the VC 6 IDE, but I like to be able to debug. Does the $109 version of VC 2003 have the optimizing compiler? And what about a profiler? Or, do you think it's suffering with MSVC 6, and waiting for VC 2005 to come out of beta, and then buying that? I don't have much cash at the moment (I can only afford to spend £100 maximum ($186 USD or 146 euros)), so I don't really want to buy VC 2003 if its no good, or if I can get VC 2005 a month later for the same price. Which brings me to another question - Does anyone know how much a version of VC 2005 with an optimizing compiler, and preferably a profiler will cost? Do all versions of VC now have the optimizing compiler? My crappy VC 6.0 version ("Standard") didn't come with the option for optimizations... Sorry of this seems more of a rant than a question :P Cheers, Steve

Share this post


Link to post
Share on other sites
Arg, Amazon hates me :(
I can buy VC 2003 for the equivalient of $149 on Amazon.co.uk
I can buy VC 2003 used, for the equivalient of $224 on Amazon.co.uk
I can buy VC 2003 for $90 on Amazon.com
I can buy VC 2003 used for $65 on Amazon.com

So how come it's almost twice the price on .co.uk? :(

And, I just found out that amazon.com won't ship VC 2003 to the UK >_<

Share this post


Link to post
Share on other sites
"Standard" VC 2003 does not have the optimizing compiler in the box. It is on the website, however. Just slap it in and away you go.

Share this post


Link to post
Share on other sites
Just a tip, if your application works in debug but not release, make sure you initialize all your variables in the constructors or equialent, because in release mode the variables are not set to 0 which they are in debug more (in msvc).

I used to have this bug a few times, but hen I switched to linux and now I have bugs all the time instead, just kidding.

Albert

Share this post


Link to post
Share on other sites
Quote:
Original post by thec
Just a tip, if your application works in debug but not release, make sure you initialize all your variables in the constructors or equialent, because in release mode the variables are not set to 0 which they are in debug more (in msvc).
Yeah, I'm aware of this. I wish it was that simple ;)
This was definitely the compiler playing about - I spent ages looking at the assembly, and dotting __asm int 3; about everywhere. It seems that MSVC thought that the static variable hadn't been created, so it created another copy of it, using the same memory address. Then it just went crazy...
Quote:
Original post by jdhardy
"Standard" VC 2003 does not have the optimizing compiler in the box. It is on the website, however. Just slap it in and away you go.
I was already planning on using the downloadable VC 2003 compiler, thanks :)

I E-mailed Amazon.co.uk, asking them if there's any possibility of them changing the price, but I doubt they'll do it.

I also fould that I can buy direct from Microsoft, but they seem to only ship to the US. I'd also prefer not to give Microsoft my address :P

Does anyone know when VC 2005 is out for retail, and how much it'll be?

Share this post


Link to post
Share on other sites
Quote:
Original post by Evil Steve
Does anyone know when VC 2005 is out for retail, and how much it'll be?

I heard that all the "final" versions of the Visual Studio Family are delayed until "Yukon" (SQL Server 2005) is ready, which is pushing the release date back further than it was before. Also, "Beta 2" is not out yet, but from what I've heard it'll be out sometime around Feb/March (so it could be any day now). I would guess that the final version would not come out until Summer-Fall time. How soon do you need an optimizing compiler? You could use VC Beta Express 8 (which has a debugger) and then buy VC 8 when it comes out in a few months.

Share this post


Link to post
Share on other sites
Hi,

Visual Studio 2005 Professional is already available for MSDN subscriber preview, and the express version is available for public download.

Short of that if you know a non-developer who is doing a computer science degree you could hassle them to ask if Visual Studio Pro is available. The Uni I go to has some agreement and I got a copy for the cost of a CD (as long as you don't use it commercially of course), I don't know if Microsoft do that for all educational institutes.

Share this post


Link to post
Share on other sites
Those aren't bad deals Steve, when I bought VC 2003 I paid £100 for it, so about £80 isn't too bad. The reason you're paying those prices is one or more of

a) Import cost (shipping, duty)
b) VAT
c) artificial price inflation

Depending on what you believe ;)

-Mezz

Share this post


Link to post
Share on other sites
I sugest you give VC++ 2005 express a try. I have both C++ and C# and both work great for me. The only thing I can't find is how to force it to use .NET 1.1 and not 2.0.

Or, as neonkandi said, you could try getting MSVS 2003 trough your uni if you are still a student. I still have a verison of that.. well for one more year at least. The MSAA is just great.

Share this post


Link to post
Share on other sites
Thanks for all the replies. I got a reply from Amazon.co.uk, if anyone is interested:
Quote:

Dear Customer

Thank you for contacting Amazon.co.uk.

We realise that from time to time, our customers will be able to
purchase a single product from another store at a lower price than
ours. We recognise that you have a choice of retailers and are
pleased that you would prefer to order from us. Unfortunately, we do
not have a price matching policy at this time.

Please note that in some cases our website offers lower prices via the
used and new offerings available from Amazon.co.uk Marketplace
sellers. For more information, please read our Marketplace Help
section:

http://www.amazon.co.uk/exec/obidos/tg/browse/-/3149521/

I hope you will be able to take advantage of the many discounts we
offer on your next visit to our store. We sincerely appreciate your
business, and we look forward to seeing you again.

I didn't mention that the "Buy it used" was more expensive then byuing it new :P

Unfortunately, I'm no longer a student (I graduated last October), so I can't apply for the academic version. My sister is a student, but I doubt I'll be able to use it if she applies for it.

I would use VC 2005 Beta, but You're not allowed to release anything you create with it, are you?

Share this post


Link to post
Share on other sites
At this point in time I would suggest ordering the VS2005 beta... unless you need to release something before it comes out in final version in a few months.

In that case I would buy VS2003 STD and than use the free optomizing compiler with it.

Share this post


Link to post
Share on other sites
If you do go the Vs 2005 beta, MS will ship you a DVD of the VS 2005.Net Beta for £3, which isn't the express versions but the full version of VS which includes all the languages it supports and you won't have to download things like the platform SDK seperately. Though I'm pretty sure it stops working in march, however wyrzy said a second beta could be comming out around that time and I guess that that'll last into summer.

Share this post


Link to post
Share on other sites
I wouldn't be so quick to blame VC 6. You probably had the static variable defined in a header, in which case each file got its own copy. Even though singletons generally suck, their syntax is straight forward and compilers have no problem letting you (ab)use them.

Share this post


Link to post
Share on other sites
Quote:
Original post by Evil Steve
I would use VC 2005 Beta, but You're not allowed to release anything you create with it, are you?

When are you planning on releasing? If you've got a few months, then you could use the beta edition for now and buy 2K5 when it comes out.

I honestly have not read the license on the Beta edition, as I am still a student who attending a MSDNAA licensed school. You would need to investigate if you plan to release commercially.

Also, someone mentioned about the Beta's expiring. According to the MSDN blog at: http://www.artima.com/forums/flat.jsp?forum=152&thread=90973 it expires July 1st, 2005
Quote:
Since lots of people are curious about this, Dan Conley responded to an email from a customer and said that I could publish this publicly.

VS 2005 Beta 1 timebomb date = July 1, 2005

That quote is from:
Quote:
Daniel Fernandez is the Product Manager for C# in the developer division at Microsoft.


I would imagine that the beta 2's will not expire until a month or two after the final product is released. Microsoft may be using the Beta's to get both customer feedback and a sort of trial version to customers who want to evaluate before they buy.

Share this post


Link to post
Share on other sites
Quote:
Original post by foofightr
I wouldn't be so quick to blame VC 6. You probably had the static variable defined in a header, in which case each file got its own copy. Even though singletons generally suck, their syntax is straight forward and compilers have no problem letting you (ab)use them.



That is probably true, but VC6 is getting long in the tooth now. It has alot of known issues. My employer purchases my compiler tools for me so I generally do not think about the cost of these things :-) I am very satisified with VS 2003.

Share this post


Link to post
Share on other sites
Quote:
Original post by Toolmaker
Steve, like I said to you last night, surrender the code to me and I'll compile it in MSVC 2003.
The code works now, thanks anyway.

Quote:
Original post by foofightr
I wouldn't be so quick to blame VC 6. You probably had the static variable defined in a header, in which case each file got its own copy. Even though singletons generally suck, their syntax is straight forward and compilers have no problem letting you (ab)use them.
This was definitely MSVC's fault. The destructor for my singleton was getting called twice, with the same this pointer address. Which shouldn't happen under any circumstances I can think of.

I think I'll stick with MSVC 6 for now, at least till the VC 2005 beta expires, and then I can see how long the next phase will last. But I'm not planning on sticking to MSVC 6 for much longer...

Share this post


Link to post
Share on other sites
I wouldn't be so quick to blame the compiler, lots of people used vs 6 with singletons. DId you by any chance define the singleton in a library?? If two different dll's linked it in or another library pulled in the lib then you could have two versions of the singleton.

And it wouldn't be the compilers fault:)

Cheers
Chris

Share this post


Link to post
Share on other sites
Quote:
Original post by chollida1
I wouldn't be so quick to blame the compiler, lots of people used vs 6 with singletons. DId you by any chance define the singleton in a library?? If two different dll's linked it in or another library pulled in the lib then you could have two versions of the singleton.
Yeah, I just like to bash MSVC 6 ;)
The singleton was defined in a source file, with an accessor function in the header.
It was probably related to the internal compiler error I got - changing the line if(!m_pfnAction) to if(m_pfnAction == NULL) got rid of it.
And yes, I tried a rebuild all. And deleting all the intermediate files. Still no joy :(

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this