Problem building on Linux x86_64

Help
2006-10-12
2013-03-24
  • Jaime Vives

    Jaime Vives - 2006-10-12

    Hi:

      I'm trying to build cgkit on my Linux FC5 x86_64 (on an AMD 64x2 3800+), but I cannot build the support library. I get a lot of errors like this one:

    error: cast from 'support3d::Dependent*' to 'int' loses precision

      Should I file a bug report? I'm not skilled enough to tell if this a general problem with the x86_64 platform, or just with my machine...

      Regards,

    --
    Jaime

     
    • Matthias Baas

      Matthias Baas - 2006-10-12

      Unfortunately, I don't have any 64bit machine to test this.
      Can you send me the output of the compiler so that I can see where the errors are located?

      - Matthias -

       
    • stephan steinbach

      I am having the same problem, running edgy-eft ubuntu.  here is the compiler out put:

      ~/external_source/cgkit/supportlib> scons
      scons: Reading SConscript files ...
      26 source files
      C++ compiler version: 4.1.2
      Checking for C++ header file boost/shared_ptr.hpp... (cached) yes
      scons: done reading SConscript files.
      scons: Building targets ...
      g++ -o obj/spheregeom.o -c -fPIC -Iinclude -I/opt/local/include src/spheregeom.cpp
      include/slot.h: In member function 'void support3d::Slot<T>::addDependent(support3d::Dependent*) [with T = double]':
      src/spheregeom.cpp:61:   instantiated from here
      include/slot.h:783: error: cast from 'support3d::Dependent*' to 'int' loses precision
      include/slot.h: In member function 'void support3d::Slot<T>::removeDependent(support3d::Dependent*) [with T = double]':
      src/spheregeom.cpp:71:   instantiated from here
      include/slot.h:796: error: cast from 'support3d::Dependent*' to 'int' loses precision
      include/slot.h: In member function 'void support3d::Slot<T>::removeDependent(support3d::Dependent*) [with T = int]':
      include/slot.h:614:   instantiated from 'support3d::Slot<T>::~Slot() [with T = int]'
      src/spheregeom.cpp:58:   instantiated from here
      include/slot.h:796: error: cast from 'support3d::Dependent*' to 'int' loses precision
      include/slot.h: In member function 'void support3d::Slot<T>::removeDependent(support3d::Dependent*) [with T = support3d::vec3<double>]':
      include/slot.h:614:   instantiated from 'support3d::Slot<T>::~Slot() [with T = support3d::vec3<double>]'
      src/spheregeom.cpp:58:   instantiated from here
      include/slot.h:796: error: cast from 'support3d::Dependent*' to 'int' loses precision
      include/slot.h: In member function 'void support3d::Slot<T>::removeDependent(support3d::Dependent*) [with T = support3d::mat3<double>]':
      include/slot.h:614:   instantiated from 'support3d::Slot<T>::~Slot() [with T = support3d::mat3<double>]'
      include/proceduralslot.h:95:   instantiated from here
      include/slot.h:796: error: cast from 'support3d::Dependent*' to 'int' loses precision
      include/slot.h: In member function 'void support3d::Slot<T>::addDependent(support3d::Dependent*) [with T = support3d::mat3<double>]':
      src/spheregeom.cpp:195:   instantiated from here
      include/slot.h:783: error: cast from 'support3d::Dependent*' to 'int' loses precision
      include/slot.h: In member function 'void support3d::Slot<T>::setController(support3d::ISlot*) [with T = support3d::mat3<double>]':
      src/spheregeom.cpp:195:   instantiated from here
      include/slot.h:732: error: cast from 'support3d::ISlot*' to 'unsigned int' loses precision
      include/slot.h:741: error: cast from 'support3d::ISlot*' to 'unsigned int' loses precision
      src/spheregeom.cpp:195:   instantiated from here
      include/slot.h:777: error: cast from 'support3d::ISlot*' to 'unsigned int' loses precision
      include/slot.h: In member function 'void support3d::Slot<T>::addDependent(support3d::Dependent*) [with T = int]':
      src/spheregeom.cpp:195:   instantiated from here
      include/slot.h:783: error: cast from 'support3d::Dependent*' to 'int' loses precision
      include/slot.h: In member function 'void support3d::Slot<T>::setController(support3d::ISlot*) [with T = int]':
      src/spheregeom.cpp:195:   instantiated from here
      include/slot.h:732: error: cast from 'support3d::ISlot*' to 'unsigned int' loses precision
      include/slot.h:741: error: cast from 'support3d::ISlot*' to 'unsigned int' loses precision
      include/slot.h:777: error: cast from 'support3d::ISlot*' to 'unsigned int' loses precision
      include/slot.h: In member function 'void support3d::Slot<T>::setController(support3d::ISlot*) [with T = double]':
      src/spheregeom.cpp:195:   instantiated from here
      include/slot.h:732: error: cast from 'support3d::ISlot*' to 'unsigned int' loses precision
      include/slot.h:741: error: cast from 'support3d::ISlot*' to 'unsigned int' loses precision
      include/slot.h:777: error: cast from 'support3d::ISlot*' to 'unsigned int' loses precision
      include/slot.h: In member function 'void support3d::Slot<T>::addDependent(support3d::Dependent*) [with T = support3d::vec3<double>]':
      src/spheregeom.cpp:195:   instantiated from here
      include/slot.h:783: error: cast from 'support3d::Dependent*' to 'int' loses precision
      include/slot.h: In member function 'void support3d::Slot<T>::setController(support3d::ISlot*) [with T = support3d::vec3<double>]':
      src/spheregeom.cpp:195:   instantiated from here
      include/slot.h:732: error: cast from 'support3d::ISlot*' to 'unsigned int' loses precision
      include/slot.h:741: error: cast from 'support3d::ISlot*' to 'unsigned int' loses precision
      src/spheregeom.cpp:195:   instantiated from here
      include/slot.h:777: error: cast from 'support3d::ISlot*' to 'unsigned int' loses precision
      scons: *** [obj/spheregeom.o] Error 1
      scons: building terminated because of errors.

      thanks for your help!  This is based on the subversion code.

       
    • Matthias Baas

      Matthias Baas - 2006-11-22

      The "error" is only generated by lines that do debug output. The easiest way to work around this is to modify the file supportlib/include/debuginfo.h and make all the DEBUGINFO macros empty. For example, instead of

      #define DEBUGINFO1(obj, txt, arg) if (_debug_on) { sprintf(_debug_buf, txt, arg); std::cerr<<"0x"<<std::hex<<(long)obj<<std::dec<<": "<<_debug_buf<<std::endl; }

      you could just write

      #define DEBUGINFO1(obj, txt, arg)

      - Matthias -

       
    • stephan steinbach

      Hi Matthias, that fixed it, thanks!

       

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks