Hello Patric,

Patric Schmitz wrote:
On Tue, 15 Sep 2009 10:03:39 +0200
Patric Schmitz <[email protected]> wrote:
I want to report a bug and potential fix which I encountered when
trying to build OpenSG 1.8 CVS using MSVC9 (Visual Studio 2008
Express).

Any comments on this?

sorry for not getting back to you earlier and thank you for the bug report.
I wanted to figure out the right define and value to test for vc9 to make the instantiations conditional, but other things got in the way...

Is msvc9 support planned for 1.8 at all?

no, unless of course some kind soul sits down, runs the build and sends patches for the things that need an adjustment ;)

Do you want me to send you the project files?

the problem with those is that they keep getting out of date easily. If you have patches for the scons build or the sources, I'd be very happy if you'd send them.

I successfully built Base, System and WindowGLUT by now.
What about the "fix" which just comments the template instantiations?
Is there a cleaner way? Anyone?

hm, it looks as if I got the syntax for an explicit template instantiation slightly wrong. Would you mind trying the attached patch?

        Cheers,
                Carsten
Index: Source/Base/Base/OSGColor.cpp
===================================================================
RCS file: /cvsroot/opensg/OpenSG/Source/Base/Base/OSGColor.cpp,v
retrieving revision 1.3
diff -u -r1.3 OSGColor.cpp
--- Source/Base/Base/OSGColor.cpp	19 Aug 2008 00:09:34 -0000	1.3
+++ Source/Base/Base/OSGColor.cpp	22 Sep 2009 16:02:23 -0000
@@ -57,17 +57,17 @@
 //OSG_BASE_DLLMAPPING Color3ub    OSG::NullColor3ub( 0,0,0 );
 //OSG_BASE_DLLMAPPING Color4ub    OSG::NullColor4ub( 0,0,0,0 );
 
-OSG_COLOR3_OUTPUT_OP_INST(Real32)
-OSG_COLOR3_OUTPUT_OP_INST(UInt8)
+OSG_COLOR3_OUTPUT_OP_INST(Real32);
+OSG_COLOR3_OUTPUT_OP_INST(UInt8);
 
-OSG_COLOR3_INPUT_OP_INST(Real32)
-OSG_COLOR3_INPUT_OP_INST(UInt8)
+OSG_COLOR3_INPUT_OP_INST(Real32);
+OSG_COLOR3_INPUT_OP_INST(UInt8);
 
 
-OSG_COLOR4_OUTPUT_OP_INST(Real32)
-OSG_COLOR4_OUTPUT_OP_INST(UInt8)
+OSG_COLOR4_OUTPUT_OP_INST(Real32);
+OSG_COLOR4_OUTPUT_OP_INST(UInt8);
 
-OSG_COLOR4_INPUT_OP_INST(Real32)
-OSG_COLOR4_INPUT_OP_INST(UInt8)
+OSG_COLOR4_INPUT_OP_INST(Real32);
+OSG_COLOR4_INPUT_OP_INST(UInt8);
 
 OSG_END_NAMESPACE
Index: Source/Base/Base/OSGColor.ins
===================================================================
RCS file: /cvsroot/opensg/OpenSG/Source/Base/Base/OSGColor.ins,v
retrieving revision 1.1
diff -u -r1.1 OSGColor.ins
--- Source/Base/Base/OSGColor.ins	19 Aug 2008 00:09:34 -0000	1.1
+++ Source/Base/Base/OSGColor.ins	22 Sep 2009 16:02:23 -0000
@@ -38,53 +38,71 @@
 
 OSG_BEGIN_NAMESPACE
 
-#define OSG_COLOR3_OUTPUT_OP_INST(OSG_VALUE_TYPE)                              \
-template <> OSG_DLL_EXPORT                                                     \
-std::ostream &operator <<(                                                     \
-    std::ostream &os, const Color3< OSG_VALUE_TYPE > &obj)                     \
-{                                                                              \
-    VecToStreamWriter< Color3< OSG_VALUE_TYPE >,                               \
-                       OSG_VALUE_TYPE,                                         \
-                       3                        >::apply(os, obj);             \
-                                                                               \
-    return os;                                                                 \
-}
-
-#define OSG_COLOR3_INPUT_OP_INST(OSG_VALUE_TYPE)                               \
-template <> OSG_DLL_EXPORT                                                     \
-std::istream &operator >>(                                                     \
-    std::istream &is, Color3< OSG_VALUE_TYPE > &obj)                           \
-{                                                                              \
-    VecFromStreamReader< Color3< OSG_VALUE_TYPE >,                             \
-                         OSG_VALUE_TYPE,                                       \
-                         3                        >::apply(is, obj);           \
-                                                                               \
-    return is;                                                                 \
-}
-
-
-#define OSG_COLOR4_OUTPUT_OP_INST(OSG_VALUE_TYPE)                              \
-template <> OSG_DLL_EXPORT                                                     \
-std::ostream &operator <<(                                                     \
-    std::ostream &os, const Color4< OSG_VALUE_TYPE > &obj)                     \
-{                                                                              \
-    VecToStreamWriter< Color4< OSG_VALUE_TYPE >,                               \
-                       OSG_VALUE_TYPE,                                         \
-                       4                        >::apply(os, obj);             \
-                                                                               \
-    return os;                                                                 \
-}
-
-#define OSG_COLOR4_INPUT_OP_INST(OSG_VALUE_TYPE)                               \
-template <> OSG_DLL_EXPORT                                                     \
-std::istream &operator >>(                                                     \
-    std::istream &is, Color4< OSG_VALUE_TYPE > &obj)                           \
-{                                                                              \
-    VecFromStreamReader< Color4< OSG_VALUE_TYPE >,                             \
-                         OSG_VALUE_TYPE,                                       \
-                         4                        >::apply(is, obj);           \
-                                                                               \
-    return is;                                                                 \
-}
+#define OSG_COLOR3_OUTPUT_OP_INST(OSG_VALUE_TYPE)                       \
+template <> OSG_DLL_EXPORT                                              \
+std::ostream &operator <<(                                              \
+    std::ostream &os, const Color3< OSG_VALUE_TYPE > &obj)              \
+{                                                                       \
+    VecToStreamWriter< Color3< OSG_VALUE_TYPE >,                        \
+                       OSG_VALUE_TYPE,                                  \
+                       3                        >::apply(os, obj);      \
+                                                                        \
+    return os;                                                          \
+}                                                                       \
+                                                                        \
+template OSG_DLL_EXPORT                                                 \
+std::ostream &operator <<(                                              \
+    std::ostream &os, const Color3< OSG_VALUE_TYPE > &obj)
+
+
+#define OSG_COLOR3_INPUT_OP_INST(OSG_VALUE_TYPE)                        \
+template <> OSG_DLL_EXPORT                                              \
+std::istream &operator >>(                                              \
+    std::istream &is, Color3< OSG_VALUE_TYPE > &obj)                    \
+{                                                                       \
+    VecFromStreamReader< Color3< OSG_VALUE_TYPE >,                      \
+                         OSG_VALUE_TYPE,                                \
+                         3                        >::apply(is, obj);    \
+                                                                        \
+    return is;                                                          \
+}                                                                       \
+                                                                        \
+template OSG_DLL_EXPORT                                                 \
+std::istream &operator >>(                                              \
+    std::istream &is, Color3< OSG_VALUE_TYPE > &obj);
+
+
+#define OSG_COLOR4_OUTPUT_OP_INST(OSG_VALUE_TYPE)                       \
+template <> OSG_DLL_EXPORT                                              \
+std::ostream &operator <<(                                              \
+    std::ostream &os, const Color4< OSG_VALUE_TYPE > &obj)              \
+{                                                                       \
+    VecToStreamWriter< Color4< OSG_VALUE_TYPE >,                        \
+                       OSG_VALUE_TYPE,                                  \
+                       4                        >::apply(os, obj);      \
+                                                                        \
+    return os;                                                          \
+}                                                                       \
+                                                                        \
+template OSG_DLL_EXPORT                                                 \
+std::ostream &operator <<(                                              \
+    std::ostream &os, const Color4< OSG_VALUE_TYPE > &obj)
+
+
+#define OSG_COLOR4_INPUT_OP_INST(OSG_VALUE_TYPE)                        \
+template <> OSG_DLL_EXPORT                                              \
+std::istream &operator >>(                                              \
+    std::istream &is, Color4< OSG_VALUE_TYPE > &obj)                    \
+{                                                                       \
+    VecFromStreamReader< Color4< OSG_VALUE_TYPE >,                      \
+                         OSG_VALUE_TYPE,                                \
+                         4                        >::apply(is, obj);    \
+                                                                        \
+    return is;                                                          \
+}                                                                       \
+                                                                        \
+template OSG_DLL_EXPORT                                                 \
+std::istream &operator >>(                                              \
+    std::istream &is, Color4< OSG_VALUE_TYPE > &obj)
 
 OSG_END_NAMESPACE
Index: Source/Base/Base/OSGQuaternion.cpp
===================================================================
RCS file: /cvsroot/opensg/OpenSG/Source/Base/Base/OSGQuaternion.cpp,v
retrieving revision 1.1
diff -u -r1.1 OSGQuaternion.cpp
--- Source/Base/Base/OSGQuaternion.cpp	19 Aug 2008 00:09:34 -0000	1.1
+++ Source/Base/Base/OSGQuaternion.cpp	22 Sep 2009 16:02:23 -0000
@@ -43,7 +43,7 @@
 
 OSG_BEGIN_NAMESPACE
 
-OSG_QUATERNION_OUTPUT_OP_INST(Real32)
-OSG_QUATERNION_INPUT_OP_INST(Real32)
+OSG_QUATERNION_OUTPUT_OP_INST(Real32);
+OSG_QUATERNION_INPUT_OP_INST(Real32);
 
 OSG_END_NAMESPACE
Index: Source/Base/Base/OSGQuaternion.ins
===================================================================
RCS file: /cvsroot/opensg/OpenSG/Source/Base/Base/OSGQuaternion.ins,v
retrieving revision 1.1
diff -u -r1.1 OSGQuaternion.ins
--- Source/Base/Base/OSGQuaternion.ins	19 Aug 2008 00:09:34 -0000	1.1
+++ Source/Base/Base/OSGQuaternion.ins	22 Sep 2009 16:02:23 -0000
@@ -54,7 +54,13 @@
                        4                                >::apply(os, obj);     \
                                                                                \
     return os;                                                                 \
-}
+}                                                                              \
+                                                                               \
+template OSG_DLL_EXPORT                                                        \
+std::ostream &operator << (                                                    \
+    std::ostream &os, const QuaternionBase< OSG_VALUE_TYPE > &obj)
+
+
 
 #define OSG_QUATERNION_INPUT_OP_INST(OSG_VALUE_TYPE)                           \
 template <> OSG_DLL_EXPORT                                                     \
@@ -66,6 +72,10 @@
                          4                                >::apply(is, obj);   \
                                                                                \
     return is;                                                                 \
-}
+}                                                                              \
+                                                                               \
+template OSG_DLL_EXPORT                                                        \
+std::istream &operator >> (                                                    \
+    std::istream &is, QuaternionBase< OSG_VALUE_TYPE > &obj)
 
 OSG_END_NAMESPACE
Index: Source/Base/Base/OSGVector.cpp
===================================================================
RCS file: /cvsroot/opensg/OpenSG/Source/Base/Base/OSGVector.cpp,v
retrieving revision 1.7
diff -u -r1.7 OSGVector.cpp
--- Source/Base/Base/OSGVector.cpp	19 Aug 2008 00:09:34 -0000	1.7
+++ Source/Base/Base/OSGVector.cpp	22 Sep 2009 16:02:24 -0000
@@ -240,31 +240,31 @@
     */
 #endif
     
-#define OSG_VECPNT_IO_OP_INST(OSG_VALUE_TYPE)                               \
-OSG_POINT_OUTPUT_OP_INST(OSG_VALUE_TYPE, 2)                                 \
-OSG_POINT_OUTPUT_OP_INST(OSG_VALUE_TYPE, 3)                                 \
-OSG_POINT_OUTPUT_OP_INST(OSG_VALUE_TYPE, 4)                                 \
-OSG_POINT_INPUT_OP_INST(OSG_VALUE_TYPE, 2)                                  \
-OSG_POINT_INPUT_OP_INST(OSG_VALUE_TYPE, 3)                                  \
-OSG_POINT_INPUT_OP_INST(OSG_VALUE_TYPE, 4)                                  \
-\
-OSG_VECTOR_OUTPUT_OP_INST(OSG_VALUE_TYPE, 2)                                \
-OSG_VECTOR_OUTPUT_OP_INST(OSG_VALUE_TYPE, 3)                                \
-OSG_VECTOR_OUTPUT_OP_INST(OSG_VALUE_TYPE, 4)                                \
-OSG_VECTOR_INPUT_OP_INST(OSG_VALUE_TYPE, 2)                                 \
-OSG_VECTOR_INPUT_OP_INST(OSG_VALUE_TYPE, 3)                                 \
-OSG_VECTOR_INPUT_OP_INST(OSG_VALUE_TYPE, 4)
+#define OSG_VECPNT_IO_OP_INST(OSG_VALUE_TYPE)                           \
+  OSG_POINT_OUTPUT_OP_INST(OSG_VALUE_TYPE, 2);                          \
+  OSG_POINT_OUTPUT_OP_INST(OSG_VALUE_TYPE, 3);                          \
+  OSG_POINT_OUTPUT_OP_INST(OSG_VALUE_TYPE, 4);                          \
+  OSG_POINT_INPUT_OP_INST(OSG_VALUE_TYPE, 2);                           \
+  OSG_POINT_INPUT_OP_INST(OSG_VALUE_TYPE, 3);                           \
+  OSG_POINT_INPUT_OP_INST(OSG_VALUE_TYPE, 4);                           \
+                                                                        \
+  OSG_VECTOR_OUTPUT_OP_INST(OSG_VALUE_TYPE, 2);                         \
+  OSG_VECTOR_OUTPUT_OP_INST(OSG_VALUE_TYPE, 3);                         \
+  OSG_VECTOR_OUTPUT_OP_INST(OSG_VALUE_TYPE, 4);                         \
+  OSG_VECTOR_INPUT_OP_INST(OSG_VALUE_TYPE, 2);                          \
+  OSG_VECTOR_INPUT_OP_INST(OSG_VALUE_TYPE, 3);                          \
+  OSG_VECTOR_INPUT_OP_INST(OSG_VALUE_TYPE, 4)
 
-OSG_VECPNT_IO_OP_INST(Real32)
-OSG_VECPNT_IO_OP_INST(Real64)
-OSG_VECPNT_IO_OP_INST(Real128)
+OSG_VECPNT_IO_OP_INST(Real32);
+OSG_VECPNT_IO_OP_INST(Real64);
+OSG_VECPNT_IO_OP_INST(Real128);
 
-OSG_VECPNT_IO_OP_INST(Int8)
-OSG_VECPNT_IO_OP_INST(UInt8)
-OSG_VECPNT_IO_OP_INST(Int16)
-OSG_VECPNT_IO_OP_INST(UInt16)
-OSG_VECPNT_IO_OP_INST(Int32)
-OSG_VECPNT_IO_OP_INST(UInt32)
+OSG_VECPNT_IO_OP_INST(Int8);
+OSG_VECPNT_IO_OP_INST(UInt8);
+OSG_VECPNT_IO_OP_INST(Int16);
+OSG_VECPNT_IO_OP_INST(UInt16);
+OSG_VECPNT_IO_OP_INST(Int32);
+OSG_VECPNT_IO_OP_INST(UInt32);
 
 #undef OSG_VECPNT_IO_OP_INST
 
Index: Source/Base/Base/OSGVector.ins
===================================================================
RCS file: /cvsroot/opensg/OpenSG/Source/Base/Base/OSGVector.ins,v
retrieving revision 1.1
diff -u -r1.1 OSGVector.ins
--- Source/Base/Base/OSGVector.ins	19 Aug 2008 00:09:34 -0000	1.1
+++ Source/Base/Base/OSGVector.ins	22 Sep 2009 16:02:24 -0000
@@ -44,45 +44,63 @@
 // Use them in your own code if you need to use other types than
 // those provided.
 
-#define OSG_POINT_OUTPUT_OP_INST(OSG_VALUE_TYPE, OSG_SIZE)                     \
-template <> OSG_DLL_EXPORT                                                     \
-std::ostream &operator << < OSG_VALUE_TYPE, OSG_SIZE >(                        \
-    std::ostream &os, const Point< OSG_VALUE_TYPE, OSG_SIZE > &obj)            \
-{                                                                              \
-    VecToStreamWriter< Point< OSG_VALUE_TYPE, OSG_SIZE > >::apply(os, obj);    \
-                                                                               \
-    return os;                                                                 \
-}
-
-#define OSG_POINT_INPUT_OP_INST(OSG_VALUE_TYPE, OSG_SIZE)                      \
-template <> OSG_DLL_EXPORT                                                     \
-std::istream &operator >> < OSG_VALUE_TYPE, OSG_SIZE >(                        \
-    std::istream &is, Point< OSG_VALUE_TYPE, OSG_SIZE > &obj)                  \
-{                                                                              \
-    VecFromStreamReader< Point< OSG_VALUE_TYPE, OSG_SIZE > >::apply(is, obj);  \
-                                                                               \
-    return is;                                                                 \
-}
-
-
-#define OSG_VECTOR_OUTPUT_OP_INST(OSG_VALUE_TYPE, OSG_SIZE)                    \
-template <> OSG_DLL_EXPORT                                                     \
-std::ostream &operator << < OSG_VALUE_TYPE, OSG_SIZE >(                        \
-    std::ostream &os, const Vector< OSG_VALUE_TYPE, OSG_SIZE > &obj)           \
-{                                                                              \
-    VecToStreamWriter< Vector< OSG_VALUE_TYPE, OSG_SIZE > >::apply(os, obj);   \
-                                                                               \
-    return os;                                                                 \
-}
-
-#define OSG_VECTOR_INPUT_OP_INST(OSG_VALUE_TYPE, OSG_SIZE)                     \
-template <> OSG_DLL_EXPORT                                                     \
-std::istream &operator >> < OSG_VALUE_TYPE, OSG_SIZE >(                        \
-    std::istream &is, Vector< OSG_VALUE_TYPE, OSG_SIZE > &obj)                 \
-{                                                                              \
-    VecFromStreamReader< Vector< OSG_VALUE_TYPE, OSG_SIZE > >::apply(is, obj); \
-                                                                               \
-    return is;                                                                 \
-}
+#define OSG_POINT_OUTPUT_OP_INST(OSG_VALUE_TYPE, OSG_SIZE)                      \
+template <> OSG_DLL_EXPORT                                                      \
+std::ostream &operator << < OSG_VALUE_TYPE, OSG_SIZE >(                         \
+    std::ostream &os, const Point< OSG_VALUE_TYPE, OSG_SIZE > &obj)             \
+{                                                                               \
+    VecToStreamWriter< Point< OSG_VALUE_TYPE, OSG_SIZE > >::apply(os, obj);     \
+                                                                                \
+    return os;                                                                  \
+}                                                                               \
+                                                                                \
+template OSG_DLL_EXPORT                                                         \
+std::ostream &operator << < OSG_VALUE_TYPE, OSG_SIZE >(                         \
+    std::ostream &os, const Point< OSG_VALUE_TYPE, OSG_SIZE > &obj)
+
+                                                                                \
+#define OSG_POINT_INPUT_OP_INST(OSG_VALUE_TYPE, OSG_SIZE)                       \
+template <> OSG_DLL_EXPORT                                                      \
+std::istream &operator >> < OSG_VALUE_TYPE, OSG_SIZE >(                         \
+    std::istream &is, Point< OSG_VALUE_TYPE, OSG_SIZE > &obj)                   \
+{                                                                               \
+    VecFromStreamReader< Point< OSG_VALUE_TYPE, OSG_SIZE > >::apply(is, obj);   \
+                                                                                \
+    return is;                                                                  \
+}                                                                               \
+                                                                                \
+template OSG_DLL_EXPORT                                                         \
+std::istream &operator >> < OSG_VALUE_TYPE, OSG_SIZE >(                         \
+    std::istream &is, Point< OSG_VALUE_TYPE, OSG_SIZE > &obj)
+
+
+#define OSG_VECTOR_OUTPUT_OP_INST(OSG_VALUE_TYPE, OSG_SIZE)                     \
+template <> OSG_DLL_EXPORT                                                      \
+std::ostream &operator << < OSG_VALUE_TYPE, OSG_SIZE >(                         \
+    std::ostream &os, const Vector< OSG_VALUE_TYPE, OSG_SIZE > &obj)            \
+{                                                                               \
+    VecToStreamWriter< Vector< OSG_VALUE_TYPE, OSG_SIZE > >::apply(os, obj);    \
+                                                                                \
+    return os;                                                                  \
+}                                                                               \
+                                                                                \
+template OSG_DLL_EXPORT                                                         \
+std::ostream &operator << < OSG_VALUE_TYPE, OSG_SIZE >(                         \
+    std::ostream &os, const Vector< OSG_VALUE_TYPE, OSG_SIZE > &obj)
+
+
+#define OSG_VECTOR_INPUT_OP_INST(OSG_VALUE_TYPE, OSG_SIZE)                      \
+template <> OSG_DLL_EXPORT                                                      \
+std::istream &operator >> < OSG_VALUE_TYPE, OSG_SIZE >(                         \
+    std::istream &is, Vector< OSG_VALUE_TYPE, OSG_SIZE > &obj)                  \
+{                                                                               \
+    VecFromStreamReader< Vector< OSG_VALUE_TYPE, OSG_SIZE > >::apply(is, obj);  \
+                                                                                \
+    return is;                                                                  \
+}                                                                               \
+                                                                                \
+template OSG_DLL_EXPORT                                                         \
+std::istream &operator >> < OSG_VALUE_TYPE, OSG_SIZE >(                         \
+    std::istream &is, Vector< OSG_VALUE_TYPE, OSG_SIZE > &obj)
 
 OSG_END_NAMESPACE
------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to