Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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.
How to link async -io capability into a C program - for the sake of doing
async file/device i/o in user mode.
uname -r returns 4.11.3LnxKrnl (NO modifications to general at src-level - just adding two drivers) lsb_release -a returns Dist..ID: Ubuntu; Desc...: Ubuntu 16.04.2 LTS; Release: 16.04
I am working w/ Eclipse 3.8.1
The following code compiles:
#include <aio.h>
:::
rc = aio_write(&aio_cb);
rc = aio_read(&aio_cb);
rc = aio_error(&aio_cb);
rc = aio_return(&aio_cb);
I do not need event-posting or a completion routine.
I can wait for the results. I am exercising a new driver.
The linker fails to find the above entry points (undefined reference(s) to 'aio_xxx').
When i add -o aio.o these four entry points are found but there is over 100 newer link errors.
Many seem to be kernel/synchronization related (mutex, spin_lock_save_irql, kmap etc.)
It is preferable to link in libaio - i think.
I have executed sudo apt-get install libaio-dev.
Repeating i get libaio-dev is already ..... (0.3.110-2)
libaio.a is found in /usr/lib/i386-linux-gnu/libaio.a
In Eclipse i have Linker Flags: -l libaio.a ; Library search path /usr/lib/i386-linux-gnu
The same four entry point errors in the link persist.
What might i be missing?
Thanks in advance
Last edited by htfones; 10-04-2017 at 12:38 PM.
Reason: improvement to original Q.
How to link aio.o into an application - for the sake of doing async file/device i/o in user mode
You're missing a LOT of details that would let us even guess an answer to your question. Version/distro of Linux? What code you have now? What got you to asking about aio in the first place, etc. Read the "Question Guidelines" link in my posting signature.
Do not edit your posts; your first post was quoted in its entirety, in my reply (post #2). Doing such things makes it much harder for anyone to read/follow the thread.
Are you sure the aio.h file is in a path where your compiler can find it? Did you try to specify a path to the file?
I have solved the problem.
First let me be clear that i was able to compile the source code above w/ aio_xyz functions.
I was not able to link-edit.
It turns out that Eclipse was not honoring my linker flag(s).
It was necessary to run from the command line.
It was also necessary to set -laio last on the command line for the cc... command,
as was suggested by someone on Stackoverflow or somewhere similar.
A friend is suggesting SlickEdit as an IDE instead of Eclipse. ($$$)
I am relatively happy w/ Link+ for driver dev which runs on top of Eclipse.
Thanks and onward ...
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.