我正在尝试使用inotify在C ++程序中使用Linux 3.8内核检测Ubuntu 12.04操作系统上的文件系统更改。
当我用gcc编译程序时,它按预期工作。
但是当我使用g ++编译程序时,它会显示错误,如 -
inotify_test.cpp:23:21: error: ‘inotify_init’ was not declared in this scope
inotify_test.cpp:31:61: error: ‘inotify_add_watch’ was not declared in this scope
有关如何解决此问题的任何想法都表示赞赏。
P.S。一些互联网链接表明<sys/inotify.h>
的使用,但我没有该文件。我只有<linux/inotify.h>
。
谢谢!