Hi Carsten. > -----Ursprüngliche Nachricht----- > Von: Carsten Neumann [mailto:carsten_neum...@gmx.net] > Gesendet: Dienstag, 5. Juli 2011 16:20 > An: opensg-users@lists.sourceforge.net > Betreff: Re: [Opensg-users] gcc -fvisibility=hidden > > Hello Thomas, > > On 07/05/2011 05:54 AM, Henn, Thomas wrote: > > I currently face an issue with gcc's compiler option - > fvisibility=hidden. When I try to compile my OpenSG executable with > that option, the resulting program shows a very strange behavior. For > example, if I try to create a geometry like this... > > > > GeoPositions3fPtr pos = GeoPositions3f::create(); > > beginEditCP(pos); > > [...] > > endEditCP(pos); > > > > [...] > > > > GeometryPtr geo = Geometry::create(); > > beginEditCP(geo); > > geo->setPositions(pos); > > [...] > > endEditCP(geo); > > > > ...each GeoProperty<T>::create() returns NullFC and only > Geometry::create() returns a valid pointer. But when I create a > SimpleGeometry like this... > > just to clarify: you wrote GeoProperty<T>::create(), but your code is > not actually using the templates directly, but > GeoPositions3f::create(), > GeoNormals3f::create(), etc., like the snippet you posted above, right?
Ah, sorry, that was only to be complete. Actually I use GeoPositions3f::create() GeoIndicesUI32::create() and so on... > > GeometryPtr geo = makeTorusGeo(0.5,4,8,16); > > > > ...everything works fine. > > But I don't really understand why my first approach doesn't work. > > hmm, I'm not sure what the problem could be either. As a first check, > can you start your program with environment variable > OSG_LOG_LEVEL=DEBUG > set? You should see many lines of the form: > > DEBUG: Registered type Geometry | 735 (-1645862464) > DEBUG: Registered type GeometryPtr | 736 (-1645862208) > DEBUG: Registered type SFGeometryPtr | 737 (-1645862112) > DEBUG: Initialized FieldType : SFGeometryPtr 0x7f729de62320 > DEBUG: Registered type MFGeometryPtr | 738 (-1645861984) > DEBUG: Initialized FieldType : MFGeometryPtr 0x7f729de623a0 > > Can you check if the GeoProperties you are using (e.g. GeoPositions3f) > show up as registered types? All the types seem to be registered: DEBUG: Registered type Geometry | 690 (34273824) DEBUG: Registered type GeometryPtr | 691 (34273984) DEBUG: Registered type SFGeometryPtr | 692 (34274048) DEBUG: Initialized FieldType : SFGeometryPtr 0x20afb00 DEBUG: Registered type MFGeometryPtr | 693 (34274112) DEBUG: Initialized FieldType : MFGeometryPtr 0x20afb40 DEBUG: Registered type GeoPositions | 694 (34271776) DEBUG: Registered type GeoNormals | 695 (34271936) DEBUG: Registered type GeoColors | 696 (34272096) DEBUG: Registered type GeoTexCoords | 697 (34272256) DEBUG: Registered type GeoIndices | 698 (34272416) DEBUG: Registered type GeoPTypes | 699 (34272576) DEBUG: Registered type GeoPLengths | 700 (34272736) > Perhaps you can also compare the output of your program with that of > one > of the test/tutorial programs that come with OpenSG, e.g. > testStatisticsRender. I'm already working on a simple program based on the 01hello example. > > Another question is, whether it is possible to compile OpenSG itself > with -fvisibility=hidden and how the OpenSG sources have to be modified > for that. > > I imagine at the very least one would have to go through an annotate > all > types that are meant to be visible to applications linking with OpenSG. > Perhaps the macros used for adding dllexport/dllimport on windows can > be > used for that. > I wouldn't expect too much of an effect though, since the majority of > types are meant to be used by applications (e.g. practically all > FieldContainer should be visible) so only few types would actually end > up being hidden. That's the way I already tried it, but unfortunately I ended up with a lot of unresolved externals when linking my executable to the modified OpenSG. Probably I got lost in the jungle of OSGExportDefines.h :-( Cheers, Thomas ------------------------------------------------------------------------------ All of the data generated in your IT infrastructure is seriously valuable. Why? It contains a definitive record of application performance, security threats, fraudulent activity, and more. Splunk takes this data and makes sense of it. IT sense. And common sense. http://p.sf.net/sfu/splunk-d2d-c2 _______________________________________________ Opensg-users mailing list Opensg-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensg-users