[Insight-users] compiling error with release mode

barbababa tonimuusimaki at gmail.com
Wed Sep 28 03:50:28 EDT 2011


The ITK FAQ says the problem is what i copied below. Does this mean i have to
start chancing the default
ITK code/libraries, which seems quite overwhelming? Or is it somewhere in my
implementation of the code?

For example DiscreteGaussianFilter.cpp does not produce this error.
But ConnectedThresholdFilter.cpp and OtsuMultipleThresholdsCalculator.cpp
does.


Visual Studio 6 Compiler Issues

ITK requires service pack 5 or higher to build with Visual Studio 6.
However, there are still some code patterns occasionally encountered when
using ITK code that cause an INTERNAL COMPILER ERROR. Here is a minimal
example of code that reproduces the ICE:

namespace N { template <class T> struct C {}; }
template <class T> struct A
{
  // Inside this template we refer to another template in another namespace.
  void m(const N::C<int>&);
};

// Now declare a class template using a non-type template parameter.
template <unsigned int V> struct B;

The above code results in an ICE reported from line 1794 of msc1.cpp. The
work-around is to use a typedef to refer to the other template:

namespace N { template <class T> struct C {}; }
template <class T> struct A
{
  typedef N::C<int> NCint;
  void m(const NCint&);
};
template <unsigned int V> struct B;

Here is another example causing a crash in the same place:

// Create a class template that has type and non-type arguments with
defaults.
template <class T=int, int N=1> class A {};

// Require the compiler to deduce the arguments for a specific
instantiation.
template <class T, int N> void f(A&lt;T,N&gt;) {}
void g() { f(A&lt;int,1&gt;()); }

The work-around is unforunately to not have the first default template
argument:

template <class T, int N=1> class A {};
template <class T, int N> void f(A&lt;T,N&gt;) {}
void g() { f(A&lt;int,1&gt;()); }

There are other code patterns that cause the same error. If you find one
please try to produce a minimal example and add it to this page.
Visual Studio 6 Compiler : Why you should not use it

Visual Studio 6 is becoming a really old compiler if you are thinking of
using it for your project be ready to bang your head against the wall.
Anyway if you have to use it, here are some fixes to the compiler include
file (mostly STL related):

    * Fixes for Library Bugs in VC++ V5.0/V6.0
    * Known problems in using the Microsoft Visual C++ compiler, version 6.0 

--
View this message in context: http://itk-insight-users.2283740.n2.nabble.com/compiling-error-with-release-mode-tp6836205p6839252.html
Sent from the ITK Insight Users mailing list archive at Nabble.com.


More information about the Insight-users mailing list