Click here to Skip to main content
15,868,016 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I've a project called " Demo_Mech.cpp" written for operating table tennis robot.
When i opened it by Visual Studio 2019 and compiled it showed error in the file"Microsoft.CppCommon.targets" :
MSB6006: 'CL.exe' is exited with code 2
So my question is How to compile this program(written in Visual C++6.0)in Visual Studio 2019?


What I have tried:

I've tried searched in google but i didn't find the solution.
I'd be very grateful if anyone give me a solution for this.
Posted
Updated 21-Oct-19 1:17am

Create a new project in VS2019 and import the source code from the original. Visual C++ 6.0 projects are too old to import correctly.
 
Share this answer
 
Richard is right, and should do it, if it works. You must also transfer the compiler flags. linker and additional settings.

Another way can be to open the VC 6.0 project in some older Visual Studio like 2001 til 2005 or maybe 2009 first. They may convert the project into some .sln file which you may open than in later version.

Microsoft has changed the formats in every release but has converting support for older versions. So you may do it stepwise like: 2003 => 2009 => 2019
 
Share this answer
 
Comments
Member 14629414 21-Oct-19 7:23am    
@KarstenK
thank you so much for that precious advise.
I'll follow that way because when open new project in visual studio 2019 and copy the code from original i've faced many mistake when i corrected it it came to another error which is in another file not that source file and i don't know how to fixed it
The error in my 2nd question is an example. When i fixed this name 'getch' it came up with 8 errors in the other file which i even can't open it
Richard MacCutchan 21-Oct-19 7:55am    
If you showed us the errors (in your other question) we may be able to help.
Member 14629414 21-Oct-19 8:19am    
LNK 2005:main is already defined in ConsoleApplicationDemo_Mech.obj
LNK 2019: Unresolved external symbol __imp_closesocket referenced in function main
LNK 2019: Unresolved external symbol __imp_connect was referenced in the function main.
LNK 2019 : Same to error above but with ''_imp_htons''
LNK 2019 : " " _imp_recv " "
LNK 2019 : _imp_send
LNK 2019: _imp_socket
LNK 2019: _imp_WSAStartup
LNK 2019:_imp_inet_pton
All this errors orcured in a file called''Source.obj''
LNK1120 8 outstanding external references
Only this error orcured in file''ConsoleApplicationDemo_Mech.exe''
The project i'm writing named ''ConsoleApplicationDemo_Mech''
Richard MacCutchan 21-Oct-19 10:06am    
You obviously have more than one source file that contains a definition of main, which is the starting point of the applications. Also, all those LINK 2019 messages indicate a missing library, or source module from the project. You will need to look at the original project file to see how this application is supposed to be built.
Member 14629414 21-Oct-19 8:32am    
Oh i've just realize i can not dowload the VS 2003 because the system require is very different.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900