[info-performer] help needed

Date view Thread view Subject view Author view

From: sinan kock (sxkockara++at++gmail.com)
Date: 02/02/2005 12:00:42


I tried one of the sample performer codes which is anim.cpp. I'm using
Visual C 98. I did project settings properly. The code and errors are
below:
___________________________________________________________________

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <Performer/pf/pfChannel.h>
#include <Performer/pf/pfLightSource.h>
#include <Performer/pf/pfDCS.h>
#include <Performer/pf/pfTraverser.h>
#include <Performer/pfdu.h>
#include <pfcave.h>
#include "simpleNavigator.h"

static void createScene(pfChannel *chan,int argc,char **argv);
static pfNode * animatedObject(char *file);
static int moveObject(pfTraverser *trav,void *);

int main(int argc,char **argv)
{
 pfInit();
 simpleNavigator::init();
 pfCAVEConfig(&argc,argv,NULL);
 pfConfig();
 pfCAVEInitChannels();
 if (CAVEConfig->Simulator)
        pfCAVEMasterChan()->getFStats()->setClass(
                        PFSTATS_ALL^PFSTATSHW_ENGFXPIPE_FILL, PFSTATS_ON);
 else
        pfCAVEMasterChan()->getFStats()->setClass(PFSTATS_ALL, PFSTATS_OFF);
 createScene(pfCAVEMasterChan(),argc,argv);
 while (!CAVEgetbutton(CAVE_ESCKEY))
        {
        pfSync();
        pfCAVEPreFrame();
        pfFrame();
        pfCAVEPostFrame();
        }
 CAVEHalt();
 pfExit();
 return 0;
}

/* createScene() - creates the scene.
*/
static void createScene(pfChannel *chan,int argc,char **argv)
{
 pfScene *scene;
 pfGeoState *gstate;
 simpleNavigator *nav;
 scene = new pfScene;
 gstate = new pfGeoState;
 gstate->setMode(PFSTATE_ENLIGHTING, PF_ON);
 gstate->setMode(PFSTATE_CULLFACE, PFCF_OFF);
 scene->setGState(gstate);
 scene->addChild(new pfLightSource);
 nav = new simpleNavigator;
 scene->addChild(nav);
 if (argc > 1)
        nav->addChild(animatedObject(argv[1]));
 if (argc > 2)
        nav->addChild(pfdLoadFile(argv[2]));
 chan->setScene(scene);
}

static pfNode * animatedObject(char *file)
{
 pfNode *obj;
 pfDCS *dcs;
 obj = pfdLoadFile(file);
 if (!obj)
        pfExit();
 dcs = new pfDCS;
 dcs->setTravFuncs(PFTRAV_APP,moveObject,NULL);
 dcs->addChild(obj);
 return dcs;
}

static int moveObject(pfTraverser *trav,void *)
{
#define RADIUS 8.0f
 pfDCS *dcs = (pfDCS *) trav->getNode(); /* Get a pointer
to the DCS node itself */
 float sine,cosine,sine2,cosine2;
 pfSinCos(pfGetTime()*90.0f, &sine, &cosine);
 pfSinCos(pfGetTime()*300.0f, &sine2, &cosine2);
 dcs->setTrans(cosine*RADIUS, sine*RADIUS, 4.0f * sine2 + 4.0f);
 return PFTRAV_CONT;
}

--------------------Configuration: Animation - Win32 Debug--------------------
Linking...
anim.obj : error LNK2001: unresolved external symbol "public: static
void __cdecl simpleNavigator::init(void)"
(?init++at++simpleNavigator++at++++at++SAXXZ)
anim.obj : error LNK2001: unresolved external symbol "public:
__thiscall simpleNavigator::simpleNavigator(void)"
(??0simpleNavigator++at++++at++QAE++at++XZ)
Debug/Animation.exe : fatal error LNK1120: 2 unresolved externals
Error executing link.exe.

Animation.exe - 3 error(s), 0 warning(s)
___________________________________________________________________

How can I get rid of these?
Thanks.


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Wed Feb 02 2005 - 12:00:55 PST