Re: pfdLoadFile Linker problem ?

New Message Reply Date view Thread view Subject view Author view

Guillermo E. Gutierrez (ggutierr++at++harris.com)
Tue, 06 Apr 1999 10:45:04 -0400


Hello Torbjorn,

The loader that gets used is automatically determined from the file
extension. Thus there is no need to specify it explictly. Try:
    pfNode *model1 = pfdLoadFile("robot.flt");

     pfdLoadFile builds in-memory data structures from an external database

     file. The filename's extension is used to determine the file format.
If
     no path to the file is given, the directories in the active Performer
     file search path (see pfFilePath) are scanned for the given filename.
     pfdLoadFile may only be called after pfConfig.

Cheers,
-guillermo

Torbjorn Hakansson wrote:

> Hello all Perf Users
>
> 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
> -----------------------------------------------------------------------
> List Archives, FAQ, FTP: http://www.sgi.com/software/performer/
> Submissions: info-performer++at++sgi.com
> Admin. requests: info-performer-request++at++sgi.com

begin:vcard
n:Gutierrez;Guillermo
tel;fax:407-984-6323
tel;work:407-984-6543
x-mozilla-html:TRUE
org:Harris Corporation;ISD
adr:;;;;;;
version:2.1
email;internet:ggutierr++at++harris.com
title:Software Engineer
x-mozilla-cpt:;-2976
fn:Guillermo Gutierrez
end:vcard


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Tue Apr 06 1999 - 07:43:40 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.