robertosfield wrote: > Hi Lv, > > I have now a couple experiments of including the X11 headers before > includeDB/Serializer and adding your suggested addition to the > osgviewerQt example and find that X11 either screws up lots of other > OSG files or Qt headers. This isn't something that is wrong with > wither OSG or Qt, but the way that X11 headers use common names used > methods, typedefs and classes polluting any attempt of C++ files to > use these. The C++ files might be good citizens and use namespaces so > they don't polute third part code, but they can't protect themselves > from pollution from C headers included before them. > > If you are going to use headers that pollute in an uncontrolled way > like the X11 ones then you are left having to included them after any > of the other headers that would be polluted by them. > > I would add that with the latest version of the OSG we now have a > osgQt library with it's own GraphicsWindowQt that simplifies the > process of integating the OSG and Qt so that you no longer need to > play with window handles, so no need to go explictly include X11, so > the proplem you are seeing right now is something you shouldn't need > to come across. > > Robert. > > On Sat, May 7, 2011 at 4:55 PM, Lv Qing <> wrote: > > > Hi, > > > > > > When I integrating my osg application into a QT application ,I found some > > <include> conflicting while using osg 2.9.11. > > > > /usr/local/include/osgDB/Serializer:640: error:expected unqualified-id > > before numeric constant > > /usr/local/include/osgDB/Serializer:640: error:expected `)' before numeric > > constant > > /usr/local/include/osgDB/Serializer:642: error:‘Setter’ undefined > > /usr/local/include/osgDB/Serializer:690: error:‘Setter’ undefined > > /usr/local/include/osgDB/Serializer: In constructor > > ‘osgDB::EnumSerializer<C, P, B>::EnumSerializer(const char*, P, P > > (C::*)()const, int)’: > > /usr/local/include/osgDB/Serializer:643: error class > > ‘osgDB::EnumSerializer<C, P, B>’ no ‘_setter’ > > /usr/local/include/osgDB/Serializer: In member function ‘virtual bool > > osgDB::EnumSerializer<C, P, B>::read(osgDB::InputStream&, osg::Object&)’: > > /usr/local/include/osgDB/Serializer:663: error:‘_setter’ undefined > > /usr/local/include/osgDB/Serializer:668: error:‘_setter’ undefined > > > > I dig a little up found it conflics when I include: > > > > #include <osgViewer/api/X11/GraphicsWindowX11> > > typedef Window WindowHandle; > > typedef osgViewer::GraphicsWindowX11::WindowData WindowData; > > > > in osgviewerQT.cpp. > > > > I have faced some other <include> conflicting problems while using older > > osg version ,I have just changed the <include> order sever times to solve > > the problem.But this time change the order causing other conflicting wtih > > other application's code. > > > > woo~I know it's not something wrong with OSG, just need help. > > > > > > > > > > > > > > > > > > > > ... > > > > Thank you! > > > > Cheers, > > Lv > > > > ------------------ > > Read this topic online here: > > http://forum.openscenegraph.org/viewtopic.php?p=39154#39154 > > > > > > > > > > > > _______________________________________________ > > osg-users mailing list > > > > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > > > > > _______________________________________________ > osg-users mailing list > > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > > ------------------ > Post generated by Mail2Forum
Hi, Thx ,Robert ! Never thought you do experiments yourself for me! I have already given up X11 and try osgviewerQtContext. However there is a new problem,when I run the osgviewerQtContext example,it seems OK in siglethread mode.When I set it to the ThreadPerCamera mode and resize the widget,it prints such error: QGLContext::makeCurrent(): Failed. After a few times resizing,it crashed and prints: Xlib: unexpected async reply (sequence 0x0)! X Error: 0 0 Major opcode: 0 () Resource id: 0x0 X Error: 0 0 Major opcode: 0 () Resource id: 0x0 Is it because osgviewerQtContext do not support muti-threading yet? Or is there a better way? THX! ------------------ Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=39182#39182 _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

