Trouble Compiling 1394 Development Libraries for Linux

This is a discussion on Trouble Compiling 1394 Development Libraries for Linux within the Linux Programming forums, part of the Platform Specific Boards category; I recently the dc1394 development package, libdc1394-devel, from the OpenSUSE mirror http://download.opensuse.org/distrib...10.2/repo/oss/ This library is install in the /usr/include/dc1394 directory ...

  1. #1
    Registered User
    Join Date
    Oct 2007
    Posts
    33

    Trouble Compiling 1394 Development Libraries for Linux

    I recently the dc1394 development package, libdc1394-devel, from the OpenSUSE mirror http://download.opensuse.org/distrib...10.2/repo/oss/

    This library is install in the /usr/include/dc1394 directory off of the root, and includes a header file named dc1394_control.h Whenever I try to compile code that includes this library, I get the following errors

    /usr/include/dc1394/dc1394_control.h:266: error: expected identifier before numeric constant
    /usr/include/dc1394/dc1394_control.h:266: error: expected `}' before numeric constant
    /usr/include/dc1394/dc1394_control.h:266: error: expected unqualified-id before numeric constant
    /usr/include/dc1394/dc1394_control.h:300: error: expected declaration before ‘}’ token

    Which is related to the beginning and end of a block in dc1394_control.h of code I have posted below

    Code:
    typedef enum {
      DC1394_SUCCESS = 0,   /* Success is zero */              //This is line 266
      DC1394_FAILURE,       /* Errors are positive numbers */
      DC1394_NO_FRAME = -2, /* Warnings or info are negative numbers */
      DC1394_NO_CAMERA = 3,
      DC1394_NOT_A_CAMERA,
      DC1394_FUNCTION_NOT_SUPPORTED,
      DC1394_CAMERA_NOT_INITIALIZED,
      DC1394_INVALID_FEATURE,
      DC1394_INVALID_VIDEO_FORMAT,
      DC1394_INVALID_VIDEO_MODE,
      DC1394_INVALID_FRAMERATE,
      DC1394_INVALID_TRIGGER_MODE,
      DC1394_INVALID_TRIGGER_SOURCE,
      DC1394_INVALID_ISO_SPEED,
      DC1394_INVALID_IIDC_VERSION,
      DC1394_INVALID_COLOR_CODING,
      DC1394_INVALID_COLOR_FILTER,
      DC1394_INVALID_CAPTURE_MODE,
      DC1394_REQ_VALUE_OUTSIDE_RANGE,
      DC1394_INVALID_ERROR_CODE,
      DC1394_MEMORY_ALLOCATION_FAILURE,
      DC1394_TAGGED_REGISTER_NOT_FOUND,
      DC1394_FORMAT7_ERROR_FLAG_1,
      DC1394_FORMAT7_ERROR_FLAG_2,
      DC1394_INVALID_BAYER_METHOD,
      DC1394_INVALID_ARGUMENT_VALUE,
      DC1394_INVALID_VIDEO1394_DEVICE,
      DC1394_NO_ISO_CHANNEL,
      DC1394_NO_BANDWIDTH,
      DC1394_IOCTL_FAILURE,
      DC1394_CAPTURE_IS_NOT_SET = -30,
      DC1394_RAW1394_CAPTURE_FAILURE = 31,
      DC1394_CAPTURE_IS_RUNNING,
      DC1394_RAW1394_FAILURE
    } dc1394error_t;                                                            //This is line 300
    #define DC1394_ERROR_NUM DC1394_RAW1394_FAILURE+1
    There are numerous typedef enum statements through this header that are almost identical in structure, but this is the only one producing errors. Not sure if that might be because I am not using the rest of the typedef enum statements in my actual code.

    I cannot figure out what is wrong with this code. Any help would be greatly appreciated.

    Thanks.

  2. #2
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,670
    I would guess that the problem is before that line - if not before that header is even included. If you are including any of your own headers before that one, look there first. You can also try including the file with a simple "hello world" app to see if there's truly a problem in that header.

    gg

  3. #3
    Registered User
    Join Date
    Oct 2007
    Posts
    33
    Ok, I moved the declaration of the header dc1394_control.h before the headers in libdc1394, and that seems to have corrected the problem. New errors have shown up, but they do not appear to have anything to do with the library.

    Thanks for the help.

  4. #4
    Registered User
    Join Date
    Oct 2007
    Posts
    33
    Nevermind, it is now even WORSE than before. Somehow I missed the hoard of error messages that appear when I moved the header before others in the library.

  5. #5
    Registered User
    Join Date
    Oct 2007
    Posts
    33
    Ok, I found a least part of the problem. Before I had correctly installed the dc1394 libraries: libdc1394, libraw1394, libdc1394-devel, and libraw1394-devel from the proper http Linux mirror, and had installed them from an ftp server. The ftp server put these libraries in the /usr/local/include folder while the http server put them in the /usr/include folder.

    The compiler is apparently trying to access both versions of these libraries, resulting in problems. I have since deleted the set in /usr/local/include from the root account. But unfortunately that has not eliminated the problem.

    When I attempt to compile the code, I am getting a bunch of 'conflicting_declaration' errors, like:

    Code:
    /usr/include/libdc1394/dc1394_control.h:275: error: conflicting declaration ‘DC1394_FALSE’
    /usr/include/dc1394/dc1394_control.h:329: error: ‘DC1394_FALSE’ has a previous declaration as ‘dc1394bool_t DC1394_FALSE’
    I am not sure why these errors are still there. Does anyone have a better understanding of such errors? Thanks.

  6. #6
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,893
    Look at the paths of the two files. You still have two conflicting installations of the same or sufficiently similar libraries.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  7. #7
    Registered User
    Join Date
    Oct 2007
    Posts
    33
    Good point. The problem is those two libraries are part of the libdc1394 and libdc1394-devel, I need both of them as far as I can tell. I will have to see what I can do about them.

    Thanks for the help.

    Edit: It looks like libdc1394 is redundant. I commented out the header file associated with libdc1394, I that omitted the errors and all the functions and constructs I need appear to be defined.

    Edit: I was wrong again. The two header files are not quite redundant. I needed to add a couple of dc1394 functions only to find out I need libdc1394/dc1394_control.h to use them. It appears that there are functions I need from both libraries, but they don't want to run correctly together.
    Last edited by Phanixis; 10-05-2007 at 11:57 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. having some trouble with function libraries
    By Niss in forum C Programming
    Replies: 9
    Last Post: 11-11-2008, 04:49 AM
  2. trouble compiling
    By the Wookie in forum Linux Programming
    Replies: 1
    Last Post: 10-26-2005, 10:12 PM
  3. trouble compiling
    By chris285 in forum C++ Programming
    Replies: 5
    Last Post: 04-27-2003, 10:40 AM
  4. I am Having trouble Compiling with DirectX
    By Irish-Slasher in forum Game Programming
    Replies: 4
    Last Post: 03-14-2002, 08:51 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21