4.18.0 VSCode build error; PhysX3CHECKED_x64.lib

I tried build use VSCode with 4.18’s UE4Editor generated .vscode project settings. But, I couldn’t Start Debug in VSCode. The linker log said “LNK1181: cannot open input file ‘PhysX3CHECKED_x64.lib’”. How can I solve it?

Repro

  1. Install 4.18.0
  2. Create a new project
  3. Open the project with UE4Editor
  4. UE4Editor: Edit → Editor Preferences → General → Source Code → Accessor → Source Code Editor: change to Visual Studio Code
  5. UE4Editor: File → Refresh Visual Studio Code
  6. Open a C++ class or run VSCode and open the project directory
  7. VSCode: Debug( Control + Shift + D ): select <project-name> (Debug) and Start Debug

Error log example


[1/1] Link SideTest-Win64-Debug.exe
LINK : fatal error LNK1181: cannot open input file 'PhysX3CHECKED_x64.lib'
ERROR: UBT ERROR: Failed to produce item: C:\Users\usagi\tmp\SideTest\Binaries\Win64\SideTest-Win64-Debug.exe

Environment

  • Windows 10 x64 ( 10.0.16299.19 )
  • VS2017 Community Edition ( 15.4.0 )
  • VSCode ( 1.17.2 )

I didn’t solve it. But, I understood a situation. UE4 is not install PhysX for debug then the problem occur on <ProjectName> (Debug) profile.

However, we can use a <ProjectName>Editor (DebugGame) and a <ProjectName>Editor (Development) profiles for debugging. Let’s forget these other profiles.


Appendix: These default profiles are not useful for a often times. Therefor I defined the task for a below:

Run/EditorDebug: C:/Program Files/Epic Games/UE_4.18/Engine/Binaries/Win64/UE4Editor.exe <path-to-uproject-file> -debug -game

The important option is -game. This is run the project on the standalone-like UE4Editor process without IDE user interfaces. It can run an independent process to the other running UE4Editor process.

also having the same problem in launching the game but it packages without any errors :[