I am trying LTE engine and ODE.
Before anything : I have updated my local copy of the pspsdk source code with a "svn update", than ran psptoolchain to update the installation. I than compiled ODE lib, and installed the headers in /usr/local/pspdev/psp/include, and the libode.a in /usr/local/pspdev/psp/lib.
This done, I started with a sample (06.2DGraphics) provided with the LTE source code. I added my own ODE code. Now I am getting the following errors (undifined refs to sqrtf, sinf, and various math.h function) when compiling, dispite the fact I have the right link options (-lode -lm) ... I don't get it. Note that the sample compiled and ran fine before I use ODE. Did someone already have such messages or have any idea of what the problem is.
Code: Select all
regis@Voyager [04-09-09 18:58:28] ~/Desktop/pspdev/lte-slim-beta-48/LTE/examples/06.2DGraphics $ make clean all
rm -f 2DGraphics.prx 2DGraphics.elf main.o PARAM.SFO EBOOT.PBP EBOOT.PBP
psp-g++ -I../../include/ -I. -I/usr/local/pspdev/psp/sdk/include -G0 -O2 -I../../include/ -I. -I/usr/local/pspdev/psp/sdk/include -G0 -O2 -fno-exceptions -fno-rtti -D_PSP_FW_VERSION=390 -c -o main.o main.cpp
psp-gcc -I../../include/ -I. -I/usr/local/pspdev/psp/sdk/include -G0 -O2 -D_PSP_FW_VERSION=390 -L../../libs -L-L/usr/local/pspdev/psp/lib -L. -L/usr/local/pspdev/psp/sdk/lib -specs=/usr/local/pspdev/psp/sdk/lib/prxspecs -Wl,-q,-T/usr/local/pspdev/psp/sdk/lib/linkfile.prx main.o /usr/local/pspdev/psp/sdk/lib/prxexports.o -lengine -lpspwlan -lglut -lGLU -lGL -lm -lpspvfpu -lstdc++ -lpsppower -lpsprtc -lpspaudio -lode -ldrawstuff -lpspdebug -lpspsdk -lc -lpsputility -lpspuser -lpspkernel -lpspdisplay -lpspge -lpspctrl -lpspdebug -lpspdisplay -lpspge -lpspctrl -lpspsdk -lc -lpspnet -lpspnet_inet -lpspnet_apctl -lpspnet_resolver -lpsputility -lpspuser -lpspkernel -o 2DGraphics.elf
/usr/local/pspdev/lib/gcc/psp/4.3.2/../../../../psp/lib/libode.a(ode.o): In function `dWorldGetAutoDisableAngularThreshold':
ode/src/ode.cpp:1354: undefined reference to `sqrtf'
/usr/local/pspdev/lib/gcc/psp/4.3.2/../../../../psp/lib/libode.a(ode.o): In function `dWorldGetAutoDisableLinearThreshold':
ode/src/ode.cpp:1340: undefined reference to `sqrtf'
/usr/local/pspdev/lib/gcc/psp/4.3.2/../../../../psp/lib/libode.a(ode.o): In function `dBodyGetAutoDisableAngularThreshold':
ode/src/ode.cpp:798: undefined reference to `sqrtf'
/usr/local/pspdev/lib/gcc/psp/4.3.2/../../../../psp/lib/libode.a(ode.o): In function `dBodyGetAutoDisableLinearThreshold':
ode/src/ode.cpp:784: undefined reference to `sqrtf'
/usr/local/pspdev/lib/gcc/psp/4.3.2/../../../../psp/lib/libode.a(util.o): In function `sinc':
ode/src/util.cpp:85: undefined reference to `sinf'
/usr/local/pspdev/lib/gcc/psp/4.3.2/../../../../psp/lib/libode.a(util.o): In function `dxStepBody(dxBody*, float)':
ode/src/util.cpp:127: undefined reference to `sqrtf'
/usr/local/pspdev/lib/gcc/psp/4.3.2/../../../../psp/lib/libode.a(joint.o): In function `amotorComputeEulerAngles':
ode/src/joint.cpp:2348: undefined reference to `atan2f'
ode/src/joint.cpp:2352: undefined reference to `atan2f'
ode/src/joint.cpp:2356: undefined reference to `atan2f'
/usr/local/pspdev/lib/gcc/psp/4.3.2/../../../../psp/lib/libode.a(joint.o): In function `measureHinge2Angle':
ode/src/joint.cpp:1462: undefined reference to `atan2f'
/usr/local/pspdev/lib/gcc/psp/4.3.2/../../../../psp/lib/libode.a(joint.o): In function `dJointSetHinge2Axis2':
ode/src/joint.cpp:1657: undefined reference to `sqrtf'
/usr/local/pspdev/lib/gcc/psp/4.3.2/../../../../psp/lib/libode.a(joint.o): In function `dJointSetHinge2Axis1':
ode/src/joint.cpp:1634: undefined reference to `sqrtf'
/usr/local/pspdev/lib/gcc/psp/4.3.2/../../../../psp/lib/libode.a(joint.o): In function `getHingeAngleFromRelativeQuat':
ode/src/joint.cpp:334: undefined reference to `sqrtf'
ode/src/joint.cpp:337: undefined reference to `atan2f'
ode/src/joint.cpp:337: undefined reference to `atan2f'
/usr/local/pspdev/lib/gcc/psp/4.3.2/../../../../psp/lib/libode.a(joint.o): In function `hinge2GetInfo2':
ode/src/joint.cpp:1532: undefined reference to `sqrtf'
/usr/local/pspdev/lib/gcc/psp/4.3.2/../../../../psp/lib/libode.a(collision_std.o): In function `make_sure_plane_normal_has_unit_length':
ode/src/collision_std.cpp:339: undefined reference to `sqrtf'
/usr/local/pspdev/lib/gcc/psp/4.3.2/../../../../psp/lib/libode.a(collision_std.o): In function `dGeomCCylinderPointDepth':
ode/src/collision_std.cpp:329: undefined reference to `sqrtf'
/usr/local/pspdev/lib/gcc/psp/4.3.2/../../../../psp/lib/libode.a(collision_std.o): In function `dGeomSpherePointDepth':
ode/src/collision_std.cpp:132: undefined reference to `sqrtf'
/usr/local/pspdev/lib/gcc/psp/4.3.2/../../../../psp/lib/libode.a(collision_std.o): In function `ray_sphere_helper':
ode/src/collision_std.cpp:1604: undefined reference to `sqrtf'
/usr/local/pspdev/lib/gcc/psp/4.3.2/../../../../psp/lib/libode.a(collision_std.o):ode/src/collision_std.cpp:1804: more undefined references to `sqrtf' follow
/usr/local/pspdev/lib/gcc/psp/4.3.2/../../../../psp/lib/libode.a(collision_std.o): In function `cullPoints(int, float*, int, int, int*)':
ode/src/collision_std.cpp:666: undefined reference to `atan2f'
/usr/local/pspdev/lib/gcc/psp/4.3.2/../../../../psp/lib/libode.a(collision_std.o): In function `dBoxBox(float const*, float const*, float const*, float const*, float const*, float const*, float*, float*, int*, int, dContactGeom*, int)':
ode/src/collision_std.cpp:805: undefined reference to `sqrtf'
ode/src/collision_std.cpp:806: undefined reference to `sqrtf'
ode/src/collision_std.cpp:807: undefined reference to `sqrtf'
ode/src/collision_std.cpp:810: undefined reference to `sqrtf'
ode/src/collision_std.cpp:811: undefined reference to `sqrtf'
/usr/local/pspdev/lib/gcc/psp/4.3.2/../../../../psp/lib/libode.a(collision_std.o):ode/src/collision_std.cpp:812: more undefined references to `sqrtf' follow
/usr/local/pspdev/lib/gcc/psp/4.3.2/../../../../psp/lib/libode.a(rotation.o): In function `dQFromAxisAndAngle':
ode/src/rotation.cpp:167: undefined reference to `sinf'
ode/src/rotation.cpp:167: undefined reference to `sqrtf'
/usr/local/pspdev/lib/gcc/psp/4.3.2/../../../../psp/lib/libode.a(rotation.o): In function `dRFromEulerAngles':
ode/src/rotation.cpp:72: undefined reference to `sinf'
ode/src/rotation.cpp:74: undefined reference to `sinf'
ode/src/rotation.cpp:76: undefined reference to `sinf'
/usr/local/pspdev/lib/gcc/psp/4.3.2/../../../../psp/lib/libode.a(rotation.o): In function `dRFrom2Axes':
ode/src/rotation.cpp:95: undefined reference to `sqrtf'
ode/src/rotation.cpp:108: undefined reference to `sqrtf'
/usr/local/pspdev/lib/gcc/psp/4.3.2/../../../../psp/lib/libode.a(collision_util.o): In function `dDISTANCE(float const*, float const*)':
include/ode/odemath.h:126: undefined reference to `sqrtf'
/usr/local/pspdev/lib/gcc/psp/4.3.2/../../../../psp/lib/libode.a(OPC_LSSCollider.o):OPCODE/OPC_LSSCollider.cpp:244: undefined reference to `sqrtf'
/usr/local/pspdev/lib/gcc/psp/4.3.2/../../../../psp/lib/libode.a(IcePoint.o): In function `Normalize':
OPCODE/Ice/IcePoint.h:274: undefined reference to `sqrtf'
/usr/local/pspdev/lib/gcc/psp/4.3.2/../../../../psp/lib/libode.a(IcePoint.o):OPCODE/Ice/IcePoint.h:274: more undefined references to `sqrtf' follow
collect2: ld returned 1 exit status
make: *** [2DGraphics.elf] Error 1
regis@Voyager [04-09-09 18:59:46] ~/Desktop/pspdev/lte-slim-beta-48/LTE/examples/06.2DGraphics $
Obiously the "libm.a" is well found by the linker, but it can't found the functions sqrtf and others in it. In ODE source code, I found this, which looks fine to me :
Code: Select all
#define REAL(x) (x ## f) /* form a constant */
#define dRecip(x) ((float)(1.0f/(x))) /* reciprocal */
#define dSqrt(x) ((float)sqrtf(float(x))) /* square root */
#define dRecipSqrt(x) ((float)(1.0f/sqrtf(float(x)))) /* reciprocal square root */
#define dSin(x) ((float)sinf(float(x))) /* sine */
#define dCos(x) ((float)cosf(float(x))) /* cosine */
#define dFabs(x) ((float)fabsf(float(x))) /* absolute value */
#define dAtan2(y,x) ((float)atan2f(float(y),float(x))) /* arc tangent with 2 args */
#define dFMod(a,b) ((float)fmodf(float(a),float(b))) /* modulo */
#define dCopySign(a,b) ((float)copysignf(float(a),float(b)))