简体   繁体   中英

can't build old VS2010 project with VS2013. (build tool for VS2010 cannot be found.)

I have installed VS2013 on my computer about 2 years ago(and removed VS2010 I guess) and today I tried to open my old VS2010 project (MV1.sln) that I used to work with about 5 years ago. When I tried to open it, it just says "more than one project in the solution was not loaded correctly. refer to the output window"(translated from Korean). The output window says

D:\\My_Path\\MV1\\MV1.vcxproj : error : can't read project file "MV1.vcxproj" D:\\My_Path\\MV1\\MV1.vcxproj(34,5): can't find imported project "C:\\Program Files (x86)\\MSBuild\\Microsoft.Cpp\\v4.0\\V120\\BuildCustomizations\\CUDA 4.0.props". Check if the path specified in <import> declaration is correct and file exists in the disk.

So I checked the MV1.vcxproj file's line 34 which reads

<Import Project="$(VCTargetsPath)\BuildCustomizations\CUDA 4.0.props" />

which seems to be correct path because the value $(VCTargetsPath) is being used before line 34 in the same file and I can easily guess it points to C:\\Program Files (x86)\\MSBuild (I can see Microsoft.Cpp.props folder and BuildCustomizations\\CUDA 4.0.props file referred to in the .vcxproj file)
I had CUDA4.0.props file which specifies include path and library path for CUDA4.0 under C:\\Program Files (x86)\\Microsoft Visual Studio 10.0 (I kept those files there at that time) but copied it to the location specified in vcxproj file to make it appear there.
I found some similar questions and answers but they seem to be different from my case. What can be the most correct method other than making a new project and copying and specifying everything one-by-one?

I found the file name should have a space in 'CUDA 4.0.props' so I changed the file name(MSBuild/Microsoft.Cpp/V120/BuildCustomizations/CUDA 4.0.targets) , then it complained about CUDA 4.0.targets file missing, so I copied MSBuild/Microsoft.Cpp/v4.0/BuildCustomizations/CUDA 4.0.targets (it was there since 5 years ago) to MSBuild/Microsoft.Cpp/v4.0/V120/BuildCustomizations/CUDA 4.0.targets. Now I can see the files in the project browser but when I build the project, it says

error MSB8020: The build tools for Visual Studio 2010 (Platform Toolset = 'v100') cannot be found. To build using the v100 build tools, please install Visual Studio 2010 build tools. Alternatively, you may upgrade to the current Visual Studio tools by selecting the Project menu or right-click the solution, and then selecting "Upgrade Solution...". C:\\Program Files (x86)\\MSBuild\\Microsoft.Cpp\\v4.0\\V120\\Microsoft.Cpp.Platform.targets 64 5 MV1

But in my VS2013 I don't see such "Upgrade Solution" or upgrade menu. So I looked for method to change the toolset and found Visual Studio 2013 error MS8020 Build tools v140 cannot be found and seleted VS2013 and it tries to build now. (though I have fix some errors cannot link external symbol _CUDAInit.. etc.)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM