这是重现的最小C程序:
#include <alsa/asoundlib.h>
#include <sys/time.h>
int main( void )
{
}
Run Code Online (Sandbox Code Playgroud)
这将编译gcc -c -o timealsa.o timealsa.c,但如果您包含该-std=c99开关,则会出现重新定义错误:
In file included from /usr/include/sys/time.h:28:0,
from timealsa.c:3:
/usr/include/bits/time.h:30:8: error: redefinition of ‘struct timeval’
struct timeval
^
In file included from /usr/include/alsa/asoundlib.h:49:0,
from timealsa.c:2:
/usr/include/alsa/global.h:138:8: note: originally defined here
struct timeval {
^
Run Code Online (Sandbox Code Playgroud)
如何在仍然使用时解决此冲突-std=c99?
Rust 是否有tee(2)instd::io或其他绑定?如果没有绑定,我将如何在 Rust 程序中获得该功能?