0
J'ai un fichier .cpp super simple comme ci-dessous:linux C++: libaio.h ne contient pas de définition pour io_context_t?
$cat test001.cpp
#include<libaio.h>
int main(){
io_context_t ctx={0};
struct iocb io,*p=&io;
return 0;
}
Mais une fois le compiler avec gcc 4.1.2, il demande erreur:
$g++ test001.cpp -laio
test001.cpp:1:19: error: libaio.h: No such file or directory
test001.cpp: In function ‘int main()’:
test001.cpp:3: error: ‘io_context_t’ was not declared in this scope
test001.cpp:3: error: expected `;' before ‘ctx’
test001.cpp:4: error: aggregate ‘iocb io’ has incomplete type and cannot be defined
Eh bien, je suis déjà en utilisant " libaio.h ". Pourquoi cela échoue toujours?
Est-ce que ma réponse a résolu votre problème? –