I also work on windows with visual .net c++.
I have attached to the mail the settings of my project.

Check if you have the same.


2007/5/22, David _ <[EMAIL PROTECTED]>:

 Hi Chris, thx for answering, but the file path is ok. I put the file in
the root folder before posting here to make sure the path was ok and still
happens the same

i´ve made a win32 console aplication, included the precompiled head files
and libs and trying to do this simple example



// Create a Producer-based viewer

osgProducer::Viewer viewer;

viewer.setUpViewer (osgProducer::Viewer::STANDARD_SETTINGS);

// Load the model

std::string rp =
"C:\\cow.osg";

//osg::ref_ptr<osg::Node> loadedModel = osgDB::readNodeFile(rp);

osg::ref_ptr<osg::Node> loadedModel = osgDB::readNodeFile(
"c:/cow.osg");

//osg::ref_ptr<osg::Node> loadedModel = osgDB::readNodeFile(argv[1]);

if (!loadedModel)

{

std::cerr <<
"Problem opening '" << argv[1] << "'\n";

exit (1);

}



viewer.setSceneData (loadedModel.get());

// Enter rendering loop

viewer.realize();

while (!viewer.done())

{

// Wait for all cull and draw threads to complete.

viewer.sync();

// Update the scene by traversing it with the the update visitor which

// will call all node update callbacks and animations.

viewer.update();

// Fire off the cull and draw traversals of the scene.

viewer.frame();

}

// Wait for all cull and draw threads to complete before exit.

viewer.sync();

return 0;


i´ve tried several ways in order to check that the path is ok
("c:\\cow.osg". "c:/cow.osg", etc);, i don´t think that´s the problem, maybe
i´m doing something wrong with the visual .net and not setting an option
like it should




------------------------------
From:  *"christophe loustaunau" <[EMAIL PROTECTED]>*
Reply-To:  *osg users <[email protected]>*
To:  *"osg users" <[email protected]>*
Subject:  *Re: [osg-users] exception fault with readnodefile*
Date:  *Tue, 22 May 2007 15:12:08 +0200*

Hi david,

 There is no error with :

 osg::ref_ptr<osg::Node> loadedModel = osgDB::readNodeFile("cow.osg");

 but make sure you give the good location for cow.osg.
 I mean :
 osg::ref_ptr<osg::Node> loadedModel = osgDB::readNodeFile(""C:/...../
cow.osg");

Hope this help.

 Christophe.


 2007/5/22, David _ <[EMAIL PROTECTED]>:

> Hi
>
> i´m using 1.2 osg version and trying to load a model from disk under
> windows
> visual .net c++
>
> this line is causing exception fault
>
> osg::ref_ptr<osg::Node> loadedModel = osgDB::readNodeFile("cow.osg");
>
> i´m receiving this message
> -- --Excepción not controlled in 0x7c81eb33 en pruebaosg.exe
> : Exception of
> Microsoft C++:std::bad_alloc in memory position 0x0012f378.. -----
>
> it´s translated from spanish so maybe is not exactly the same message
> you
> should receive in an english enviroment
>
> thx and sorry for my english
>
>
> _________________________________________________________________
> Horóscopo, tarot, numerología... Escucha lo que te dicen los astros.
> http://astrocentro.msn.es/
>
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://openscenegraph.net/mailman/listinfo/osg-users
> http://www.openscenegraph.org/
>


>_______________________________________________
>osg-users mailing list
>[email protected]
>http://openscenegraph.net/mailman/listinfo/osg-users
>http://www.openscenegraph.org/


------------------------------
Éxitos, grandes clásicos y novedades. Un millón de canciones en MSN Music.
<http://g.msn.com/8HMBESES/2755??PS=47575>
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Attachment: project osg .doc
Description: MS-Word document

_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to