Hello,
I just installed VC++ Express 2005 and opened my project in it. It seems several changes were made in the compiler that now causes my code to be erroneous. I'd like an explanation why these things have changed and the best way to correct them if possible (when its not obvious).
1. I noticed the Win32 Application project wizard was gone. Why
2. for-loops no longer accept previous loop-variables from same-level for-loops to be used. Why 2003 allowed both that and redefinitions. That was great.
3. std::vector functions can no longer use the vector.erase(&vector[ i ]); syntax. Why Thats the easiest way to use these functions.
Well these things seems to summarize the errors shown up so far. Appreciate comments on these.

Problems encountered when changing to 2005
steedm
Thanks for the link. Unfortunately it doesn't help me with the following link errors.
Sorry for the late answer. I've been busy like everyone else. I've now tried to include the libs suggested and the link errors I *had* are gone. Instead I got link errors on classes I've never seen before. It would be great if soemone could point out what I miss now. I've added all libs I used in the previous version of visual c++ for this project.
Here's some of the output (it's a loooong list of errors). This Xran seems to be a major problem.
>LIBCMT.lib(stdexcpt.obj) : error LNK2005: "public: __thiscall std::bad_cast::bad_cast(char const *)" ( 0bad_cast@std@@QAE@PBD@Z) already defined in MenuEditorCPU.obj
1>LIBCMT.lib(stdexcpt.obj) : error LNK2005: "public: __thiscall std::bad_cast::bad_cast(class std::bad_cast const &)" ( 0bad_cast@std@@QAE@ABV01@@Z) already defined in MenuEditorCPU.obj
1>LIBCMT.lib(stdexcpt.obj) : error LNK2005: "public: virtual __thiscall std::bad_cast::~bad_cast(void)" ( 1bad_cast@std@@UAE@XZ) already defined in MenuEditorCPU.obj
1>ProfileManager.obj : error LNK2001: unresolved external symbol "void __cdecl std::_Xran(void)" ( _Xran@std@@YAXXZ)
1>RaceEvents.obj : error LNK2001: unresolved external symbol "void __cdecl std::_Xran(void)" ( _Xran@std@@YAXXZ)
1>UserInterface.obj : error LNK2001: unresolved external symbol "void __cdecl std::_Xran(void)" ( _Xran@std@@YAXXZ)
1>Weather.obj : error LNK2001: unresolved external symbol "void __cdecl std::_Xran(void)" ( _Xran@std@@YAXXZ)
1>MenuResults.obj : error LNK2001: unresolved external symbol "void __cdecl std::_Xran(void)" ( _Xran@std@@YAXXZ)
1>MenuSelectTrack.obj : error LNK2001: unresolved external symbol "void __cdecl std::_Xran(void)" ( _Xran@std@@YAXXZ)
1>MenuTrackInfo.obj : error LNK2001: unresolved external symbol "void __cdecl std::_Xran(void)" ( _Xran@std@@YAXXZ)
1>Driver.obj : error LNK2001: unresolved external symbol "void __cdecl std::_Xran(void)" ( _Xran@std@@YAXXZ)
1>MenuStats.obj : error LNK2001: unresolved external symbol "void __cdecl std::_Xran(void)" ( _Xran@std@@YAXXZ)
1>MenuGarage.obj : error LNK2001: unresolved external symbol "void __cdecl std::_Xran(void)" ( _Xran@std@@YAXXZ)
1>MenuPause.obj : error LNK2001: unresolved external symbol "void __cdecl std::_Xran(void)" ( _Xran@std@@YAXXZ)
1>MenuRaceSummary.obj : error LNK2001: unresolved external symbol "void __cdecl std::_Xran(void)" ( _Xran@std@@YAXXZ)
1>MenuOptionsGraphics.obj : error LNK2001: unresolved external symbol "void __cdecl std::_Xran(void)" ( _Xran@std@@YAXXZ)
1>MenuOptionsInput.obj : error LNK2001: unresolved external symbol "void __cdecl std::_Xran(void)" ( _Xran@std@@YAXXZ)
1>MenuOptionsSound.obj : error LNK2001: unresolved external symbol "void __cdecl std::_Xran(void)" ( _Xran@std@@YAXXZ)
1>MenuProfile.obj : error LNK2001: unresolved external symbol "void __cdecl std::_Xran(void)" ( _Xran@std@@YAXXZ)
1>MenuCredits.obj : error LNK2001: unresolved external symbol "void __cdecl std::_Xran(void)" ( _Xran@std@@YAXXZ)
1>MenuIntro.obj : error LNK2001: unresolved external symbol "void __cdecl std::_Xran(void)" ( _Xran@std@@YAXXZ)
1>MenuMain.obj : error LNK2001: unresolved external symbol "void __cdecl std::_Xran(void)" ( _Xran@std@@YAXXZ)
1>MenuOptionsGame.obj : error LNK2001: unresolved external symbol "void __cdecl std::_Xran(void)" ( _Xran@std@@YAXXZ)
1>MenuWelcome.obj : error LNK2001: unresolved external symbol "void __cdecl std::_Xran(void)" ( _Xran@std@@YAXXZ)
1>MenuArcadeRace.obj : error LNK2001: unresolved external symbol "void __cdecl std::_Xran(void)" ( _Xran@std@@YAXXZ)
1>MenuSingleRace.obj : error LNK2001: unresolved external symbol "void __cdecl std::_Xran(void)" ( _Xran@std@@YAXXZ)
1>MenuTimeTrial.obj : error LNK2001: unresolved external symbol "void __cdecl std::_Xran(void)" ( _Xran@std@@YAXXZ)
1>MenuJoinLeague.obj : error LNK2001: unresolved external symbol "void __cdecl std::_Xran(void)" ( _Xran@std@@YAXXZ)
1>MenuLeague.obj : error LNK2001: unresolved external symbol "void __cdecl std::_Xran(void)" ( _Xran@std@@YAXXZ)
1>MenuMessages.obj : error LNK2001: unresolved external symbol "void __cdecl std::_Xran(void)" ( _Xran@std@@YAXXZ)
1>MenuUpgrade.obj : error LNK2001: unresolved external symbol "void __cdecl std::_Xran(void)" ( _Xran@std@@YAXXZ)
1>TrackManager.obj : error LNK2001: unresolved external symbol "void __cdecl std::_Xran(void)" ( _Xran@std@@YAXXZ)
1>MenuAdvance.obj : error LNK2001: unresolved external symbol "void __cdecl std::_Xran(void)" ( _Xran@std@@YAXXZ)
1>MenuCarShop.obj : error LNK2001: unresolved external symbol "void __cdecl std::_Xran(void)" ( _Xran@std@@YAXXZ)
1>MenuContinueLeague.obj : error LNK2001: unresolved external symbol "void __cdecl std::_Xran(void)" ( _Xran@std@@YAXXZ)
1>OpponentManager.obj : error LNK2001: unresolved external symbol "void __cdecl std::_Xran(void)" ( _Xran@std@@YAXXZ)
1>Layer.obj : error LNK2001: unresolved external symbol "void __cdecl std::_Xran(void)" ( _Xran@std@@YAXXZ)
1>Map.obj : error LNK2001: unresolved external symbol "void __cdecl std::_Xran(void)" ( _Xran@std@@YAXXZ)
1>MapObject.obj : error LNK2001: unresolved external symbol "void __cdecl std::_Xran(void)" ( _Xran@std@@YAXXZ)
1>Division.obj : error LNK2001: unresolved external symbol "void __cdecl std::_Xran(void)" ( _Xran@std@@YAXXZ)
1>League.obj : error LNK2001: unresolved external symbol "void __cdecl std::_Xran(void)" ( _Xran@std@@YAXXZ)
1>LeagueManager.obj : error LNK2001: unresolved external symbol "void __cdecl std::_Xran(void)" ( _Xran@std@@YAXXZ)
1>MessageManager.obj : error LNK2001: unresolved external symbol "void __cdecl std::_Xran(void)" ( _Xran@std@@YAXXZ)
1>RaceCar.obj : error LNK2001: unresolved external symbol "void __cdecl std::_Xran(void)" ( _Xran@std@@YAXXZ)
1>Vehicle.obj : error LNK2001: unresolved external symbol "void __cdecl std::_Xran(void)" ( _Xran@std@@YAXXZ)
1>CarShop.obj : error LNK2001: unresolved external symbol "void __cdecl std::_Xran(void)" ( _Xran@std@@YAXXZ)
1>CurrentLeagueInfo.obj : error LNK2001: unresolved external symbol "void __cdecl std::_Xran(void)" ( _Xran@std@@YAXXZ)
1>Log.obj : error LNK2001: unresolved external symbol "void __cdecl std::_Xran(void)" ( _Xran@std@@YAXXZ)
1>CarFile.obj : error LNK2019: unresolved external symbol "void __cdecl std::_Xran(void)" ( _Xran@std@@YAXXZ) referenced in function "public: void __thiscall CCarFile::SetAttribute(enum CAR_ATTRIBUTE,float)" ( SetAttribute@CCarFile@@QAEXW4CAR_ATTRIBUTE@@M@Z)
1>CarManager.obj : error LNK2001: unresolved external symbol "void __cdecl std::_Xran(void)" ( _Xran@std@@YAXXZ)
1>GhostCar.obj : error LNK2001: unresolved external symbol "void __cdecl std::_Xran(void)" ( _Xran@std@@YAXXZ)
1>DirectoryManager.obj : error LNK2001: unresolved external symbol "void __cdecl std::_Xran(void)" ( _Xran@std@@YAXXZ)
1>FileManager.obj : error LNK2001: unresolved external symbol "void __cdecl std::_Xran(void)" ( _Xran@std@@YAXXZ)
1>IDCollection.obj : error LNK2001: unresolved external symbol "void __cdecl std::_Xran(void)" ( _Xran@std@@YAXXZ)
1>IniManager.obj : error LNK2001: unresolved external symbol "void __cdecl std::_Xran(void)" ( _Xran@std@@YAXXZ)
1>MusicManager.obj : error LNK2001: unresolved external symbol "void __cdecl std::_Xran(void)" ( _Xran@std@@YAXXZ)
1>OggObject.obj : error LNK2001: unresolved external symbol "void __cdecl std::_Xran(void)" ( _Xran@std@@YAXXZ)
1>WavObject.obj : error LNK2001: unresolved external symbol "void __cdecl std::_Xran(void)" ( _Xran@std@@YAXXZ)
1>Time.obj : error LNK2001: unresolved external symbol "void __cdecl std::_Xran(void)" ( _Xran@std@@YAXXZ)
1>KeySet.obj : error LNK2001: unresolved external symbol "void __cdecl std::_Xran(void)" ( _Xran@std@@YAXXZ)
1>MouseManager.obj : error LNK2001: unresolved external symbol "void __cdecl std::_Xran(void)" ( _Xran@std@@YAXXZ)
1>AudioManager.obj : error LNK2001: unresolved external symbol "void __cdecl std::_Xran(void)" ( _Xran@std@@YAXXZ)
1>AudioObject.obj : error LNK2001: unresolved external symbol "void __cdecl std::_Xran(void)" ( _Xran@std@@YAXXZ)
1>InputDevice.obj : error LNK2001: unresolved external symbol "void __cdecl std::_Xran(void)" ( _Xran@std@@YAXXZ)
1>InputManager.obj : error LNK2001: unresolved external symbol "void __cdecl std::_Xran(void)" ( _Xran@std@@YAXXZ)
1>JoystickManager.obj : error LNK2001: unresolved external symbol "void __cdecl std::_Xran(void)" ( _Xran@std@@YAXXZ)
1>KeyboardManager.obj : error LNK2001: unresolved external symbol "void __cdecl std::_Xran(void)" ( _Xran@std@@YAXXZ)
1>SpriteManager.obj : error LNK2001: unresolved external symbol "void __cdecl std::_Xran(void)" ( _Xran@std@@YAXXZ)
1>SpritePhysics.obj : error LNK2001: unresolved external symbol "void __cdecl std::_Xran(void)" ( _Xran@std@@YAXXZ)
alejack
Okay I failed to mention that I've never used or heard of Xran. It must be something in a lib somewhere. None of my source files use it explicitly.
And I dont understand why bad_cast is already defined. I've never seen that either.
When I say add the libs I mean setting the search directories and adding them to the link commandline page for the project.
Hope this helps you help =)
jmol
It's only not part of the express version. Note that the Platform SDK is also not part of Express. You can install it separately and you can create native programs.
For those further wizards you need at least the Standard version.
If you mean this:
for (int i=0; i<100; ++i)
DoSomething(i);
cout << i;
Than this is an error in the previous versions of the MS compilers. I am happy that this is gone now. The for loop conformance can be adjusted in the compiler settings /Zc:forscope
This is not part of the standard defined for the STL. The correct syntax was always: vector.erase(vector.begin()+i);
Van
I was afraid of that. So there's no need to use the express version when I want to make native apps Or can I create one from an empty project
I suspected as much. When thinking about it, it is nicer that the loop-variable isn't accessible from outside. I'm just worried about all work needed to right this wrong now that we used that "feature" previously.
ah. that looks better too. I guess its best to just go through everything and make this right =)
SJP1203
I am not sure about all things with the express version, because I use the full version...
AFAIK it is possible to create native applications too, you need the installed platform SDK. There are instructions on the homepage of Visual C++ Express
The for loop conformance is adjustable, set the /Zc:forscope switch according your wishes. In this case the old (wrong) behavior can be used.
There was a trick to use the correct behavior in VC++ 6.0 too. But is was not known. I used it all the time, so I had no problem to switch.
#define for if(0);else for
ano_th
I'm not sure what you already know to do.
Did you look in the source code for any of the modules that refer to void std::Xran(void) Check in a small one and search for "Xran(" in the source.
Then look at the #include's for that compilation unit and see what header file, if any, defines Xran. Then maybe you can figure out, by association, what's missing that should be defining it and that you don't have where the library search can find it.
For the error LNK2005 cases, it would seem that there's an exception defined in stdexcpt.obj (in the MT library) that conflicts with a function defined in MenuEditorCPU. That sounds like one of the modules you're compiling. Can you tell from the MenuEditorCPU source code what that's about [Maybe you can comment it out and see whether the stdexcept.obj implementation works properly in its place.]
Finally, when you say you've added all libs used in the previous version, exactly how did you "add" them. You mean you added a directory of them to the search path for libs, or did you do something more aggressive than that
JohnE5
In addition to the answer from Martin, I found an useful post on changes in VC++ 2005 that break code from earlier versions.
It covers the cases raised by Benny and more: "Breaking Changes in the Visual C++ Compiler" at http://msdn2.microsoft.com/en-us/library/4162y30b.aspx