physx-rs: Compile errors when building from source

Describe the bug Compilation fails when attempting to build the project on Windows 10, following the “How to build” instructions in the readme. In the console I get the following messages:

error: could not find native static library `PhysXVehicle_static_64`,` perhaps an -L flag is missing?

error: aborting due to previous error

error: could not compile `physx-sys`.
warning: build failed, waiting for other jobs to finish...
error: attempt to shift right with overflow
   --> physx\src\articulation_reduced_coordinate.rs:494:23
    |
494 |         let (a, b) = ((self.ptr as usize >> 32) as u32, self.ptr as usize as u32);
    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: `#[deny(exceeding_bitshifts)]` on by default

error: aborting due to previous error

error: could not compile `physx`.

To Reproduce Run cargo build --release from the cloned physx-rs directory

Additional context I don’t have any rust experience, and only a small amount of C/C++ experience. I would like to use the physx-sys C API to build a standalone DLL that I can use from C#.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 21 (10 by maintainers)

Most upvoted comments

Now that I am able to generate the wrapper files I can continue work towards creating a C API wrapper dll however due to my lack of experience with C++ it is proving to be out of my depth. I am going to leave this for now and return to it later. I might file a new issue requesting an easier way to generate such a wrapper as it would be of great use to allow PhysX to be used not just from C# but also many other languages that can interface with C. Since the original issues reported here have been resolved I will close this.

The x64 toochain seems to be installed now. Not sure why the installer exe is so misleading. Here is the end part of the opening test when using rustup-init.exe:

Current installation options:


   default host triple: x86_64-pc-windows-msvc
     default toolchain: stable
               profile: default
  modify PATH variable: yes

1) Proceed with installation (default)
2) Customize installation
3) Cancel installation

Then once choosing the first option it says:

info: profile set to 'default'
info: default host triple is i686-pc-windows-msvc
info: syncing channel updates for 'stable-i686-pc-windows-msvc'

On another note the project finally seems to compile now. Thank you all for your time and patience I will see if everything is working now.

I’m on Windows 10 64bit. I don’t know about specifying a target, I only entered the basic compile commands.