4

I tried adding a copy of the (working) platform toolset for Visual C++ 2005 to C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\Win32\PlatformToolsets\v71, replacing everything that made sense.

But when I try to compile my project, the output is disappointing:

1>  Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 13.10.6030 for 80x86
1>  Copyright (C) Microsoft Corporation 1984-2002. All rights reserved.
1>  
1>  cl ÿþ/
1>  
1>cl : Command line warning D4024: unrecognized source file type 'ÿþ/', object file assumed
1>  Microsoft (R) Incremental Linker Version 7.10.6030
1>  Copyright (C) Microsoft Corporation.  All rights reserved.
1>  
1>  /out:.exe 
1>   ■/ 
1>LINK : fatal error LNK1181: cannot open input file ' ■/.obj'
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

Looks like a character set problem to me, but did anyone ever get it to work?

Timbo
  • 27,472
  • 11
  • 50
  • 75
  • Just curious... Do you have incremental linking enabled? – Juan Mellado Mar 15 '12 at 14:16
  • Have you made sure that all the sources are correct for that version? – Aleks Mar 20 '12 at 12:06
  • @Aleks There exists a solution/vcproj file for vs2003, and it compiles fine. This is not a source code problem, it is definitely hidden in the way the compiler is invoked. – Timbo Mar 20 '12 at 17:43
  • In your question you mention "Visual C++ 2005", but in the title you refer to "Visual C++ 2003". (The version numbers in your question also point to 2003.) – Ralph Mar 22 '12 at 10:06

3 Answers3

0

I think if you follow this link you will find the answer you are looking for.

It looks like you cl.dll is out of data or not the right version, so you may not have fully converted your tool chain.


On a side not, I am curious as to why you are trying this

thecoshman
  • 8,394
  • 8
  • 55
  • 77
  • Looks like the guy posting behind that link had the same error message... but he didn't want to use VC7.1, while I want to :-) – Timbo Mar 20 '12 at 17:44
  • I am maintaining a C++ class library that has to be built using every MSVC compiler version from 2003 and later. Yes, I know it is a bad idea to have C++ in the binary interface, but that is not something I can change. Whenever a new file is added to the project, it has to be added manually to all 4 (soon to be 5) project files. I can reduce it to 2 (because 2005 through VS11 work fine), but I would really like to get rid of the 2003 project/solution, too. – Timbo Mar 20 '12 at 17:47
  • Unless I missed something, you should be able to have one set of C++ source code and compile it with as many different tool chains as you wish. This complication may be because you are having to do this through VS – thecoshman Mar 21 '12 at 08:29
  • Of course there is only one source code. But there is (currently) multiple project files, one for each VS version. And I don't need different project files when the newest VS version invokes the different compiler versions. This works fine for all but 2003, hence the question :-) – Timbo Mar 21 '12 at 09:43
  • oh ok, I see where you are coming from now. I trust you have tried, if possible, to just use VS 2003 to create a project and compile it there. Just in case something freaky is going on with 2003 – thecoshman Mar 21 '12 at 09:51
  • Yes, the project already exists and works fine. But it would be really nice to get rid of the project file and just use one project file for all compiler versions. – Timbo Mar 21 '12 at 10:14
0

Why in the world would you want to overwrite files? It should be just as simple as changing the executable directory inside the project. when whenever it looks for cl.exe/link.exe that's where it will go to. ProjectProperties->Configuration Properties ->VC++ directories. just create a bunch of configurations. and tweak for each compiler. It should work just fine. Mind you you may need to tweak the source,include and so forth, but it should all just work.

Dan
  • 1,981
  • 1
  • 14
  • 18
  • Creating a platform toolset is the more standard-way of doing that. In essence, it also only changes the directories in which VS finds the tools. As you can see in the output log, the correct compiler is started, but for some reason it does not like its parameters. – Timbo Mar 21 '12 at 11:04
0

replacing everything that made sense

I believe, you missed a file and thus your cl.exe picks up a wrong version of a dependent DLL.

In my Microsoft Visual Studio .NET 2003/Vc7/bin folder I see the following files, which would be needed for compiling:

cl.exe    Microsoft C/C++ Compiler Driver
c1.dll    Microsoft Visual C Compiler Front End
c1xx.dll  Microsoft Visual C++ Compiler Front End
c2.dll    Microsoft 80x86 Compiler Back End

Other files (ml.exe, link.exe, lib.exe, ...) will also be needed to create a binary. But currently you are failing on the compilation.

For a C++ project you will need c1xx.dll in version 13.10.3077.0 .

BTW: Nice idea. I also want to try it, when I get around to it. I'd appreciate if you could post the final solution here.

Ralph
  • 5,154
  • 1
  • 21
  • 19