Re: [osg-users] Snow Leopard stl issues? (osg 2.9.5)

2009-10-07 Thread Chip Collier
Hi again! :)

So it's just a problem with OSG in general it seems. I've tried building and 
linking in many different ways, all end in segfaults when trying to get the 
name of a node. I haven't tried much else because that's a pretty basic first 
step.

The attached code also segfaults on OSX and runs fine on Linux so it's no 
longer a Qt related issue as far as I can tell.

built with the following;
osx: g++ -framework osg -framework osgDB test.cpp -o test
linux: g++ -losg -losgDB test.cpp -o test

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



#include iostream
#include string

using namespace std;

#include osg/Node
#include osg/Group
#include osg/NodeVisitor
#include osgDB/ReadFile

class EnumerateVisitor : public osg::NodeVisitor
{
public:
EnumerateVisitor(){}

virtual ~EnumerateVisitor(){}

virtual void apply(osg::Node node)
{
cout  node.getName()  endl;
traverse(node);
}
};

int main(int argc, char* argv[])
{
int result = 0;

osg::Group *root = 
dynamic_castosg::Group*(osgDB::readNodeFile(argv[1]));

EnumerateVisitor visitor;

root-accept(visitor);

return result;
}
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Snow Leopard stl issues? (osg 2.9.5)

2009-10-07 Thread Ismail Pazarbasi
2009/10/7 Chip Collier pho...@gmail.com:
 Hi again! :)

 So it's just a problem with OSG in general it seems. I've tried building and 
 linking in many different ways, all end in segfaults when trying to get the 
 name of a node. I haven't tried much else because that's a pretty basic first 
 step.

 The attached code also segfaults on OSX and runs fine on Linux so it's no 
 longer a Qt related issue as far as I can tell.

 built with the following;
 osx: g++ -framework osg -framework osgDB test.cpp -o test
 linux: g++ -losg -losgDB test.cpp -o test

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




 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org



Chip,

I have had similar trouble on Windows (and I use Leopard - not Snow
Leopard - at home); it was related to third-party dependencies, which
were compiled with mingw compiler (gcc) but I was using MSVC. On Mac
OS X, I basically compiled every third party library myself and
deleted entire third-party libraries I've fetched before, then removed
fink as well. No offense, but fink people may have forgotten that Macs
have universal binaries (Mach-O) that supports multiple platforms,
not only i386. Just because uname reports so does not mean target
should be _only_ i386. This was related to photo gallery I wanted to
setup on my Mac Pro and it turned out that fink never had 64-bit
binaries (apache2.2 is running as Intel 64 bit and I stood still -
everything else should also support 64-bit rather than simply
compiling apache for 32-bit. That's the right approach, I believe). Of
course, my OSG build also benefit from that; all (3rd party) libraries
are now Mach-O both x86_64 and i386.

Nevertheless, I am not exactly sure that your problem is related to
32-64 bit conflicts, because run-time linker wouldn't load 32-bit-only
libraries, if you compiled for 64-bit (or the other way around). So,
problem may be different (e.g. compiler upgrade and broken ABI?). I
think you should build everything with your current toolchain.

I strongly recommend you to build all third party dependencies
(libjpeg, png, zlib, etc.) with CFLAGS including both Intel platforms;
namely, i386 and x86_64 *with your current toolset* (new Xcode?
gcc45?)

I myself didn't upgrade to Snow Leopard because I've experienced
trouble when I first migrated to Leopard. So, I will wait until
10.6.3-4 and I may buy a copy of Snow Leopard afterwards. My Mac Pro
was my last Apple product, and I will never buy another Apple product
ever again with my free will (unless I have to).

Ismail
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Snow Leopard stl issues? (osg 2.9.5)

2009-10-07 Thread Stephan Huber
Hi,

Chip Collier schrieb:
 Hi again! :)
 
 So it's just a problem with OSG in general it seems. I've tried building and 
 linking in many different ways, all end in segfaults when trying to get the 
 name of a node. I haven't tried much else because that's a pretty basic first 
 step.
 
 The attached code also segfaults on OSX and runs fine on Linux so it's no 
 longer a Qt related issue as far as I can tell.

Can you check if root is NULL in your code? Perhaps you have problems
with symbol visibilty, perhaps gcc 4.2 has some new defaults which
breaks your code. dynamic_cast is done by comparing pointers to
class-definitions, not via string comparision as on windows / visual
studio. Perhaps you have two class definitions one in osgDB and one in
your main.o.

I tested your code on Snow Leopard with 2.9.x compiled with gcc 4.0.x
with the deprecated XCode-projects part of the osg-distribution and the
code worked without any problems. Also my big projects compile + run
fine on Snow Leopard, but I am using gcc 4.0 and I am targeting 10.4. I
haven't tried gcc 4.2 (the new standard compiler on OS X) because it
targets 10.5 and up.

HTH,
Stephan
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Snow Leopard stl issues? (osg 2.9.5)

2009-10-07 Thread Chip Collier
That's awesome to hear!

Big thing for me is that I require the 10.6 SDK for OpenCL support so I'm 
trying to use the toolchain that supports this.

If I grab information from the node other than the name such as the className 
I'll get a classname for each node in the scene.

If I just do nothing to query modify the scene I can view everything without a 
problem which is why this is so vexing. The segfault occurs someplace in 
basic_str. 

I'll try your suggestions and see what comes of it.

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





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Snow Leopard stl issues? (osg 2.9.5)

2009-10-07 Thread Chip Collier
Hi,
Ok well, I built the latest OpenSceneGraph from the svn repo with cmake (so no 
frameworks just dylibs) and it works fine. :) I did have to modify a couple of 
files to get it to build though:

In the osgdb_lwo plugin the ID4 struct needed it's array renamed from id to ID 
to avoid a keyword clash (I guess id is a reserved word in ObjC in 10.6). I had 
to the modify any use of that struct with this update.

In the osgdb_imageio plugin on line 979 of ReaderWriterImageIO.cpp the 
constructure was: ReaderWriterImageIO::ReaderWriterImageIO() which needed to 
simply be: ReaderWriterImageIO()

And I had to modify the plugins CMakeLists file to exclude building osgdb_qt.

After that everything built fine and once I linked with that build I was golden.

Thanks!

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





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Snow Leopard stl issues? (osg 2.9.5)

2009-10-05 Thread Chip Collier
So I built this as 32-bit on snow leopard and I still get a segfault when 
attempting to get a node name from an osg::Node. 

Any other ideas? :)

Thanks for the help!

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





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Snow Leopard stl issues? (osg 2.9.5)

2009-10-02 Thread Chip Collier
Hi,

I'm working on a project and targeting linux and OSX. It's a Qt based 
application and I have my builds in order more or less using qmake and so on, 
but on OSX I get segfaults anytime I access certain properties of a node. The 
easiest example is to just make a node visitor that prints out the name (cout 
 node.getName()  endl) of it's nodes and I'll get the segfault on the first 
trip to apply(). Running it through the debugger shows that the fault happens 
somewhere in std::string, and trying to investigate the contents of the node 
the debugger is just showing me 0x0 for the contents of the name for instance.

Could someone enlighten me as to what would cause this. On Linux I have no 
troubles at all (also using 2.9.5). I know snow leopard isn't really an 
official target yet but I have built the frameworks and plugins without a 
problem so far in a variety of different ways as well: I've used the 10.5 sdk, 
the 10.6 sdk, used gcc 4.2 as well as 4.0. I'd love to hear some ideas because 
I don't know what's happening. I can load models and add manipulators and do 
all sorts of the example-y things but as soon as I try to report what's in the 
scene I'm out of luck. :)

Thank you!

Cheers,
Chip

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





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Snow Leopard stl issues? (osg 2.9.5)

2009-10-02 Thread FlySky





在2009-10-03,Chip Collier pho...@gmail.com 写道:
Hi,

I'm working on a project and targeting linux and OSX. It's a Qt based 
application and I have my builds in order more or less using qmake and so on, 
but on OSX I get segfaults anytime I access certain properties of a node. The 
easiest example is to just make a node visitor that prints out the name (cout 
 node.getName()  endl) of it's nodes and I'll get the segfault on the 
first trip to apply(). Running it through the debugger shows that the fault 
happens somewhere in std::string, and trying to investigate the contents of 
the node the debugger is just showing me 0x0 for the contents of the name for 
instance.

Could someone enlighten me as to what would cause this. On Linux I have no 
troubles at all (also using 2.9.5). I know snow leopard isn't really an 
official target yet but I have built the frameworks and plugins without a 
problem so far in a variety of different ways as well: I've used the 10.5 sdk, 
the 10.6 sdk, used gcc 4.2 as well as 4.0. I'd love to hear some ideas because 
I don't know what's happening. I can load models and add manipulators and do 
all sorts of the example-y things but as soon as I try to report what's in the 
scene I'm out of luck. :)

Thank you!

Cheers,
Chip

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





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Snow Leopard stl issues? (osg 2.9.5)

2009-10-02 Thread Butler, Lee Mr CIV USA USAMC
I'm going to *guess* that this is another 32/64bit issue.  With Snow Leopard 
the tool chain switched to creating 64bit executables by default.  Qt is still 
32bit on the Mac.  For starters, make sure the following is in your .pro file:

CONFIG += x86

Make sure you are compiling/linking everything 32bit (osg, your code, 
libraries, etc.).

Lee

- Original Message -
From: FlySky zz...@163.com
Date: Friday, October 2, 2009 14:03
Subject: Re: [osg-users] Snow Leopard stl issues? (osg 2.9.5)
To: osg-users osg-users@lists.openscenegraph.org


 
 
 
 
 
 在2009-10-03,Chip Collier  写道:
 Hi,
 
 I'm working on a project and targeting linux and OSX. It's a Qt based 
 application and I have my builds in order more or less using 
 qmake and so on, but on OSX I get segfaults anytime I access 
 certain properties of a node. The easiest example is to just make a 
 node visitor that prints out the name (cout 
 Could someone enlighten me as to what would cause this. On Linux I have no 
 troubles at all (also using 2.9.5). I know snow leopard isn't really an 
 official target yet but I have built the frameworks and plugins without a 
 problem so far in a variety of different ways as well: I've used the 10.5 
 sdk, the 10.6 sdk, used gcc 4.2 as well as 4.0. I'd love to hear some ideas 
 because I don't know what's happening. I can load models and add 
 manipulators and do all sorts of the example-y things but as soon as I try 
 to report what's in the scene I'm out of luck. :)
 
 Thank you!
 
 Cheers,
 Chip
 
 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=17808#17808
 
 
 
 
 
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-
 openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Snow Leopard stl issues? (osg 2.9.5)

2009-10-02 Thread Chip Collier
The latest Qt is 64-bit on mac now and I configured it with cocoa. I'm using 
the latest build from git as well after I first had troubles with the pre-built 
Qt4.5 (the cocoa version, not the carbon version)... which also has a couple of 
issues with snow leopard in general though.

Here is the output from 'file' on the Core and Gui libraries:
/usr/local/Trolltech/Qt-4.7.0/lib/QtCore.framework/QtCore: Mach-O 64-bit 
dynamically linked shared library x86_64
/usr/local/Trolltech/Qt-4.7.0/lib/QtGui.framework/QtGui: Mach-O 64-bit 
dynamically linked shared library x86_64


However, I'll look into a 32-bit build and see if that fixes it.

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





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org