17

I have a huge Visual Studio 2010 solution. I work with Visual Studio 2005, so I want to convert the solution to the desired version. Basically, it's a portable C++ code so it should compile on Visual Studio 2005 too. Changing the version in the *.sln file doesn't help because the *.vcxproj format is completely different from the old *.vcproj format.

Recreating the solution by hand is not an option because of its size. Also there may be some non-default compiler flags, dependencies, etc. that I don't know of (and I can't look through ALL this XML junk that I don't understand).

There is already a related question on How Do I Downgrade a C++ Visual Studio 2008 Project to 2005. However, the utility suggested there supports at most Visual Studio 2008.

Any suggestions?

Community
  • 1
  • 1
Yakov Galka
  • 70,775
  • 16
  • 139
  • 220

4 Answers4

4

It really totally sucks, that every proprietary IDE today thinks it needs to create its own project file format. "Dear IDE developers, just use Makefiles and create a nice GUI for it so that also people without Makefile knowledge can use it!" In VS6 it was at least possible to import/export Makefiles, but not today anymore. And it was possible to use nmake for automated builds. No IDE needed to be installed, just the toolchain which could be grabbed by a simple checkout without installation.

I use CMake now. It's free, it's cross-platform, it is well supported in free IDEs like KDevelop, QtCreator, etc. It can generate Makefiles and Visual Studio projects. So you maintain only one project source, the CMakeLists.txt file and can work with any IDE. No pain with different versions of Visual Studio or with other proprietary project file formats. This way you can generate or VS projects for developing and you can generate Makefiles for commandline builds using nmake like in the good old days.

BTW, it's much easier to change settings in a CMakeLists.txt than clicking through various GUI dialogs. But this is a matter of personal preferences.

gergap
  • 41
  • 2
  • 3
    1) VS supports `nmake` projects till today. 2) MS switched to MSBuild for describing the build of the projects. 3) I'm skeptical to what degree it is possible to make a GUI editing makefiles. 4) Why do you think that gnu make should be the 'standard'? It's so an ugly build system. It requires you to either write all this stuff by hand (good luck making your makefiles portable across different toolchains), or use the autoconf tools which are even uglier. There are better build systems out there (boost build, scons). – Yakov Galka Oct 01 '12 at 13:47
  • 1
    5) I hate CMake, because just like with configure/make it is not a one step build system. Try building 4 different configurations in one command line invocation... boost.build solves it to a great extent. 6) How it answers the question? – Yakov Galka Oct 01 '12 at 13:47
  • 1
    Of all you said I agree with you on one thing: it sucks that every IDE has its own project file format. Moreover, IMO projects should not exist. IDE should be able to 'open' arbitrary makefile (be it nmake, gmake, boost.build or any other build system) which it will use for build purpose only, and instead of the "Solution Explorer" I want to see a plain old filesystem tree rooted ath the opened makefile. – Yakov Galka Oct 01 '12 at 13:55
1

In my work made a utility which utilized the EnvDTE.dll and scanned a vcproj-file and optionally all vcproj-files within a sln-file. It compared all settings with a "template" and would issue a warning or optionally update the setting to correct values. We used this utility so that settings would be verified to be correct and consistent throughout all projects. I haven't updated the utility to 2010 yet due to other priorities.

EnvDTE hasn't changed much from Visual Studio 2008 to Visual Studio 2010. Perhaps it is possible to create a simple utility which opens the vcxproj-file using DTE100 and saves it using DTE90, or earlier.

dalle
  • 18,057
  • 5
  • 57
  • 81
1

Easiest way is probably to create a new project in VS 2005, and use the add existing item dialog to add the code to the project. I'd suggest using 'Empty Project' as the project type, so you don't have a lot of rubbish autogenerated for you that you'll just delete anyway.

Opieus
  • 151
  • 1
  • 2
  • 9
  • 1
    It doesn't solve the hardest part: I can't set all the compiler flags and dependencies in a ~100 project solution by hand. – Yakov Galka Jun 11 '11 at 06:32
0

I haven't tried it, but this looks promising:

http://www.emmet-gray.com/Articles/ProjectConverter.htm

edit: Nope, not promising, sorry :-(

Caladain
  • 4,801
  • 22
  • 24
  • 3
    Alas "There is a completely new project file format for C/C++ in VS2010, so this utility will not be able to convert C/C++ projects to or from this new format. Sorry..." – Rup Jan 04 '11 at 19:09
  • Ack, that sucks. I was hoping that was just an old statement, as the screenshots would lead you to believe it worked. I think you're SOL.. :-( – Caladain Jan 04 '11 at 19:12