で
#include <alsa/asoundlib.h>
#include <sys/time.h>
int main(void)
{
}
これは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 {
^
まだ-std=c99
を使用しながら、どのように私はこの競合を解決することができますか?
** main main(void){return 0;} ** – Michi
はい、あなたは正しいですが(それはもう一つの行です) – Lombard
@Michi the return 0' _C99_に存在しない場合は暗黙的です(この質問にタグが付いている場合)。参照:http://stackoverflow.com/questions/4138649/why-is-return-0-optional。しかし、空白は問題です。 –