Re: [osg-users] include conflict while compiling osg 2.9.11
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::EnumSerializerC, P, B::EnumSerializer(const char*, P, P (C::*)()const, int)’: /usr/local/include/osgDB/Serializer:643: error class ‘osgDB::EnumSerializerC, P, B’ no ‘_setter’ /usr/local/include/osgDB/Serializer: In member function ‘virtual bool osgDB::EnumSerializerC, 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 osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] include conflict while compiling osg 2.9.11
Hi Lv, It is a known issue of the osgviewerQt example under Linux. AFAIK, OSG's multithreading mechanism could well with QtOpenGL under Windows, but the make current operation is confused when using QGLWidget as the low-level graphics context. With Qt 4.7 and Ubuntu 10.10, the example seems to work with warnings, but still not responsible. Maybe somebody could help debug into the Qt source code to find the problem later. Cheers, Wang Rui 2011/5/9 Lv Qing donlvq...@msn.com: 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 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] include conflict while compiling osg 2.9.11
Hi Lv, My guess is that X11 is doing #define on one of the typedefs or variables used by the include/osgDB/Serializer. This namespace polution is unfortunately effect of old C headers that one has to either re-order includes, change names to avoid conflicts or add #undef's to the headers to avoid the issue. Robert. On Sat, May 7, 2011 at 4:55 PM, Lv Qing donlvq...@msn.com 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::EnumSerializerC, P, B::EnumSerializer(const char*, P, P (C::*)()const, int)’: /usr/local/include/osgDB/Serializer:643: error class ‘osgDB::EnumSerializerC, P, B’ no ‘_setter’ /usr/local/include/osgDB/Serializer: In member function ‘virtual bool osgDB::EnumSerializerC, 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 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] include conflict while compiling osg 2.9.11
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 donlvq...@msn.com 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::EnumSerializerC, P, B::EnumSerializer(const char*, P, P (C::*)()const, int)’: /usr/local/include/osgDB/Serializer:643: error class ‘osgDB::EnumSerializerC, P, B’ no ‘_setter’ /usr/local/include/osgDB/Serializer: In member function ‘virtual bool osgDB::EnumSerializerC, 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 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] include conflict while compiling osg 2.9.11
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::EnumSerializerC, P, B::EnumSerializer(const char*, P, P (C::*)()const, int)’: /usr/local/include/osgDB/Serializer:643: error class ‘osgDB::EnumSerializerC, P, B’ no ‘_setter’ /usr/local/include/osgDB/Serializer: In member function ‘virtual bool osgDB::EnumSerializerC, 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 osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org