인텔 에디슨에서 장치 (iOS 및 Android)로 사운드를 스트리밍하기 위해 C 프로그램을 컴파일하는 데 몇 가지 문제가 있습니다.여러 헤더에서 'struct timeval'을 재정의했습니다.
C 프로그램을 만들었습니다 :내 프로그램에서 alsa/asoundlib.h와 pthread.h를 사용합니다. ALSA가 이것을 허용하지 않기 때문에 sys/time.h를 포함하지 않습니다.
gcc -std=c99 -Wall -O0 -ggdb -o sender sender.c spsc_circular_queue.c -lopus -lasound -lpthread
In file included from /usr/include/alsa/asoundlib.h:49:0,
from sender.c:16:
/usr/include/alsa/global.h:145:8: error: redefinition of 'struct timespec'
struct timespec {
^
In file included from /usr/include/alsa/global.h:34:0,
from /usr/include/alsa/asoundlib.h:49,
from sender.c:16:
/usr/include/time.h:120:8: note: originally defined here
struct timespec
^
In file included from /usr/include/time.h:41:0,
from /usr/include/sched.h:34,
from sender.c:18:
/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 sender.c:16:
/usr/include/alsa/global.h:140:8: note: originally defined here
struct timeval {
^
Makefile:16: recipe for target 'sender' failed
make: *** [sender] Error 1
어떻게 이러한 redifinitions을 중지 관리 할 수 있습니다 : 나는 경우
내 에디슨에 내가 i'ts 잘 컴파일 내 컴퓨터에서 컴파일 할 때, 내 프로그램에 timeval 형을 많이 사용하지만?! 도움을 주셔서 감사합니다.
추가 정보 :
는 I은 다음과 같습니다 : 나는 sched.h에 제거 아무것도
'/ usr/include/sched.h'는'/ usr/include/time.h'를 포함하는 18 번째 줄의 sender.c에 포함 시켰습니다. – mch
이것을 제거하지 않으려면 다음을 포함하십시오 : – maathor
'#include'을 수행 한'#include '을 수행했습니다. 그것이 문제이다. '#include '을 제거하면 오류 메시지가 변경되어 다음 문제로 연결됩니다. –
mch