Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

Tags in this Discussion

[PhysX 3.2] linking issue on ubuntu 10.04
  • I'm trying to build simple application using physX. I'm using linux 3.2 beta2 version of SDK.
    I have added these libs to my project:

    -lpthread\
    -lLowLevel\
    -lLowLevelCloth\
    -lPhysX3\
    -lPhysX3CharacterKinematic\
    -lPhysX3Common\
    -lPhysX3Cooking\
    -lPhysX3Extensions\
    -lPhysX3Vehicle\
    -lPhysXProfileSDK\
    -lPvdRuntime\
    -lPxTask\
    -lPxTask\
    -lRepXUpgrader3\
    -lSceneQuery\
    -lSimulationController

    But I get this error during compilation:

    /home/vl/src/PhysX-3.2_LINUX_SDK_Core/Lib/linux32/libPhysX3.a(NpPhysics.cpp.o): In function `PxRegisterHeightFields':
    (.text+0x6e3): undefined reference to `physx::PxvRegisterHeightFields()'
    /home/vl/src/PhysX-3.2_LINUX_SDK_Core/Lib/linux32/libPhysX3.a(NpPhysics.cpp.o): In function `PxRegisterPCM':
    (.text+0x753): undefined reference to `physx::PxvRegisterPCM()'
    /home/vl/src/PhysX-3.2_LINUX_SDK_Core/Lib/linux32/libPhysX3.a(NpPhysics.cpp.o): In function `PxRegisterArticulations':
    (.text+0x773): undefined reference to `physx::PxvRegisterArticulations()'
    /home/vl/src/PhysX-3.2_LINUX_SDK_Core/Lib/linux32/libPhysX3.a(NpPhysics.cpp.o): In function `physx::NpPhysics::NpPhysics(physx::PxTolerancesScale const&, bool, physx::PxProfileZoneManager*)':
    (.text+0x1c8d): undefined reference to `physx::Sc::CreatePhysics(physx::PxTolerancesScale const&)'
    /home/vl/src/PhysX-3.2_LINUX_SDK_Core/Lib/linux32/libPhysX3.a(NpPhysics.cpp.o): In function `physx::NpPhysics::createScene(physx::PxSceneDesc const&)':
    (.text+0x21c7): undefined reference to `physx::Sc::Scene::isValid() const'
    /home/vl/src/PhysX-3.2_LINUX_SDK_Core/Lib/linux32/libPhysX3.a(NpPhysics.cpp.o): In function `physx::NpPhysics::~NpPhysics()':
    (.text+0x23b9): undefined reference to `physx::Sc::Physics::release()'
    /home/vl/src/PhysX-3.2_LINUX_SDK_Core/Lib/linux32/libPhysX3.a(NpPhysics.cpp.o): In function `physx::NpPhysics::NpPhysics(physx::PxTolerancesScale const&, bool, physx::PxProfileZoneManager*)':
    (.text+0x269d): undefined reference to `physx::Sc::CreatePhysics(physx::PxTolerancesScale const&)'
    /home/vl/src/PhysX-3.2_LINUX_SDK_Core/Lib/linux32/libPhysX3.a(NpPhysics.cpp.o): In function `physx::NpPhysics::~NpPhysics()':
    (.text+0x2a89): undefined reference to `physx::Sc::Physics::release()'
    /home/vl/src/PhysX-3.2_LINUX_SDK_Core/Lib/linux32/libPhysX3.a(NpPhysics.cpp.o): In function `physx::NpPhysics::~NpPhysics()':
    (.text+0x2c99): undefined reference to `physx::Sc::Physics::release()'
    /home/vl/src/PhysX-3.2_LINUX_SDK_Core/Lib/linux32/libPhysX3.a(NpPhysics.cpp.o): In function `physx::Scb::ArticulationJoint::~ArticulationJoint()':
    (.text._ZN5physx3Scb17ArticulationJointD0Ev[physx::Scb::ArticulationJoint::~ArticulationJoint()]+0x2c): undefined reference to `physx::Sc::ArticulationJointCore::~ArticulationJointCore()'
    /home/vl/src/PhysX-3.2_LINUX_SDK_Core/Lib/linux32/libPhysX3.a(NpPhysics.cpp.o): In function `physx::Scb::ArticulationJoint::~ArticulationJoint()':
    (.text._ZN5physx3Scb17ArticulationJointD1Ev[physx::Scb::ArticulationJoint::~ArticulationJoint()]+0x2c): undefined reference to `physx::Sc::ArticulationJointCore::~ArticulationJointCore()'
    /home/vl/src/PhysX-3.2_LINUX_SDK_Core/Lib/linux32/libPhysX3.a(NpPhysics.cpp.o): In function `physx::NpRigidBodyTemplate<physx::PxRigidDynamic>::getMassSpaceInertiaTensor() const':
    (.text._ZNK5physx19NpRigidBodyTemplateINS_14PxRigidDynamicEE25getMassSpaceInertiaTensorEv[physx::NpRigidBodyTemplate<physx::PxRigidDynamic>::getMassSpaceInertiaTensor() const]+0x11e): undefined reference to `physx::Sc::BodyCore::getInverseInertia() const'
    /home/vl/src/PhysX-3.2_LINUX_SDK_Core/Lib/linux32/libPhysX3.a(NpPhysics.cpp.o): In function `physx::NpRigidBodyTemplate<physx::PxRigidDynamic>::getMass() const':
    (.text._ZNK5physx19NpRigidBodyTemplateINS_14PxRigidDynamicEE7getMassEv[physx::NpRigidBodyTemplate<physx::PxRigidDynamic>::getMass() const]+0x57): undefined reference to `physx::Sc::BodyCore::getInverseMass() const'
    /home/vl/src/PhysX-3.2_LINUX_SDK_Core/Lib/linux32/libPhysX3.a(NpPhysics.cpp.o): In function `physx::Scb::Body::~Body()':
    (.text._ZN5physx3Scb4BodyD1Ev[physx::Scb::Body::~Body()]+0x2c): undefined reference to `physx::Sc::BodyCore::~BodyCore()'
    /home/vl/src/PhysX-3.2_LINUX_SDK_Core/Lib/linux32/libPhysX3.a(NpPhysics.cpp.o): In function `physx::Scb::Body::~Body()':
    (.text._ZN5physx3Scb4BodyD0Ev[physx::Scb::Body::~Body()]+0x2c): undefined reference to `physx::Sc::BodyCore::~BodyCore()'
    /home/vl/src/PhysX-3.2_LINUX_SDK_Core/Lib/linux32/libPhysX3.a(NpPhysics.cpp.o): In function `physx::Scb::Articulation::~Articulation()':
    (.text._ZN5physx3Scb12ArticulationD0Ev[physx::Scb::Articulation::~Articulation()]+0x2c): undefined reference to `physx::Sc::ArticulationCore::~ArticulationCore()'
    /home/vl/src/PhysX-3.2_LINUX_SDK_Core/Lib/linux32/libPhysX3.a(NpPhysics.cpp.o): In function `physx::Scb::Articulation::~Articulation()':
    (.text._ZN5physx3Scb12ArticulationD1Ev[physx::Scb::Articulation::~Articulation()]+0x2c): undefined reference to `physx::Sc::ArticulationCore::~ArticulationCore()'
    /home/vl/src/PhysX-3.2_LINUX_SDK_Core/Lib/linux32/libPhysX3.a(NpPhysics.cpp.o): In function `physx::Scb::Constraint::~Constraint()':
    ....

    Any suggestions would be great
  • 5 Comments sorted by
  • Hi,

    Could you please provide a sample source and makefiles for us to reproduce that error? You could be missing some paths or defines.

    Thanks,
    Sheikh
  • I'm using QT Creator. (But Ive tried code::blocks and got the same) Sample code in tar in attachment
    physxtest.tar.gz
    3K
  • Retucula said:

    I've set same libs and g++ flags, but it doesn't help :(
  • Vote Up0Vote Down Vladimir62
    Posts: 7 Accepted Answer
    I found the solution.
    This error occurs by cross-dependencies between Physx libs.
    I use -Wl flag for that. And project was successfully build ^_^

    Correct libs definition in makefile:

    LIBS += -Wl,--start-group -lrt\
    -lPhysX3Common\
    -lPvdRuntime\
    -lSimulationController\
    -lSceneQuery\
    -lLowLevel\
    -lLowLevelCloth\
    -lPhysX3\
    -lPhysX3Vehicle\
    -lPhysX3Cooking\
    -lPhysX3Extensions\
    -lPhysX3CharacterKinematic\
    -lRepX3\
    -lRepXUpgrader3\
    -lPhysXProfileSDK\
    -lPxTask -Wl,--end-group


    Thx!

    p.s. in linux SDK lib -lXxf86vm is missed in makefile for Samples