Menu

Compilation problem with g++ 4.0

Help
Anonymous
2005-09-14
2013-04-22
  • Anonymous

    Anonymous - 2005-09-14

    I am trying to generate new Debian packages for octaviz 0.4.0 with the latest version of the octave2.1 and libvtk4-dev packages, which just tranisitioned to the new C++ ABI.   Compilation fails with the error message below:

    Building Utility vtkStreamTracer.oct...
    [...]
    In file included from //usr/include/vtk/vtkStreamTracer.h: In member function 'virtual void vtkStreamTracer::SetIntegrationDirection(int)':
    /usr/include/vtk/vtkStreamTracer.h:257: error: 'vtkStreamTracer::<anonymous enum>' is/uses anonymous type
    /usr/include/vtk/vtkStreamTracer.h:257: error:   trying to instantiate 'template<class T> template<class U> octave_int::octave_int(U)'
    [...]

    Has this problem been already fixed in CVS?

    --
    Rafael Laboissiere <rafael@debian.org>

     
    • Jonathan Stickel

      I am not very knowledgeable about the c++ part of Octaviz, but there have been several reports of problems with compiling Octaviz 4.0 & CVS against VTK-CVS.  It is probably best to wait until vtk-5 is in a somewhat stable release state, and then we can fix Octaviz to compile against it (and also fix g++-4 issues).

       
    • Dragan Tubic

      Dragan Tubic - 2005-09-14

      The problem hasn't been fixed yet. I'll be working on this and other compilation problems (64bit architectures, gcc-4.0 and vtk 5) during next couple of weeks.

      Dragan

       
    • Dragan Tubic

      Dragan Tubic - 2005-09-20

      This turns out to be a g++ bug. Apparently g++ bails out if anonymous enums are used in arithmetic expressions and if there is a template arithmetic operator that accepts ints (or something along those lines). If you upgrade to g++-4.0 (4.0.1-8) octaviz should compile cleanly against octave2.9  (2.9.2-2) and libvtk4c2 (4.4.2-8).

      Dragan

       
    • Anonymous

      Anonymous - 2005-09-23

      It compiles also against octave2.1 (2.1.71) using g++ 4.0 and libvtk4c2 (4.4.2-8).

       
    • Fabian

      Fabian - 2006-01-04

      Hi,

      I just switched to ubuntu and have exactly the same problem, when I compile version 0.4.0. I tried to solve it like suggested with a new gcc-version, so I installed 'gcc-snapshot'.

      Typing: gcc -v
      I get: ... gcc version 4.0.2 20050808 (prerelease)

      before I used gcc version 4.0.1, which did not work either. The strange thing is, that I could compile it last week, on the ubuntu machine, but there I had some unstable Debian packages mixed (Pinning) with breezy-Ubuntu packages. Unfortunately octave crashed with the unstable Debian package so I started to build by hand...

      Do you have any idea!? Should I use the octave-cvs version?

      Greetings!
      Fabian

       
    • alex

      alex - 2006-01-04

      Hi Fabian,

      What resolved this problem for me is to name simply the anonymous enums. Change the following type of  code in the vtk headers:

      enum { FORWARD, BACK, BOTH }; 

      into:

      enum IntegrationDirectionEnum { FORWARD, BACK, BOTH }; 

      as explained here:  https://sourceforge.net/forum/message.php?msg_id=3346492

      As far as I can tell, this is a problem of VTK which doesn't conform completly to the C++ standard.

      Have fun
      Alex

       
    • Fabian

      Fabian - 2006-01-04

      Hi Alex,

      thanks a lot; I had to do it for a couple files ...

      works now :-)

      Fabian

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.