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 <[email protected]> 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 > [email protected] > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

