EmbarkStudios / physx-rs

🎳 Rust binding for NVIDIA PhysX 🦀
http://embark.rs
Apache License 2.0
656 stars 42 forks source link

Build error after updating ubuntu #200

Closed mlp1802 closed 1 year ago

mlp1802 commented 1 year ago

After upgrading ubuntu to 22 I get this error: physx-sys-0.4.16/PhysX/pxshared/include/foundation/PxPreprocessor.h:35:10: fatal error: 'ciso646' file not found

I'm using physx 4.2. It seems that this file is not included in the new c++ compiler (or something). Is there no way around it?

mlp1802 commented 1 year ago

UPDATE I cloned the project and tried to build it, same error. I'm not sure it can be build on newest ubuntu anymore.

mlp1802 commented 1 year ago

Installing g++-11 and running export CXX=g++-11 fixed it

mlp1802 commented 1 year ago

Can this be moved to somewhere else? would be nice having it up so someone else might see it, so I'm not closing the issue.

tgolsson commented 1 year ago

I'm going to guess export CXX=g++-11 isn't the important part; rather that installing g++-11 also installed libstdc++ which you were missing.

mlp1802 commented 1 year ago

I have that library but I'm unsure of what the problem actually is. I've read that the ciso646 header is unavailable in c++ greater than 17...I've literally installed all versions of clang and g++ now, and I could only find this header in include/c++/9 or 11..I'll have to double check when I get - home, also I'm a c++ novice, I'm not familiar with the eco system so it's possible that I messed something up along the way. All I know is I upgraded to Ubuntu 22 and the build broke..so it might happen to others as well

mlp1802 commented 1 year ago

I resolved it somehow but I'm not sure how, after 12 hours of installing packages and compilers it suddenly worked.

numfin commented 1 year ago

@tgolsson @mlp1802 solution for me was: sudo apt install libc++-11-dev export CXX=g++-11