NVIDIAGameWorks / PhysX

NVIDIA PhysX SDK
Other
3.21k stars 809 forks source link

Happy with SDK features. But failing to link libraries to my own code in Xcode. [C++/Xcode noob] #300

Open MrMechanical opened 4 years ago

MrMechanical commented 4 years ago

I am a C# user, so I am unfamiliar with libraries and XCode. How do I make it so I can use the PhysX sdk in my own C++ Xcode project? I tried dragging the Physx-4.2/physx/bin/mac.x86_64, Physx-4.2/physx/pxshared, Physx-4.2/physx/include, into my frameworks folder. I used to be a Unity user but I am working on integrating the SDK into my custom C++ engine. The sdk's flexiblity is very impressive so I'm excited to use this physics software. I am doing my best to follow the instructions @ https://github.com/NVIDIAGameWorks/PhysX and the specific mac instruction but Xcode keeps telling me it can't find the Px.h file or other header files.

Thank you so much for the help, I am extremely thankful for any sort of guidance.

MrMechanical commented 4 years ago

Is there any sort of example project folder I can copy the structure from? This might help me to understand what to drag into my frameworks folder in Xcode. I am unfamiliar with the specific settings required for my custom XCode project. Thank you for the help.

AlesBorovicka commented 4 years ago

The snippets are a good example I guess. They do include the PhysX SDK include directory and the required PhysX libs. If you compile the INSTALL project of PhysX SDK, it will create a distribution package in the install folder. There should be the required libraries and includes.

MrMechanical commented 4 years ago

Thank you so much for your help! This made my day. Which install folder should I choose?

Screen Shot 2020-05-25 at 2 04 17 PM Screen Shot 2020-05-25 at 2 04 10 PM

I am an absolute Xcode noob. Will dragging this to the framework folder of my GameEngine do the trick (in terms of locating header files)?

Thanks a lot!

AlesBorovicka commented 4 years ago

The physx install folder should have the physx include files and binaries

The pxshared are just headers, use the include directory from pxshared directly.

MrMechanical commented 4 years ago

Thank you so much for your help! Everything is much less confusing now. I apologize for my inexperience. Is /Users/myname/Documents/PhysX-4.1/pxshared/physx/include the correct search path?

MrMechanical commented 4 years ago

Ok. I figured it out. I can just copy the settings used by PhysXSDK.xcodeproject.