"Petr Srom" writes: > Hi, > i have problem with struct alignment - my project include this structs: > > typedef struct __DSPOS__ > { > float x; > float y; > float z; > float h; > float p; > float r; > }DSPOS; > > typedef struct __PLAYER_POS__ > { > UCHAR index; > DSPOS pos; > }PLAYER_POS; > > And when i changed in project - properties Struct Member Alignment from > "default" to "1 Byte" - I cannot run viewer (Microsoft Visual Studio) > ): > > the problem is on this line: > viewer.setSceneData(root); > > Unhandled exception at 0x00db7a10 in osgdefaultproject.exe: 0xC0000005: > Access violation reading location 0x0000e24d. > > How can I solve this problem?
Do not change the whole project alignment settings. Other libraries compiled with sane values for it will break, as you have experienced with OSG. Change it only in your data structures with the pragma directives of your compiler. A quick google results in "#pragma pack" for your VS. -- Alberto _______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org