Torbjorn Hakansson (tha++at++cresita.se)
Tue, 06 Apr 1999 15:55:39 +0200
I wonder if I cant gert some help with a linker problem ?
I use pfNode *model1 = pfdLoadFile_flt( "robot.flt" );
to load my Multigen model.
Then I get this errors - I dont know what is wrong !!
ld: ERROR 33: Unresolved text symbol "pfdConverterAttr_flt" -- 1st
referenced by robot.o.
ld: ERROR 33: Unresolved text symbol "pfdLoadFile_flt" -- 1st referenced
by robot.o.
In my pfmakedefs I have Included following row
DSOLINKS = \
-L$(PFROOT)/usr/lib$(LIBBITSUF) \
-L$/usr/local/MultiGen/Performer_Loader/2.0.2/lib \
-L$(PFROOT)/usr/lib$(LIBBITSUF)/libpfdb \
-L$(PFROOT)/lib$(LIBBITSUF)
The file I think is needed is in following directory !
/usr/local/MultiGen/Performer_Loader/2.0.2/lib/libpfflt_ogl.so.2
Pleese , are there anybody how know the solution on this problem !
-------------------------------------------
Torbjörn Håkansson
tha++at++cresita.se
Cresita Development
SWEDEN
---------------------------------------------
The code : Robot.C
#include <stdio.h>
#include <math.h>
#include <Performer/pfdu.h>
#include <Performer/pf.h>
#include <Performer/pfdb/pfflt.h>
#include <Performer/pf/pfChannel.h>
#include <Performer/pf/pfEarthSky.h>
#include <Performer/pf/pfScene.h>
#include <Performer/pf/pfDCS.h>
#include <Performer/pf/pfLightSource.h>
#define DOF_MAX 20
struct remember_all
{
pfDCS* dcs;
DOFcb* dof;
COMMENTcb* comments;
} DOF_data [ DOF_MAX ];
void myCallBack
( pfNode* node, int mgOp, int* cbs, COMMENTcb* cbcom, void* userData )
{
switch ( mgOp )
{
case CB_DOF:
{
DOFcb* dofData = ( DOFcb* ) cbs;
pfDCS* dcsNode = ( pfDCS* ) node;
int which;
//OpenFlight loader already initialized DCS matrix.
//Remember DCS node and DOF data for later updates.
for ( which = 0 ; which < DOF_MAX ; which ++ )
{
if ( ! DOF_data [ which ].dcs )
{
DOF_data [ which ].dcs = dcsNode;
DOF_data [ which ].dof = dofData;
DOF_data [ which ].comments = cbcom;
break;
}
}
}
break;
//case CB_CLEANNODE: *cbs = cleanOK ? TRUE : FALSE; break;
//Free memory for data we're not interested in.
default:
{
if ( cbs ) pfFree( cbs );
if ( cbcom )
{
pfFree( cbcom->text );
pfFree( cbcom );
}
}
break;
}
}
int
main(int argc, char *argv[])
{
fltRegisterNodeT pFunc = myCallBack;
void* hFunc = & pFunc;
pfCoord view;
float z ;
pfSphere sphere;
pfSphere bsphere;
pfDCS *d1, *d2, *d3, *d4; // dynamiska kordinat system
pfInit();
// Load all loader DSO's before pfConfig() forks
//pfdInitConverter_flt(robot.flt);
pfConfig(); // Configure
pfFilePath(".");
//pfMultiprocess(PFMP_DEFAULT); // Single thread for simplicity
/* NOTE: do not attempt "& myCallback" here !!!
* the C language will ignore the "&".
*/
pfdConverterAttr_flt ( PFFLT_REGISTER_NODE, hFunc );
pfNode *model1 = pfdLoadFile_flt( "robot.flt" );
// scale models to unit size
pfDCS *root = new pfDCS;
root->addChild(model1);
model1->getBound(&sphere);
if (sphere.radius > 0.0f)
root->setScale(2.0f/sphere.radius);
// Hämta pekare till DOF noderna i FLT-DB
d1 = (pfDCS*)root->find("d1",pfDCS::getClassType() );
if(d1==NULL){printf("hitta inte d1");}
d2 = (pfDCS*)root->find("d2",pfDCS::getClassType() );
if(d2==NULL){printf("hitta inte d2");}
d3 = (pfDCS*)root->find("d3",pfDCS::getClassType() );
if(d3==NULL){printf("hitta inte d3");}
d4 = (pfDCS*)root->find("d4",pfDCS::getClassType() );
if(d4==NULL){printf("hitta inte d4");}
// Create the hierarchy
pfScene *scene = new pfScene;
scene->addChild(root);
scene->addChild(new pfLightSource);
// Configure and open GL window
pfPipe *pipe = pfGetPipe(0);
pfPipeWindow *pw = new pfPipeWindow(pipe);
pw->setWinType(PFPWIN_TYPE_X);
pw->setName("En Tänkt tre-axlig robot");
pw->setOriginSize(50, 50, 950, 950);
pw->open();
// Create and configure a pfChannel.
pfChannel *chan = new pfChannel(pipe);
chan->setScene(scene);
pfEarthSky *esky = new pfEarthSky();
esky->setMode(PFES_BUFFER_CLEAR, PFES_SKY_GRND);
esky->setAttr(PFES_GRND_HT, -1.0f * sphere.radius);
esky->setColor(PFES_GRND_FAR, 0.3f, 0.1f, 0.0f, 1.0f);
esky->setColor(PFES_GRND_NEAR, 0.5f, 0.3f, 0.1f, 1.0f);
chan->setESky(esky);
view.xyz.set(-6.0f, -5.0f, 1.0f);
view.hpr.set(-60.0f, -5.0f, 0.0f);
// sätt kameran på den pos enl view kordinaten
chan->setView(view.xyz, view.hpr);
// positionera root:en i DB
root->setRot(90, 0, 0);
root->setTrans(-1, 0, 0);
d2->setTrans(0, 0 , 0.0f);
d3->setTrans(0, 0 , 0.0f);
// vrid v_del:en 135 grader genom att rotera DOF d1
for (z = 0.0f; z < 155; z += 0.40f)
{
d1->setRot(1.0f*z, 0.0f *z , 0.0f * z);
pfFrame();
}
// sväng ner underarm 45 grader DOF d2
// borde svänga kring y-axel
for (z = 0.0f; z < 55.0f; z += 0.20f)
{
d2->setRot(0.0f*z, 0.0f *z , 1.0f * z);
pfFrame();
}
// sväng ner överarm 45 grader DOF d3
// borde svänga kring y-axel
for (z = 0.0f; z < 45.0f; z += 0.20f)
{
d3->setRot(0.0f*z, 0.0f *z , 1.0f * z);
pfFrame();
}
sleep(3);
pfExit();
return 0;
}
End robot.C
This archive was generated by hypermail 2.0b2 on Tue Apr 06 1999 - 06:57:00 PDT