Hi,
can you help me with tankSwitch->setSingleChildOn(0,0); function, i cannot 
build it:


Code:
int main()
{
        // Declare a group for the root of our tree and three groups to contain 
individual tank models
        osg::Group* root = new osg::Group();
        osg::Group* tankOneGroup = NULL;

        // Load the models from the same file
        tankOneGroup = dynamic_cast<osg::Group*> 
(osgDB::readNodeFile("t72-tank_des.flt"));

        // add the first tank as a child of the root node
        root->addChild(tankOneGroup);
        
        // Declare an instance of 'findNodeVisitor' class and set its 
searchForName string equal to "sw1"
    findNodeVisitor findNode("sw1");
        // Initiate traversal of this findNodeVisitor instance starting
        // from tankTwoGroup, searching all its children. Build a list of nodes 
whose names matched the searchForName string above.
    tankOneGroup->accept(findNode);
        // Declare a switch type and assign it to the first node in our list of 
matching nodes.
    osgSim::MultiSwitch* tankSwitch = NULL; 
    tankSwitch = dynamic_cast <osgSim::MultiSwitch*> (findNode.getFirst());
        // make sure it's a valid handle. If it is, set the first (only) 
multi-switch: assuming a single switch set 
        // with values {1, 0}, activeSwitchSet 0
        if (tankSwitch)
    {
                int nc=0;
                nc=tankSwitch->getNumChildren();
                tankSwitch->setSingleChildOn(0,0);      // good model
                //tankSwitch->setSingleChildOn(0,1);            // bad model
        }
        osgViewer::Viewer viewer;
        viewer.setSceneData( root );
        viewer.realize();
        return viewer.run();
}


 
output text:
main.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) 
public: bool __thiscall osgSim::MultiSwitch::setSingleChildOn(unsigned 
int,unsigned int)" (__imp_?setsinglechil...@multiswitch@osgSim@@qae_...@z)
1>D:\programovani\vc\osg\osgtest\Debug\osgtest.exe : fatal error LNK1120: 1 
unresolved externals

Where is the problem? 
I can build it when the function is behind "//"
//tankSwitch->setSingleChildOn(0,0);    // good model


OpenSceneGraph Library 2.8.2
Microsoft visual studio 2008 9.0.2 ...8RTM
NetFramework 3.5 SP1

Thank you!

Cheers,
petr

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=28941#28941





_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to