Compile error? CS0042

When I go to hit compile the error log shows this:

Hey BloodWraith,

Presumably you’ve solved this issue by now, but it still comes up high on a search so I’m going to describe how I solved it. I’m in 4.14.0. These might not have all been necessary but I’m going to try to list everything I did.

Things that might have been necessary

I’m using Perforce and for some reason didn’t have the Command Line Client, so I downloaded that from I then opened a Command Prompt, typed the drive which houses the server (‘C:’ if it’s on your main drive), and then began issuing p4 commands to implement a typemap. Source control may have been denying access to the pdb file.

Most of it can be found here (with instructions on how to open it through Command Prompt): Using Perforce as Source Control for Unreal Engine | Unreal Engine Documentation

The critical lines, one of which isn’t in there, are:


            binary+w //depot/....exe
            binary+w //depot/....dll

Again, nota bene the line with the pdb exclusion is not in the default typemap listed on the page linked above.

After that, just because I wasn’t sure that had worked, I checked out the entire project to ensure that the Perforce server wasn’t denying access to the .pdb file.

Steps that definitely contributed to solution

  1. Delete derived files and right click the .uproject file and rebuild VS files. This means you delete the following folders: Binaries, Build, DerivedDataCache, Intermediate, and Saved, as well as the file {projectname}.VC.db. After that, right-click the project file and rebuild the VS files. This may solve the entire problem. However, after that I still had an issue.
  2. Compile in engine and VS2015 now worked, but Cook/Package did not. The issue: I had some blueprints I migrated (to reference/copy) which had broken links to other assets I had either deleted or never migrated. The solution: force delete all broken assets in the editor (assuming you don’t need them! – if you do you’ll need to fix the links another way one by one), right-click the content folder in the content browser and fix-up redirectors, close the project and ensure that the files were actually deleted in the file system where the project is stored. Upon reopening the project, I believe I fixed-up redirectors in the content folder once more and it was finally able to cook/package for Windows 64! If you need more on this fix, I found it in the top answer from Samantha here:

Hope this helped.