Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[physx] Include error when compiling #40522

Open
TokyoSU opened this issue Aug 18, 2024 · 6 comments
Open

[physx] Include error when compiling #40522

TokyoSU opened this issue Aug 18, 2024 · 6 comments
Assignees
Labels
category:question This issue is a question

Comments

@TokyoSU
Copy link

TokyoSU commented Aug 18, 2024

Describe the bug
When trying to compile a VS2022 project, it throw an error saying include is missing, after some investication, it seem like physx don't include physx/ at the start of the these include: #include "foundation/something.h" so to fix, i need to have a full path to include/physx added in "c/c++ additionals include directory".
that's not the optimal way since it need the username in the path.

Environment

  • OS: Windows
  • Compiler: Visual studio 2022 Community Edition

To Reproduce
Steps to reproduce the behavior:

  1. vcpkg install physx:x86/64-windows
  2. #include <physx/PxPhysicsAPI.h>
  3. compile and see the error.

Expected behavior

Compiling without adding a full include path to physx.
vcpkg should include a path to include\physx.

Failure logs
None.

Additional context
None.

@JonLiu1993 JonLiu1993 self-assigned this Aug 19, 2024
@JonLiu1993 JonLiu1993 added the category:port-bug The issue is with a library, which is something the port should already support label Aug 19, 2024
@JonLiu1993
Copy link
Member

JonLiu1993 commented Aug 19, 2024

This is not a bug, you just need to #include <PxPhysicsAPI.h>.

get_filename_component(OMNIVERSE-PHYSX-SDK_INCLUDE_DIRS "${z_vcpkg_omniverse_physx_sdk_prefix}/include/physx" ABSOLUTE)

INTERFACE_INCLUDE_DIRECTORIES "${OMNIVERSE-PHYSX-SDK_INCLUDE_DIRS}"

@JonLiu1993 JonLiu1993 added category:question This issue is a question and removed category:port-bug The issue is with a library, which is something the port should already support labels Aug 20, 2024
@TokyoSU
Copy link
Author

TokyoSU commented Aug 25, 2024

Sorry but "To Reproduce" do #include <PxPhysicsAPI.h> and cause that issue.
Take in account i don't use a cmake project but Visual studio with vcpkg integration.

@JonLiu1993
Copy link
Member

@TokyoSU, Because of the configuration relationship between cmake project and MSbuild mode, when you reference header files in cmake project mode, you can only reference the "${z_vcpkg_omniverse_physx_sdk_prefix}/include/physx" layer, that is, #include <PxPhysicsAPI.h>.
When you reference header files in MSbuild mode, you can only apply to the ${VCPKG_ROOT_DIR}\installed\${TRIPLET}\include layer, that is, #include <physx/PxPhysicsAPI.h>. This is not a port bug, but a normal usage difference.

@dg0yt
Copy link
Contributor

dg0yt commented Aug 27, 2024

Many packages put headers into subdirs of include, and they export the location via CMake or pkg-config. That's fine.
msbuild is unable to use this exported information, and vcpkg doesn't change that so far. You must manually add the extra include dirs for such packages to the search path.

that is, #include <physx/PxPhysicsAPI.h>

If the package expects to be used with #include <PxPhysicsAPI.h>, then prefer to adjust the search path. Transitive #include <...> may assume that the search path is set correctly.

Copy link

This is an automated message. Per our repo policy, stale issues get closed if there has been no activity in the past 28 days. The issue will be automatically closed in 14 days. If you wish to keep this issue open, please add a new comment.

@github-actions github-actions bot added the Stale label Sep 26, 2024
@Sean-Slevin
Copy link

I've encountered the same issue.
The issue is that using visual studio after including PxPhysicsAPI.h as mentioned
#include <physx/PxPhysicsAPI.h>

This header then includes PxExtensionsAPI.h
#include "extensions/PxExtensionsAPI.h"

Which then includes PxCustomGeometryExt.h
#include "extensions/PxCustomGeometryExt.h"

Which then has 2 include statements that fail
#include <geometry/PxCustomGeometry.h>
#include <geometry/PxGjkQuery.h>

error C1083: Cannot open include file: 'geometry/PxCustomGeometry.h': No such file or directory

It seems the issue has been reported on the physx repo: NVIDIA-Omniverse/PhysX#285

I'm not sure if this is something vcpkg can solve but as is this package cannot be used with msbuild unless you
add include\physx to your include path.

@github-actions github-actions bot removed the Stale label Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:question This issue is a question
Projects
None yet
Development

No branches or pull requests

4 participants