ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I'm trying to get started with AIO, but I'm having trouble. Whenever I include linux/aio.h I get all sorts of compiler errors, mostly involving incomplete and undeclared types inside the headers that aio.h includes.
In file included from /usr/include/linux/workqueue.h:8,
from /usr/include/linux/aio.h:5,
from ../include/filesystem/aio_helper.h:5,
from ../include/filesystem/filesystem.h:9,
from filesystem/filesystem.cpp:1:
/usr/include/linux/timer.h:12: error: field `entry' has incomplete type
/usr/include/linux/timer.h:35: error: syntax error before `(' token
/usr/include/linux/timer.h: In function `int timer_pending(const timer_list*)':
/usr/include/linux/timer.h:49: error: 'const struct timer_list' has no member
named 'entry'
In file included from /usr/include/linux/aio.h:5,
from ../include/filesystem/aio_helper.h:5,
from ../include/filesystem/filesystem.h:9,
from filesystem/filesystem.cpp:1:
/usr/include/linux/workqueue.h: At global scope:
/usr/include/linux/workqueue.h:16: error: field `entry' has incomplete type
In file included from /usr/include/asm/system.h:8,
from /usr/include/asm-i486/processor.h:18,
from /usr/include/asm/processor.h:8,
from /usr/include/asm-i486/atomic.h:6,
from /usr/include/asm/atomic.h:8,
from /usr/include/linux/aio.h:8,
from ../include/filesystem/aio_helper.h:5,
from ../include/filesystem/filesystem.h:9,
from filesystem/filesystem.cpp:1:
/usr/include/asm-i486/system.h:247: error: syntax error before `new'
/usr/include/asm-i486/system.h: In function `long unsigned int __cmpxchg(...)':
/usr/include/asm-i486/system.h:250: error: `size' undeclared (first use this
function)
/usr/include/asm-i486/system.h:250: error: (Each undeclared identifier is
reported only once for each function it appears in.)
/usr/include/asm-i486/system.h:254: error: syntax error before `)' token
/usr/include/asm-i486/system.h:260: error: syntax error before `)' token
/usr/include/asm-i486/system.h:266: error: syntax error before `)' token
/usr/include/asm-i486/system.h:270: error: `old' undeclared (first use this
function)
In file included from /usr/include/asm/processor.h:8,
from /usr/include/asm-i486/atomic.h:6,
from /usr/include/asm/atomic.h:8,
from /usr/include/linux/aio.h:8,
from ../include/filesystem/aio_helper.h:5,
from ../include/filesystem/filesystem.h:9,
from filesystem/filesystem.cpp:1:
/usr/include/asm-i486/processor.h: In function `void load_esp0(tss_struct*,
thread_struct*)':
/usr/include/asm-i486/processor.h:486: error: `unlikely' undeclared (first use
this function)
In file included from ../include/filesystem/aio_helper.h:5,
from ../include/filesystem/filesystem.h:9,
from filesystem/filesystem.cpp:1:
/usr/include/linux/aio.h: At global scope:
/usr/include/linux/aio.h:47: error: field `ki_run_list' has incomplete type
/usr/include/linux/aio.h:58: error: field `ki_list' has incomplete type
/usr/include/linux/aio.h:72: error: 'wait_queue_t' is used as a type, but is
not defined as a type.
/usr/include/linux/aio.h:77: error: syntax error before `private'
/usr/include/linux/aio.h:139: error: syntax error before `;' token
/usr/include/linux/aio.h:144: error: field `active_reqs' has incomplete type
/usr/include/linux/aio.h:145: error: field `run_list' has incomplete type
/usr/include/linux/aio.h: In function `kiocb* list_kiocb(list_head*)':
/usr/include/linux/aio.h:194: error: syntax error before `,' token
/usr/include/linux/aio.h:194: error: `ki_list' undeclared (first use this
function)
/usr/include/linux/aio.h:194: error: `list_entry' undeclared (first use this
function)
Here's the entire contents of the file that includes the header:
Code:
#ifndef AIO_HELPER
#define AIO_HELPER
#if defined linux
# include <linux/aio.h>
#endif
namespace FileSystem
{
#if defined linux
// linux version of the class
class AIOHelper
{
public:
};
#endif
};
#endif // AIO_HELPER
There's not much there. Even if I create a blank .cpp file that looks like this:
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.