openexr-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Openexr-devel] Compilng in MSVC without Intel compiler now.


From: Lutz Latta
Subject: [Openexr-devel] Compilng in MSVC without Intel compiler now.
Date: Wed, 04 Jun 2003 13:56:33 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4b) Gecko/20030507

Hi everyone,
I managed to compile OpenEXR on Windows with the new version of MS VisualStudio .NET 2003 (MSVC7.1). They've been catching up with ISO conformance for compiling templates, and it was rather easy to get the MSVC6/Intel Compiler version ported.

I've attached a diff with the changes to this mail. To sum it up:

- I commented out a "hack" from the previous windows version, where the min/max functions where added. The new compiler/STL matches them correctly to STL min/max, without the hack. Commenting out the stuff now isn't nice either, but I don't know what policy you have for compiler detection code.

- According to MS the ISO rules require dependent type names from template classes to be prefixed with the "typename" keyword. Like:
                                                 vvv
inline Euler<T>::Euler( const Matrix33<T> &M, typename Euler::Order p )

I assume this should be accepted (if not required as in MSVC7.1) by other compilers as well.


Additionally, I found two errors that I didn't debug/fix yet:

- The ImathTest program assert when testing the euler-matrix conversion in extractEulerZYX() with order 2001.

- The IlmImfTest does not compile at testXdr.cpp:214 where an Xdr::read is done with a "const char*" template argument, that the compiler can't find an implementation for. I can't either, so my initial assumption is that the test code is out of date.


Otherwise everything works fine, even exrdisplay.

I think you should add to the readme (at least for the Windows version) what other packages (=zlib, FLTK) are required and where to put them (=in folders on level with the main OpenEXR folder) since Windows doesn't have standard include and library paths.

Another suggestion for the next release: do NOT give the .tar.gz and .zip files the same name, when one is the source distribution and the other only contains windows binaries with headers. Maybe call the zip file "win32-bin".


Keep up the good work,
   Lutz Latta

diff -ru OpenEXR-1.0.5-orig/IlmImfExamples/drawImage.cpp 
OpenEXR-1.0.5-mod/IlmImfExamples/drawImage.cpp
--- OpenEXR-1.0.5-orig/IlmImfExamples/drawImage.cpp     2003-03-21 
21:45:44.000000000 +0100
+++ OpenEXR-1.0.5-mod/IlmImfExamples/drawImage.cpp      2003-06-02 
20:53:47.000000000 +0200
@@ -54,7 +54,7 @@
 using namespace Imf;
 using namespace std;
 
-#if defined PLATFORM_WIN32
+/*#if defined PLATFORM_WIN32
 namespace
 {
 template<class T>
@@ -63,7 +63,7 @@
 template<class T>
 inline T max (const T &a, const T &b) { return (a >= b) ? a : b; }
 }
-#endif
+#endif*/
 
 
 float
diff -ru OpenEXR-1.0.5-orig/IlmImfExamples/rgbaInterfaceExamples.cpp 
OpenEXR-1.0.5-mod/IlmImfExamples/rgbaInterfaceExamples.cpp
--- OpenEXR-1.0.5-orig/IlmImfExamples/rgbaInterfaceExamples.cpp 2003-03-20 
06:39:58.000000000 +0100
+++ OpenEXR-1.0.5-mod/IlmImfExamples/rgbaInterfaceExamples.cpp  2003-06-02 
20:53:47.000000000 +0200
@@ -56,7 +56,7 @@
 using namespace Imf;
 using namespace Imath;
 
-#if defined PLATFORM_WIN32
+/*#if defined PLATFORM_WIN32
 namespace
 {
 template<class T>
@@ -65,7 +65,7 @@
 template<class T>
 inline T max (const T &a, const T &b) { return (a >= b) ? a : b; }
 }
-#endif
+#endif*/
 
 
 void
diff -ru OpenEXR-1.0.5-orig/Imath/ImathEuler.h 
OpenEXR-1.0.5-mod/Imath/ImathEuler.h
--- OpenEXR-1.0.5-orig/Imath/ImathEuler.h       2003-01-21 06:34:22.000000000 
+0100
+++ OpenEXR-1.0.5-mod/Imath/ImathEuler.h        2003-05-28 17:55:23.000000000 
+0200
@@ -377,7 +377,7 @@
 {}
 
 template<class T>
-Euler<T>::Euler(Euler<T>::Order p) :
+Euler<T>::Euler(typename Euler<T>::Order p) :
     Vec3<T>(0,0,0),
     _frameStatic(true),
     _initialRepeated(false),
@@ -389,8 +389,8 @@
 
 template<class T>
 inline Euler<T>::Euler( const Vec3<T> &v, 
-                       Euler<T>::Order p, 
-                       Euler<T>::InputLayout l ) 
+                       typename Euler<T>::Order p, 
+                       typename Euler<T>::InputLayout l ) 
 {
     setOrder(p); 
     if ( l == XYZLayout ) setXYZVector(v);
@@ -413,8 +413,8 @@
 
 template<class T>
 inline Euler<T>::Euler( T xi, T yi, T zi, 
-                       Euler<T>::Order p,
-                       Euler<T>::InputLayout l)
+                       typename Euler<T>::Order p,
+                       typename Euler<T>::InputLayout l)
 {
     setOrder(p);
     if ( l == XYZLayout ) setXYZVector(Vec3<T>(xi,yi,zi));
@@ -422,14 +422,14 @@
 }
 
 template<class T>
-inline Euler<T>::Euler( const Matrix33<T> &M, Euler::Order p )
+inline Euler<T>::Euler( const Matrix33<T> &M, typename Euler::Order p )
 {
     setOrder(p);
     extract(M);
 }
 
 template<class T>
-inline Euler<T>::Euler( const Matrix44<T> &M, Euler::Order p )
+inline Euler<T>::Euler( const Matrix44<T> &M, typename Euler::Order p )
 {
     setOrder(p);
     extract(M);
@@ -738,7 +738,7 @@
 
 template<class T>
 inline bool
-Euler<T>::legal(Euler<T>::Order order)
+Euler<T>::legal(typename Euler<T>::Order order)
 {
     return (order & ~Legal) ? false : true;
 }
@@ -757,7 +757,7 @@
 }
 
 template<class T>
-inline void Euler<T>::setOrder(Euler::Order p)
+inline void Euler<T>::setOrder(typename Euler::Order p)
 {
     set( p & 0x2000 ? Z : (p & 0x1000 ? Y : X),        // initial axis
         !(p & 0x1),                            // static?
@@ -766,7 +766,7 @@
 }
 
 template<class T>
-void Euler<T>::set(Euler::Axis axis,
+void Euler<T>::set(typename Euler::Axis axis,
                   bool relative,
                   bool parityEven,
                   bool firstRepeats)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]