2017-07-23 61 views
-1

在我的Raspberry Pi中编译SDL2时出现错误,我复制粘贴下面的日志。在Raspberry Pi上编译SDL2时出错3

/bin/bash build-scripts/updaterev.sh 
    CC  build/SDL_sndioaudio.lo 
/home/luca/SDL2/src/audio/sndio/SDL_sndioaudio.c: In function 'SNDIO_CaptureFromDevice': 
/home/luca/SDL2/src/audio/sndio/SDL_sndioaudio.c:187:46: error: 'INFTIM' undeclared (first use in this function) 
      || poll(this->hidden->pfd, nfds, INFTIM) < 0) { 
              ^
/home/luca/SDL2/src/audio/sndio/SDL_sndioaudio.c:187:46: 
note: each undeclared identifier is reported only once for each function it appears in 

我该如何解决这个问题?我在C语言中并不流利,曾尝试查看过手册,它说INFTIM也可能不在glibc中,这可能是它没有声明的原因。

编辑投票结束的人:如果不清楚,请展示你的脸并要求我澄清,而不是发送垃圾邮件。

回答

1
man poll 

说:

Some implementations define the nonstandard constant INFTIM with the value -1 

所以我添加

#define INFTIM -1 

在源文件的顶部。不知道这是最好的方法,但它的工作原理。