Pharap / SDL2-Project-Template

A Visual Studio template for SDL Projects
29 stars 3 forks source link

Any update to support Visual Studio 2019 ? #9

Open ThanosRestas opened 1 year ago

ThanosRestas commented 1 year ago

When using the template in Visual Studio 2019, you get a : error MSB3073: The command "COPY /Y "C:\Users\xxxx\source\repos\Project1\Project1\Lib\x86\*.dll" "C:\Users\xxxx\source\repos\Project1\Debug\*.dll"

Pharap commented 1 year ago

Are you sure that's the full error message?

According to this there should have been an exited with code 'return code' after that.

You can also follow the directions in that link to enable full diagnostic output, which may provide further useful error messages.

Without something to tell me what the exact problem is, I have no way of rectifying the issue.

ThanosRestas commented 1 year ago

@Pharap You are right !😥 I didn't paste the whole message. So the correct error messages are these:

Build started...
1>------ Build started: Project: Project1, Configuration: Debug Win32 ------
1>The system cannot find the path specified.
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(145,5): error MSB3073: The command "COPY /Y "C:\Users\Thanos\source\repos\Project1\Project1\Lib\x86\*.dll" "C:\Users\Thanos\source\repos\Project1\Debug\*.dll"
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(145,5): error MSB3073: :VCEnd" exited with code 1.
1>Done building project "Project1.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Severity    Code    Description Project File    Line    Suppression State
Error   MSB3073 The command "COPY /Y "C:\Users\Thanos\source\repos\Project1\Project1\Lib\x86\*.dll" "C:\Users\Thanos\source\repos\Project1\Debug\*.dll"
:VCEnd" exited with code 1. Project1    C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets 145 

Will check the full diagnostic output too and paste the results.

Pharap commented 1 year ago

The system cannot find the path specified.

That suggests that either "C:\Users\Thanos\source\repos\Project1\Project1\Lib\x86" or "C:\Users\Thanos\source\repos\Project1\Debug" doesn't exist.

If the project was created from the template correctly then "C:\Users\Thanos\source\repos\Project1\Project1\Lib\x86" should certainly exist. (Unless it's been moved or deleted for some reason?)

I'm guessing the folder "C:\Users\Thanos\source\repos\Project1\Debug" doesn't exist, in which case creating it should solve the issue.

If that does fix the problem, I could add another command (MD) to force the creation of the $(TargetDir) directory before attempting to copy.

ThanosRestas commented 1 year ago

Hmmm, as you can see the folders exist. Am I messing something on my part ? This is encountered only when using VS2019(as a reminder) image

image

Pharap commented 1 year ago

Do you get the same error if you run the command manually?

COPY /Y "C:\Users\Thanos\source\repos\Project1\Project1\Lib\x86\*.dll" "C:\Users\Thanos\source\repos\Project1\Debug\*.dll

If so, it might be a change in command behaviour depending on OS version.

If not then I'm presuming VS2019 is doing something weird that prevents the command from working, and I'd have no clue what that might be.

I don't have VS2019 installed so I have nothing to test with, and I'm not going to install it just to test this.

I could look into replacing COPY with ROBOCOPY to see if that's an improvement, but I don't have time to research that at the moment.

nsallis commented 11 months ago

If you are using the option to place the solution in the project directory, this template will not work since that will mess up your paths. You will also need to "retarget solution" on the project.