473,499 Members | 1,510 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem with __attribute__

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
Jul 22 '05 #1
1 4433
"Krzysztof Kolago" <kr**************@wp.pl> 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
Jul 22 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

20
1915
by: Thomas.Chang | last post by:
Hi, As we know, the compiler will pad structure to make it align on 4 byte boundaries. I got a structure like this. typedef struct{ uint8 a; uint8 b; uint8 c; uint16 d;
5
2392
by: ritesh | last post by:
Hi, I'm compiling the following code on linux/cc and keep getting a compiler error "attrib.c:4: syntax error before '{' token" I'm using the following options to compile - cc -Wall -c...
1
1551
by: timor.super | last post by:
Hi all, in a .c file, i'm using a var : const unsigned char myVar __attribute__ ((aligned (4))) = {1, 2, 2, 1, 2, 2, 2}; this var is used by a C function : myCFunction(myVar) ... this is...
14
2837
by: arnuld | last post by:
i have slightly modified the programme from section 1.5.1 which takes the input frm keyboard and then prints that to the terminal. it just does not run and i am unable to understand the error...
4
6270
by: Subra | last post by:
Hi, in a cpp file we are including <cstdliband indirectly including <stdlib.h>. But the definition for "strtoll" is not appearing in the .ii file generated using the -E option to gcc. ...
2
2226
by: JeromeArbezGindre | last post by:
Hi, I would like to map an enum on a byte,so here is my code: enum my_enum { A = 1, B = 2, } __attribute__ ((mode(__byte__))) ;
7
70254
by: singhPrabhat | last post by:
Hi, I am using gcc (GCC) 4.2.1 (SUSE Linux). SUSE 10.3 While compiling a .c file I get following error :::: CCWebConfiguration.h:70: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or...
18
5258
by: Eric | last post by:
Ok...this seems to be treading into some really esoteric areas of c++. I will do my best to explain this issue, but I don't fully understand what is happening myself. I am hoping that the problem...
10
31926
by: anju1401 | last post by:
Hi I am using WINAVR compiler for ATMEGA32. While compiling c progam , I am getting the error error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before '{' token before evrey function. ...
0
7130
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7007
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7220
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6893
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7386
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5468
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4918
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3098
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1427
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.