我们在使用libaio库的时候,在编译时可能会报如下错:
undefined reference to ‘io_getevents’
undefined reference to ‘io_setup’
undefined reference to ‘io_submit’
这时,只需要在编译中要加 '-laio’参数即可
同样的还有thread,如报如下错:
undefined reference to ‘pthread_create’
undefined reference to ‘pthread_join’
加’-lpthread’参数即可
g++ -O2 test.c -o test -laio -lpthread