473,406 Members | 2,378 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

complile time error.

Hi All,
I had been compiling a program in gcc and I have been bogged down with
this error.
Any help is greatly appreciated.
uio_bits.h:44: error: expected constructor, destructor, or type
conversion before 'struct'

the uio_bit.h header file contains:
#ifndef _BITS_UIO_H
#define _BITS_UIO_H 1
#include <stdlib.h>
#include <sys/types.h>
/* We should normally use the Linux kernel header file to define this
type and macros but this calls for trouble because of the header
includes other kernel headers. */

/* Size of object which can be written atomically.

This macro has different values in different kernel versions. The
latest versions of the kernel use 1024 and this is good choice.
Since
the C library implementation of readv/writev is able to emulate the
functionality even if the currently running kernel does not support
this large value the readv/writev call will not fail because of
this. */
#define UIO_MAXIOV 1024
/* Structure for scatter/gather I/O. */
struct iovec
{
void *iov_base; /* Pointer to data. */
size_t iov_len; /* Length of data. */
};

#endif
Jan 15 '08 #1
4 1351
iceman wrote:
I had been compiling a program in gcc
Maybe you should try g++... :-) Just kidding.
and I have been bogged down with
this error.
Any help is greatly appreciated.
uio_bits.h:44: error: expected constructor, destructor, or type
conversion before 'struct'
You noticed "_before_ struct"? Have you tried outputting the
result of preprocessing your file? Do.
the uio_bit.h header file contains:
#ifndef _BITS_UIO_H
#define _BITS_UIO_H 1
Is this your file? If it's yours, the use of an identifier that
begins with an underscore and a capital letter is illegal - that
name is reserved by the implementation.
#include <stdlib.h>
#include <sys/types.h>
/* We should normally use the Linux kernel header file to define this
type and macros but this calls for trouble because of the header
includes other kernel headers. */

/* Size of object which can be written atomically.

This macro has different values in different kernel versions. The
latest versions of the kernel use 1024 and this is good choice.
Since
the C library implementation of readv/writev is able to emulate the
functionality even if the currently running kernel does not support
this large value the readv/writev call will not fail because of
this. */
#define UIO_MAXIOV 1024
/* Structure for scatter/gather I/O. */
struct iovec
{
void *iov_base; /* Pointer to data. */
size_t iov_len; /* Length of data. */
'size_t' is actually 'std::size_t' last time I looked, unless it's
typedef'ed or brought in with 'using'.
};

#endif
So, which line is 44?

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Jan 15 '08 #2
I'm betting the error is in whatever .c/.cpp file that is #include-ing
this header (immediately before it is included). Looking at
preprocessor output would help, but those files are usually really
long.
Jan 15 '08 #3
On Jan 15, 1:09 pm, "Victor Bazarov" <v.Abaza...@comAcast.netwrote:
iceman wrote:
I had been compiling a program in gcc

Maybe you should try g++... :-) Just kidding.
and I have been bogged down with
this error.
Any help is greatly appreciated.
uio_bits.h:44: error: expected constructor, destructor, or type
conversion before 'struct'

You noticed "_before_ struct"? Have you tried outputting the
result of preprocessing your file? Do.
the uio_bit.h header file contains:
#ifndef _BITS_UIO_H
#define _BITS_UIO_H 1

Is this your file? If it's yours, the use of an identifier that
begins with an underscore and a capital letter is illegal - that
name is reserved by the implementation.
#include <stdlib.h>
#include <sys/types.h>
/* We should normally use the Linux kernel header file to define this
type and macros but this calls for trouble because of the header
includes other kernel headers. */
/* Size of object which can be written atomically.
This macro has different values in different kernel versions. The
latest versions of the kernel use 1024 and this is good choice.
Since
the C library implementation of readv/writev is able to emulate the
functionality even if the currently running kernel does not support
this large value the readv/writev call will not fail because of
this. */
#define UIO_MAXIOV 1024
/* Structure for scatter/gather I/O. */
struct iovec
{
void *iov_base; /* Pointer to data. */
size_t iov_len; /* Length of data. */

'size_t' is actually 'std::size_t' last time I looked, unless it's
typedef'ed or brought in with 'using'.
};
#endif

So, which line is 44?

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask


No this is not my file but I am using this as header file.
line 44 is
struct iovec
Jan 15 '08 #4
Victor Bazarov wrote:
iceman wrote:
[...]
extern ssize_t writev (int __fd, __const struct iovec *__iovec, int
WTH is 'ssize_t'?
Something else defined in the parts of the pre-processor
expansion he didn't show. (FWIW, it's a typedef defined by
Posix. *NOT* on topic here, of course, unless it's related to
some other real C++ problem.)

--
James Kanze (GABI Software) email:ja*********@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
Jan 15 '08 #5

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

Similar topics

18
by: Ken | last post by:
Hi. Can anyone refer me to any articles about the compatibility between c++ polymorphism and real-time programming? I'm currently on a real-time c++ project, and we're having a discussion...
15
by: JustSomeGuy | last post by:
this doesn't want to compile.... class image : public std::list<element> { element getElement(key k) const { image::iterator iter; for (iter=begin(); iter != end(); ++iter) { element...
1
by: Alfonso Morra | last post by:
Hi I'm compiling some code and need to generate some random numbers. To save time, I decided to use the srand, rand and time functions. My code worked (atleast built fine) until I added time.h,...
9
by: ThunderMusic | last post by:
Hi, I'd like to create a compile time error in my class... maybe there's a way already built in in the framework so I can achieve what I want... I have 2 constructors in my class. One of them...
1
by: PVBHANU | last post by:
Hi, I am using DB2 V9.1 windows , can any one please tell me how to complile and execute a stored procedure. I followed Alldatabse->database->Application Object->stored procedure...But No...
0
by: Long March | last post by:
hi all, How to fix the error C2893 complile with VC++6.0? Thank you. Code below: #include <iostream> using namespace std;
3
by: jlgraham | last post by:
This is the first course I have ever taken in any programming language. This is my last assignment and totally frustrated. My employee class compiled but get 1 error when I tried to compile my...
4
by: ahmurad | last post by:
Dear Xperts, In my database table some fault code type records are inserted and the values are like bellows: Error:2/FC:10; 00:15:13 16/03/2009; Error:2/FC:20; 00:15:15 16/03/2009; ...
0
hyperpau
by: hyperpau | last post by:
Before anything else, I am not a very technical expert when it comes to VBA coding. I learned most of what I know by the excellent Access/VBA forum from bytes.com (formerly thescripts.com). Ergo, I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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...
0
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
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,...
0
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...

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.