Hello Alvaro (?),

this isn't an OSG problem, it is a pure c++ coding problem...
In your header file you declare a class with a public method, but you define a function that is not member of your class in your cpp.
You should define
osg::Camera* Ventana::createCamera(int x, int y, int w, int h)
 instead of
osg::Camera* createCamera(int x, int y, int w, int h)

Furthermore, you don't even instantiate your class Ventana in your main.
In your main you should create an instance of Ventana
Ventana* myInstance = new Ventana();
As you didn't define any constructor it will use a default generated constructor for your class.
After this you can call
viewer->addSlave(myInstance->createCamera(300, 100, 900, 600));
This should make it work.
You should consider review your coding basics...

Regards,

Christian


Le 29/07/2015 13:36, alvaro ginestar rodriguez a écrit :
hi everyone !! i would like make a class and function for make a window in osg, i have this source, but when i tried them separately, it have errors.
The file "DemoVentana.cpp"it does well, but the other one no.




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


-- 
SCHULTE Christian
Ingénieur Recherche
Responsable du Laboratoire de Simulation
ONERA - DCSD/PSEV
Département Commande des Systèmes et Dynamique du Vol
ONERA - Centre de Salon de Provence
BA 701
13661 SALON AIR Cedex - France
Tel :04.90.17.01.45

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

Reply via email to