MSVC++ and templates

Programmers discuss here anything related to FreeOrion programming. Primarily for the developers to discuss.

Moderator: Committer

Post Reply
Message
Author
jbarcz1
Creative Contributor
Posts: 226
Joined: Thu Jun 26, 2003 4:33 pm
Location: Baltimore, MD

MSVC++ and templates

#1 Post by jbarcz1 »

This is kindof off-topic, but I figured it'd be a good place to ask.

VC++ 6.0 will not compile the following:

list<int>::iterator foobar;

It has to be typedeffed. I.e. :

typedef list<int> INT_LIST;
INT_LIST::iterator foobar;

Does anybody know if they've fixed this in .NET?
I'd like to eventually try getting FreeOrion to build with Microsoft's compiler in addition to gcc but this bug makes that impossible.

JB

tzlaine
Programming Lead Emeritus
Posts: 1092
Joined: Thu Jun 26, 2003 1:33 pm

#2 Post by tzlaine »

There are more ways that MSVC 6.0 is not compliant with the standard than there are Agent Smiths in the new Matrix movie. From what I have been heard (though I don't know for sure), 7.0 (.NET) is intended to be much more compliant. It should prove to be impossible to compile GG under 6.0 for at least one reason I can think of off the top of my head, and perhaps others. If you want this stuff to compile using a MS compiler, it's probably 7.0 or nothing.

jbarcz1
Creative Contributor
Posts: 226
Joined: Thu Jun 26, 2003 4:33 pm
Location: Baltimore, MD

#3 Post by jbarcz1 »

Yeah, this isn't the only compliance issue I've had with 6.0

Their website for .NET doesn't mention this particular bug, and I'm certainly not going to go buy it just to find out. :)

JB
Empire Team Lead

Baloney Detector
Space Krill
Posts: 2
Joined: Sun Jun 29, 2003 10:14 pm

Re: MCVC++ and templates

#4 Post by Baloney Detector »

Have you tried installing the latest service packs? That code seems to work in my 6.0 just fine...

Edit: by "that code" I mean the snippet in the opening post. I haven't tried compiling GG.

jbarcz1
Creative Contributor
Posts: 226
Joined: Thu Jun 26, 2003 4:33 pm
Location: Baltimore, MD

#5 Post by jbarcz1 »

I have one of the service packs at work, not sure which one or if its the latest, but the same problem occurs. Haven't installed any packs on my home machine.

JB
Empire Team Lead

tsev
Space Kraken
Posts: 167
Joined: Thu Jun 26, 2003 2:17 pm
Location: Pittsburgh, PA

#6 Post by tsev »

When I originally downloaded GG, I compiled my first program with it in MSVC.NET. I may have had to change a couple things, I can't remember. In visual studio 6 you need to do some additional configuration to make the STL work properly...I think its in a readme on the CD somewhere.

Post Reply