undefined reference to 'lio_listio' [posix asynchronous I/O]
Question
I am trying to use POSIX API 'lio_listio' in my program to issue multiple asynchronous I/O system calls with the overhead of 1 kernel context switch.
I have included the library aio.h and also compiled my code with -laio flag. Also I have libaio_devel package installed.
Still when I compile my program it gives the following compilation error:
/home/me/bon/bon.cpp:2509: undefined reference to `lio_listio'
Can someone please suggest what is my I missing.
Solution
You are missing -lrt
, most likely.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow