ashconnell / physx-js

PhysX for JavaScript
102 stars 11 forks source link

Compilation errors #16

Open diarmidmackenzie opened 1 year ago

diarmidmackenzie commented 1 year ago

I'm using this code to build PhysX, and hitting a couple of errors during the make stage that prevent the build from completing.

First error was this:

/src/PhysX/physx/source/physx/src/NpBatchQuery.cpp:369:33: error: variable 'hitsSpaceLeft' is uninitialized when passed as a const reference argument here [-Werror,-Wuninitialized-const-reference]
        PxU32 hitsSpaceLeft; PX_UNUSED(hitsSpaceLeft);
                                       ^~~~~~~~~~~~~
1 error generated.

I was able to workaround by adjusting the line in NpBatchQuery.cpp to initialize histSpaceLeft like this

        PxU32 hitsSpaceLeft = 0; PX_UNUSED(hitsSpaceLeft);

That resolved that error, but then I hit another error.

/src/PhysX/physx/source/physxextensions/src/ExtSharedQueueEntryPool.h:104:33: error: ISO C++ requires the name after '::~' to be found in the same scope as the name before '::~' [-Werror,-Wdtor-name]
Ext::SharedQueueEntryPool<Alloc>::~SharedQueueEntryPool()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
                                ::SharedQueueEntryPool
1 error generated.

The PhysX code I am building is from this repo: https://github.com/diarmidmackenzie/PhysX-1/tree/joint-projection

Which has just one change vs. this: https://github.com/zach-capalbo/PhysX

Which has only a few changes vs. this: https://github.com/ashconnell/PhysX

None of these changes seem in any way related to the errors above. It seems odd to be hitting compiler errors in core PhysX code that I've not touched at all. Could my build somehow be running with different compiler, or different compiler flags vs. what other people have run?

I am running in a WSL2 VM on Windows, with Docker Desktop. My understanding was that the build environment should be entirely contained inside the docker container, so shouldn't be affected by the underlying OS it's running on.

Next step, I'm going to try a clean check-out of https://github.com/ashconnell/physx-js and https://github.com/ashconnell/PhysX and see if I get any better results...

diarmidmackenzie commented 1 year ago

I a completely clean check-out of everything, and this time I used this PhysX: https://github.com/prestomation/PhysX/tree/emscripten_wip

Hit exactly the same compiler error:

[ 72%] Building CXX object sdk_source_bin/CMakeFiles/PhysX.dir/src/PhysX/physx/source/physx/src/NpBatchQuery.cpp.o
/src/PhysX/physx/source/physx/src/NpBatchQuery.cpp:369:33: error: variable 'hitsSpaceLeft' is uninitialized when passed as a const reference argument here [-Werror,-Wuninitialized-const-reference]
        PxU32 hitsSpaceLeft; PX_UNUSED(hitsSpaceLeft);
                                       ^~~~~~~~~~~~~
1 error generated.