Problem with __attribute__

Discussion in 'C++' started by Krzysztof Kolago, Nov 19, 2003.

  1. Hello!

    I've download some header files from Internet and I've tried to use them
    in my program, but Borland C++ Builder is stopping, when it reach this
    structure:

    struct fann_neuron
    {
    fann_type *weights;
    struct fann_neuron **connected_neurons;
    unsigned int num_connections;
    fann_type value;
    }__attribute__((packed));

    On the last line of this structure Builder wrote that there - before
    "packed" word - ")" was expected. How should I modificate header file, if I
    want to compile my program with success? Example programs' sources are
    stopping on the same line.

    Chris
     
    Krzysztof Kolago, Nov 19, 2003
    #1
    1. Advertising

  2. "Krzysztof Kolago" <> wrote...
    > I've download some header files from Internet and I've tried to use

    them
    > in my program, but Borland C++ Builder is stopping, when it reach this
    > structure:
    >
    > struct fann_neuron
    > {
    > fann_type *weights;
    > struct fann_neuron **connected_neurons;
    > unsigned int num_connections;
    > fann_type value;
    > }__attribute__((packed));
    >
    > On the last line of this structure Builder wrote that there - before
    > "packed" word - ")" was expected. How should I modificate header file, if

    I
    > want to compile my program with success? Example programs' sources are
    > stopping on the same line.


    Remove everything between the closing '}' and the ';'. The
    __attribute__ macro (my guess) is not standard C++. Probably
    the author of the code used a compiler that had that extension
    and you use one that doesn't.

    Victor
     
    Victor Bazarov, Nov 19, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. ritesh

    Error using '__attribute__'

    ritesh, May 18, 2006, in forum: C Programming
    Replies:
    5
    Views:
    399
    Jordan Abel
    May 18, 2006
  2. Replies:
    1
    Views:
    339
    Ian Collins
    Feb 28, 2007
  3. __attribute__ ((mode(__byte__)))

    , Oct 9, 2007, in forum: C Programming
    Replies:
    4
    Views:
    627
    Keith Thompson
    Oct 9, 2007
  4. nagaraj
    Replies:
    0
    Views:
    515
    nagaraj
    Apr 14, 2008
  5. parag
    Replies:
    0
    Views:
    222
    parag
    Jun 13, 2011
Loading...

Share This Page