libdc1394 2.x and g++4.3.x

Help
hennes
2008-06-22
2013-05-09
  • hennes

    hennes - 2008-06-22

    Hi.

    1. Are there any plans on porting your code to work with version 2.x of libdc1394? There have been several changes to the API as documented here:

    http://damien.douxchamps.net/ieee1394/libdc1394/v1.x/migration/

    2. The code doesn't compile here which I think is related to the changes in g++'s header management. See here for more info:

    http://gcc.gnu.org/gcc-4.3/porting_to.html

    I had to change several #include directives to make it compile (finally it hangs because of libdc1394).

    Regards,

    Johannes.

     
    • hennes

      hennes - 2008-06-22

      Ok, I got it to compile here with version 1.2.2 of libdc1394. The following patch summarizes the changes I needed to make it compile with g++ 4.3.1. Might be helpful to you. Note that the -I/opt/qt/include I added in Makefile.base isn't important to you. I just needed it because my Qt installation resides in /opt.

      Cheers,

      Johannes.

      ---Patch------------------------------------------------------------------------

      diff -aur old/src/Calibration/Rectification.cpp new/src/Calibration/Rectification.cpp
      --- old/src/Calibration/Rectification.cpp    2008-06-03 14:51:27.000000000 +0200
      +++ new/src/Calibration/Rectification.cpp    2008-06-21 21:56:34.061414830 +0200
      @@ -43,6 +43,8 @@
      #include "Calibration/StereoCalibrationCV.h"
      #include "Helpers/helpers.h"

      +#include <cstdio>
      +

      // *****************************************************************
      diff -aur old/src/Color/ColorParameterSet.cpp new/src/Color/ColorParameterSet.cpp
      --- old/src/Color/ColorParameterSet.cpp    2008-06-03 14:51:27.000000000 +0200
      +++ new/src/Color/ColorParameterSet.cpp    2008-06-21 20:56:47.091770503 +0200
      @@ -38,7 +38,7 @@
      #include "ColorParameterSet.h"

      #include <stdio.h>
      -#include <string>
      +#include <cstring>

      diff -aur old/src/Color/HistogramColorSegmenter.cpp new/src/Color/HistogramColorSegmenter.cpp
      --- old/src/Color/HistogramColorSegmenter.cpp    2008-06-03 14:51:27.000000000 +0200
      +++ new/src/Color/HistogramColorSegmenter.cpp    2008-06-21 20:59:54.459784534 +0200
      @@ -42,6 +42,7 @@
      #include "Helpers/helpers.h"

      #include <stdio.h>
      +#include <cstring>

      diff -aur old/src/DataStructures/KdTree/KdTree.cpp new/src/DataStructures/KdTree/KdTree.cpp
      --- old/src/DataStructures/KdTree/KdTree.cpp    2008-06-03 14:51:28.000000000 +0200
      +++ new/src/DataStructures/KdTree/KdTree.cpp    2008-06-21 21:00:32.521745722 +0200
      @@ -49,6 +49,7 @@
      #include <stdio.h>
      #include <float.h>
      #include <math.h>
      +#include <cstring>

      diff -aur old/src/Helpers/BasicFileIO.cpp new/src/Helpers/BasicFileIO.cpp
      --- old/src/Helpers/BasicFileIO.cpp    2008-06-03 14:51:28.000000000 +0200
      +++ new/src/Helpers/BasicFileIO.cpp    2008-06-21 20:56:55.025106543 +0200
      @@ -36,6 +36,8 @@
      // includes
      // *****************************************************************
      #include "BasicFileIO.h"
      +#include <cstdlib>
      +#include <cstring>

      // **************************************************************
      diff -aur old/src/Helpers/Configuration.cpp new/src/Helpers/Configuration.cpp
      --- old/src/Helpers/Configuration.cpp    2008-06-03 14:51:28.000000000 +0200
      +++ new/src/Helpers/Configuration.cpp    2008-06-21 20:58:06.912195025 +0200
      @@ -38,8 +38,9 @@

      #include "Configuration.h"

      -#include <string>
      +#include <cstring>
      #include <stdio.h>
      +#include <cstdlib>

      ////////////////////////////////////////////////////////////////////
      diff -aur old/src/Image/ImageProcessor.cpp new/src/Image/ImageProcessor.cpp
      --- old/src/Image/ImageProcessor.cpp    2008-06-03 14:51:28.000000000 +0200
      +++ new/src/Image/ImageProcessor.cpp    2008-06-21 20:53:46.859324412 +0200
      @@ -54,6 +54,7 @@
      #include <stdio.h>
      #include <memory.h>
      #include <math.h>
      +#include <cstdlib>

      #define HARRIS_WINDOW_SIZE        5
      diff -aur old/src/Image/StereoVision.cpp new/src/Image/StereoVision.cpp
      --- old/src/Image/StereoVision.cpp    2008-06-03 14:51:28.000000000 +0200
      +++ new/src/Image/StereoVision.cpp    2008-06-21 20:54:18.770235770 +0200
      @@ -44,6 +44,7 @@
      #include <memory.h>
      #include <math.h>
      #include <stdio.h>
      +#include <cstdlib>

      diff -aur old/src/Makefile.base new/src/Makefile.base
      --- old/src/Makefile.base    2008-06-03 14:51:21.000000000 +0200
      +++ new/src/Makefile.base    2008-06-21 22:18:40.432132105 +0200
      @@ -1,4 +1,4 @@
      -INCPATHS_BASE = -I../../src
      +INCPATHS_BASE = -I../../src -I/opt/qt/include
      LIBPATHS_BASE =
      LIBS_BASE =
      LDFLAGS =
      diff -aur old/src/Math/FloatMatrix.cpp new/src/Math/FloatMatrix.cpp
      --- old/src/Math/FloatMatrix.cpp    2008-06-03 14:51:28.000000000 +0200
      +++ new/src/Math/FloatMatrix.cpp    2008-06-21 20:56:35.262267411 +0200
      @@ -39,8 +39,8 @@
      #include "Helpers/helpers.h"

      #include <stdio.h>
      -#include <string>
      -
      +#include <cstring>
      +#include <cstdlib>

      diff -aur old/src/Tracking/ObjectPose.cpp new/src/Tracking/ObjectPose.cpp
      --- old/src/Tracking/ObjectPose.cpp    2008-06-03 14:51:29.000000000 +0200
      +++ new/src/Tracking/ObjectPose.cpp    2008-06-21 21:56:07.134745732 +0200
      @@ -51,6 +51,7 @@
      #include "Calibration/Calibration.h"

      #include <math.h>
      +#include <cstdio>

      // *****************************************************************
      diff -aur old/src/VideoCapture/BitmapSequenceCapture.cpp new/src/VideoCapture/BitmapSequenceCapture.cpp
      --- old/src/VideoCapture/BitmapSequenceCapture.cpp    2008-06-03 14:51:29.000000000 +0200
      +++ new/src/VideoCapture/BitmapSequenceCapture.cpp    2008-06-21 20:58:38.246647670 +0200
      @@ -38,6 +38,7 @@
      #include "BitmapSequenceCapture.h"
      #include "Image/ImageProcessor.h"
      #include "Image/ByteImage.h"
      +#include <cstdlib>

      diff -aur old/src/VideoCapture/Linux1394Capture.cpp new/src/VideoCapture/Linux1394Capture.cpp
      --- old/src/VideoCapture/Linux1394Capture.cpp    2008-06-03 14:51:29.000000000 +0200
      +++ new/src/VideoCapture/Linux1394Capture.cpp    2008-06-21 21:47:32.048135770 +0200
      @@ -48,6 +48,7 @@
      #include <stdio.h>
      #include <stdlib.h>
      #include <stdarg.h>
      +#include <algorithm>

      // *****************************************************************
      diff -aur old/src/Visualizer/OpenGLVisualizer.cpp new/src/Visualizer/OpenGLVisualizer.cpp
      --- old/src/Visualizer/OpenGLVisualizer.cpp    2008-06-03 14:51:29.000000000 +0200
      +++ new/src/Visualizer/OpenGLVisualizer.cpp    2008-06-21 21:55:31.951416334 +0200
      @@ -61,6 +61,7 @@
      #endif

      #include <math.h>
      +#include <cstdio>

       
    • Pedram Azad

      Pedram Azad - 2008-06-22

      Hi,

      there is already an implementation of a camera module for the version 2.x of libdc1394 (CLinux1394Capture2).  You can switch it on in Makefile.base with the parameter USE_LIBDC1394_V2, and make sure to unset USE_LIBDC1394 then.

      Thanks for the diff. I wasn't aware of other includes that are necessary for g++ 4.3.x. We had already tested with g++ 4.1.2 and it worked just fine. I will consider you're diff in the next version.

      Pedram

       
    • hennes

      hennes - 2008-06-22

      Hi.

      Yes, I just found that switch myself. Sorry, don't know how I could miss it. Works fine now. And the file src/VideoCapture/Linux1394Capture2.cpp also needs an extra #include <algorithm> to compile here.

      Johannes.

       

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

Sign up for the SourceForge newsletter:





No, thanks