fatal error C1083: Cannot open include file: 'Px.h'

I would like to do a basic actor that would spawn a rigid body.

So I just added #include “PhysXIncludes.h” to the basic starter actor templates.

Compilation returns me the following error : Error G:\placeholdername\Unreal_Engine\Epic Games\4.10\Engine\Source\Runtime\Engine\Public\PhysXIncludes.h(20) : fatal error C1083: Cannot open include file: ‘Px.h’: No such file or directory

I have looked at the properties and added the physx SDK lib and include directory already.

What have I overlooked?


What version of visual studio are you using and what version of PhysX SDK. Also have you read the NVIDIA PhysX SDK Documentation for installation instructions.

EDIT: Did you follow this guide by Rama,_Integrating_PhysX_Code_into_Your_Project

Hello. I’m trying to use the PhysX libraries and am running into the same issues. I use VS 2015 and I believe that I have PhysX version 3.3, but I don’t have the Source files.

Are these Source files only available from GitHub? The link to the files from the tutorials doesn’t seem to work for me, so I put in a request at this NVIDIA site, but so far I haven’t heard anything back. I didn’t have a GitHub account prior to the request, so I quickly made one before submitting the request. It’s been half a day, but is it supposed to take this long, or was there a step that I might have missed?

Thanks in advance. Here’s an image just to show what I have.


EDIT: I apparently didn’t associate my new GitHub account with my Unreal profile. I did that just recently - let’s see if that gets me anywhere closer.

I took a look at Rama’s tutorial and interestingly, all I have in \4.10\Engine\Source\ThirdParty\PhysX\PhysX-3.3 is “include” and “lib”. No “source”.

Does it means my install is broken? The tutorial also refers to git… should I clone the git directory and just copy the missing “source” directory to build physx like in the tutorial?

I am going to try this anyway, but confirmation would be helpful for my motivation…


Update : cloned the repository and loaded PhysX.sln

Build fail. The target lib is where it is supposed to be… Any suggestion?

I checked the linker input in the project properties and nvToolsExt32_1.lib is mentionned in the additional dependencies.

Severity	Code	Description	Project	File	Line
Error	LNK1181	cannot open input file './../../../externals/nvToolsExt/1/lib/Win32/nvToolsExt32_1.lib'	

Make sure you followed these steps carefully:

  1. Get the full engine source from GitHub (there is a tutorial on UE4’s official documentation) either in a .zip or using a pull request.
  2. Compile that build - and follow the steps on the documentation about making it default,etc
  3. Run the build and open your project
  4. Include PhysX libs in
  5. Include the proper classes (#include) in the class in question

I think these are the steps, I’m not at home currently. Did you follow these steps carefully? Again, they are on the documentation somewhere.

Instructions I am following :

Downloaded the source as a zip per the instructions.

Double clicked on GenerateProjectFiles.bat

Setting up Unreal Engine 4 project files...

GenerateProjectFiles ERROR: It looks like you're missing some files that are req
uired in order to generate projects.  Please check that you've downloaded and un
packed the engine source code, binaries, content and third-party dependencies be
fore running this script.

The instructions does not mention other stuffs to download aside from the sources. Any suggestion?

Edit : looked if there was any “required files” as in other older tutorials, but found nothing related.

ok, found why GenerateProjectFiles was not working : in the manual pages add

  1. run Setup.bat (and place the directory in a path that is not too long or it will start throwing errors too… )

  2. Inside the root directory, run GenerateProjectFiles.bat to set-up your project files.

Summary :
I built Unreal Engine from source with VS2015.
I built Physx3.3 from source with VS2015.

Yet when I compile, I get the same fatal error than in the original question.

edit : Px.h is located in \UnrealEngine-release\Engine\Source\ThirdParty\PhysX\PhysX-3.3\include\foundation

Tried adding the include directory from Physx in the project properties C++ directory, to no avail. I don’t know what to do now…

Hey guys. Hope your having a good Holiday so far!

Thanks to Horus and aws357, I found out what I needed to do while working through the instructions. All I needed to do to get the #include “PhysXIncludes.h” to work was to modify the MyProject.Build.cs file like shown in the image below. That was a step included in Rama’s tutorial, but I still ended up downloading and compiling the source code for UE4 which I’m not sure if I needed to do. Before taking the plunge to download the source, you can try to see if this simple step is all you need.


Glad you sorted it out mate!

Have fun and let us know how you’re doing (WIP thread) :slight_smile:

Thanks Akiro. That did the trick ! Glad I was helpful, but you solved the problem. :slight_smile:

Thanks akiro. Simple solution that works. :slight_smile:

So simple? I’d never noticed there are some C# files :smiley: Well I copied all required headers to Engine\Source\Runtime\Engine\Public so I guess I won’t be needing that for a while :smiley: at least not until next update as I’m running 4.10 and there is 4.11 preview 6 already. But to my defense - who would want to read some manuals at 5AM? Akiro, thanks for saving me(us) from future copy/pasting header files :slight_smile:

I was able to follow along with the thread, and also realized that I could add “PhysX”, “APEX” to my Build.cs. After that, though, I’m running into “unresolved external symbol” for ‘UPhysicsSerializer::SerializePhysics’ and ‘UPhysicsSerializer::CreatePhysicsData’ functions. For some unknown reason, I can’t figure this one out.

I’m working on making some changes to UInstancedStatisMeshComponent, which calls those two functions. Even though I’ve added PhysX to the build, and all of the includes don’t give errors (included the same .h UISMC uses), I can’t seem to get this unresolved external symbol to go away.

My understanding is that the most likely cause is the Definition for those functions isn’t linking for some reason, but I don’t really know why. It all seems to be under the “Engine” module, so I can’t think of why this is happening. Especially since I’m using the same function (only needed it to not be private) and includes. Every line should be exactly the same character for character.

Any thoughts?

Thanks, akiro, i vasted half day before found your solution:)