Trouble building alsa-lib
Hi all,
I'm trying to build alsa from source. I'm guessing (I was not able to find any instructions on how to build alsa) that I build alsa-lib first. I'm compiling it with gcc 4.2.1. However, when I build it, I get the following errors:
In file included from ../../include/local.h:105,
from control_local.h:22,
from cards.c:35:../../include/sound/asound.h:148: warning: implicit declaration of function '_IO
R'../../include/sound/asound.h:148: error: expected expression before 'int' ../../include/sound/asound.h:148: error: enumerator value for 'SNDRV_HWDEP_IOCTL_PVERSION' is not an integer constant ../../include/sound/asound.h:149: error: expected expression before 'struct' ../../include/sound/asound.h:149: error: enumerator value for 'SNDRV_HWDEP_IOCTL_INFO' is not an integer constant ../../include/sound/asound.h:150: error: expected expression before 'struct' ../../include/sound/asound.h:150: error: enumerator value for 'SNDRV_HWDEP_IOCTL_DSP_STATUS' is not an integer constant ../../include/sound/asound.h:151: warning: implicit declaration of function '_IO
W'../../include/sound/asound.h:151: error: expected expression before 'struct' ../../include/sound/asound.h:152: error: enumerator value for 'SNDRV_HWDEP_IOCTL_DSP_LOAD' is not an integer constant ../../include/sound/asound.h:471: error: expected expression before 'int' ../../include/sound/asound.h:471: error: enumerator value for 'SNDRV_PCM_IOCTL_P
VERSION' is not an integer constant ../../include/sound/asound.h:472: error: expected expression before 'struct' ../../include/sound/asound.h:472: error: enumerator value for 'SNDRV_PCM_IOCTL_I
NFO' is not an integer constant ../../include/sound/asound.h:473: error: expected expression before 'int' ../../include/sound/asound.h:473: error: enumerator value for 'SNDRV_PCM_IOCTL_T
STAMP' is not an integer constant ../../include/sound/asound.h:474: error: expected expression before 'int' ../../include/sound/asound.h:474: error: enumerator value for 'SNDRV_PCM_IOCTL_T
TSTAMP' is not an integer constant ../../include/sound/asound.h:475: warning: implicit declaration of function '_IO
WR'../../include/sound/asound.h:475: error: expected expression before 'struct' ../../include/sound/asound.h:475: error: enumerator value for 'SNDRV_PCM_IOCTL_HW_REFINE' is not an integer constant ../../include/sound/asound.h:476: error: expected expression before 'struct' ../../include/sound/asound.h:476: error: enumerator value for 'SNDRV_PCM_IOCTL_HW_PARAMS' is not an integer constant ../../include/sound/asound.h:477: warning: implicit declaration of function '_IO
'../../include/sound/asound.h:477: error: enumerator value for 'SNDRV_PCM_IOCTL_HW_FREE' is not an integer constant ../../include/sound/asound.h:478: error: expected expression before 'struct' ../../include/sound/asound.h:478: error: enumerator value for 'SNDRV_PCM_IOCTL_SW_PARAMS' is not an integer constant ../../include/sound/asound.h:479: error: expected expression before 'struct' ../../include/sound/asound.h:479: error: enumerator value for 'SNDRV_PCM_IOCTL_S
TATUS' is not an integer constant ../../include/sound/asound.h:480: error: expected expression before 'sndrv_pcm_sframes_t'../../include/sound/asound.h:480: error: enumerator value for 'SNDRV_PCM_IOCTL_D
ELAY' is not an integer constant ../../include/sound/asound.h:481: error: enumerator value for 'SNDRV_PCM_IOCTL_H
WSYNC' is not an integer constant ../../include/sound/asound.h:482: error: expected expression before 'struct' ../../include/sound/asound.h:482: error: enumerator value for 'SNDRV_PCM_IOCTL_SYNC_PTR' is not an integer constant ../../include/sound/asound.h:483: error: expected expression before 'struct' ../../include/sound/asound.h:483: error: enumerator value for 'SNDRV_PCM_IOCTL_CHANNEL_INFO' is not an integer constant ../../include/sound/asound.h:484: error: enumerator value for 'SNDRV_PCM_IOCTL_P
REPARE' is not an integer constant ../../include/sound/asound.h:485: error: enumerator value for 'SNDRV_PCM_IOCTL_R
ESET' is not an integer constant ../../include/sound/asound.h:486: error: enumerator value for 'SNDRV_PCM_IOCTL_S
TART' is not an integer constant ../../include/sound/asound.h:487: error: enumerator value for 'SNDRV_PCM_IOCTL_D
ROP' is not an integer constant ../../include/sound/asound.h:488: error: enumerator value for 'SNDRV_PCM_IOCTL_D
RAIN' is not an integer constant ../../include/sound/asound.h:489: error: expected expression before 'int' ../../include/sound/asound.h:489: error: enumerator value for 'SNDRV_PCM_IOCTL_P
AUSE' is not an integer constant ../../include/sound/asound.h:490: error: expected expression before 'sndrv_pcm_uframes_t'../../include/sound/asound.h:490: error: enumerator value for 'SNDRV_PCM_IOCTL_R
EWIND' is not an integer constant ../../include/sound/asound.h:491: error: enumerator value for 'SNDRV_PCM_IOCTL_R
ESUME' is not an integer constant ../../include/sound/asound.h:492: error: enumerator value for 'SNDRV_PCM_IOCTL_X
RUN' is not an integer constant ../../include/sound/asound.h:493: error: expected expression before 'sndrv_pcm_uframes_t'../../include/sound/asound.h:493: error: enumerator value for 'SNDRV_PCM_IOCTL_F
ORWARD' is not an integer constant ../../include/sound/asound.h:494: error: expected expression before 'struct' ../../include/sound/asound.h:494: error: enumerator value for 'SNDRV_PCM_IOCTL_WRITEI_FRAMES' is not an integer constant ../../include/sound/asound.h:495: error: expected expression before 'struct' ../../include/sound/asound.h:495: error: enumerator value for 'SNDRV_PCM_IOCTL_READI_FRAMES' is not an integer constant ../../include/sound/asound.h:496: error: expected expression before 'struct' ../../include/sound/asound.h:496: error: enumerator value for 'SNDRV_PCM_IOCTL_WRITEN_FRAMES' is not an integer constant ../../include/sound/asound.h:497: error: expected expression before 'struct' ../../include/sound/asound.h:497: error: enumerator value for 'SNDRV_PCM_IOCTL_READN_FRAMES' is not an integer constant ../../include/sound/asound.h:498: error: expected expression before 'int' ../../include/sound/asound.h:498: error: enumerator value for 'SNDRV_PCM_IOCTL_L
INK' is not an integer constant ../../include/sound/asound.h:499: error: enumerator value for 'SNDRV_PCM_IOCTL_U
NLINK' is not an integer constant ../../include/sound/asound.h:558: error: expected expression before 'int' ../../include/sound/asound.h:558: error: enumerator value for 'SNDRV_RAWMIDI_IOCTL_PVERSION' is not an integer constant ../../include/sound/asound.h:559: error: expected expression before 'struct' ../../include/sound/asound.h:559: error: enumerator value for 'SNDRV_RAWMIDI_IOCTL_INFO' is not an integer constant ../../include/sound/asound.h:560: error: expected expression before 'struct' ../../include/sound/asound.h:560: error: enumerator value for 'SNDRV_RAWMIDI_IOCTL_PARAMS' is not an integer constant ../../include/sound/asound.h:561: error: expected expression before 'struct' ../../include/sound/asound.h:561: error: enumerator value for 'SNDRV_RAWMIDI_IOCTL_STATUS' is not an integer constant ../../include/sound/asound.h:562: error: expected expression before 'int' ../../include/sound/asound.h:562: error: enumerator value for 'SNDRV_RAWMIDI_IOCTL_DROP' is not an integer constant ../../include/sound/asound.h:563: error: expected expression before 'int' ../../include/sound/asound.h:563: error: enumerator value for 'SNDRV_RAWMIDI_IOCTL_DRAIN' is not an integer constant ../../include/sound/asound.h:673: error: expected expression before 'int' ../../include/sound/asound.h:673: error: enumerator value for 'SNDRV_TIMER_IOCTL_PVERSION' is not an integer constant ../../include/sound/asound.h:674: error: expected expression before 'struct' ../../include/sound/asound.h:674: error: enumerator value for 'SNDRV_TIMER_IOCTL_NEXT_DEVICE' is not an integer constant ../../include/sound/asound.h:675: error: expected expression before 'int' ../../include/sound/asound.h:675: error: enumerator value for 'SNDRV_TIMER_IOCTL_TREAD' is not an integer constant ../../include/sound/asound.h:676: error: expected expression before 'struct' ../../include/sound/asound.h:676: error: enumerator value for 'SNDRV_TIMER_IOCTL_GINFO' is not an integer constant ../../include/sound/asound.h:677: error: expected expression before 'struct' ../../include/sound/asound.h:677: error: enumerator value for 'SNDRV_TIMER_IOCTL_GPARAMS' is not an integer constant ../../include/sound/asound.h:678: error: expected expression before 'struct' ../../include/sound/asound.h:678: error: enumerator value for 'SNDRV_TIMER_IOCTL_GSTATUS' is not an integer constant ../../include/sound/asound.h:679: error: expected expression before 'struct' ../../include/sound/asound.h:679: error: enumerator value for 'SNDRV_TIMER_IOCTL_SELECT' is not an integer constant ../../include/sound/asound.h:680: error: expected expression before 'struct' ../../include/sound/asound.h:680: error: enumerator value for 'SNDRV_TIMER_IOCTL_INFO' is not an integer constant ../../include/sound/asound.h:681: error: expected expression before 'struct' ../../include/sound/asound.h:681: error: enumerator value for 'SNDRV_TIMER_IOCTL_PARAMS' is not an integer constant ../../include/sound/asound.h:682: error: expected expression before 'struct' ../../include/sound/asound.h:682: error: enumerator value for 'SNDRV_TIMER_IOCTL_STATUS' is not an integer constant ../../include/sound/asound.h:684: error: enumerator value for 'SNDRV_TIMER_IOCTL_START' is not an integer constant ../../include/sound/asound.h:685: error: enumerator value for 'SNDRV_TIMER_IOCTL_STOP' is not an integer constant ../../include/sound/asound.h:686: error: enumerator value for 'SNDRV_TIMER_IOCTL_CONTINUE' is not an integer constant ../../include/sound/asound.h:687: error: enumerator value for 'SNDRV_TIMER_IOCTL_PAUSE' is not an integer constant ../../include/sound/asound.h:869: error: expected expression before 'int' ../../include/sound/asound.h:869: error: enumerator value for 'SNDRV_CTL_IOCTL_P
VERSION' is not an integer constant ../../include/sound/asound.h:870: error: expected expression before 'struct' ../../include/sound/asound.h:870: error: enumerator value for 'SNDRV_CTL_IOCTL_CARD_INFO' is not an integer constant ../../include/sound/asound.h:871: error: expected expression before 'struct' ../../include/sound/asound.h:871: error: enumerator value for 'SNDRV_CTL_IOCTL_ELEM_LIST' is not an integer constant ../../include/sound/asound.h:872: error: expected expression before 'struct' ../../include/sound/asound.h:872: error: enumerator value for 'SNDRV_CTL_IOCTL_ELEM_INFO' is not an integer constant ../../include/sound/asound.h:873: error: expected expression before 'struct' ../../include/sound/asound.h:873: error: enumerator value for 'SNDRV_CTL_IOCTL_ELEM_READ' is not an integer constant ../../include/sound/asound.h:874: error: expected expression before 'struct' ../../include/sound/asound.h:874: error: enumerator value for 'SNDRV_CTL_IOCTL_ELEM_WRITE' is not an integer constant ../../include/sound/asound.h:875: error: expected expression before 'struct' ../../include/sound/asound.h:875: error: enumerator value for 'SNDRV_CTL_IOCTL_ELEM_LOCK' is not an integer constant ../../include/sound/asound.h:876: error: expected expression before 'struct' ../../include/sound/asound.h:876: error: enumerator value for 'SNDRV_CTL_IOCTL_ELEM_UNLOCK' is not an integer constant ../../include/sound/asound.h:877: error: expected expression before 'int' ../../include/sound/asound.h:877: error: enumerator value for 'SNDRV_CTL_IOCTL_SUBSCRIBE_EVENTS' is not an integer constant ../../include/sound/asound.h:878: error: expected expression before 'struct' ../../include/sound/asound.h:878: error: enumerator value for 'SNDRV_CTL_IOCTL_ELEM_ADD' is not an integer constant ../../include/sound/asound.h:879: error: expected expression before 'struct' ../../include/sound/asound.h:879: error: enumerator value for 'SNDRV_CTL_IOCTL_ELEM_REPLACE' is not an integer constant ../../include/sound/asound.h:880: error: expected expression before 'struct' ../../include/sound/asound.h:880: error: enumerator value for 'SNDRV_CTL_IOCTL_ELEM_REMOVE' is not an integer constant ../../include/sound/asound.h:881: error: expected expression before 'struct' ../../include/sound/asound.h:881: error: enumerator value for 'SNDRV_CTL_IOCTL_TLV_READ' is not an integer constant ../../include/sound/asound.h:882: error: expected expression before 'struct' ../../include/sound/asound.h:882: error: enumerator value for 'SNDRV_CTL_IOCTL_TLV_WRITE' is not an integer constant ../../include/sound/asound.h:883: error: expected expression before 'struct' ../../include/sound/asound.h:883: error: enumerator value for 'SNDRV_CTL_IOCTL_TLV_COMMAND' is not an integer constant ../../include/sound/asound.h:884: error: expected expression before 'int' ../../include/sound/asound.h:884: error: enumerator value for 'SNDRV_CTL_IOCTL_HWDEP_NEXT_DEVICE' is not an integer constant ../../include/sound/asound.h:885: error: expected expression before 'struct' ../../include/sound/asound.h:885: error: enumerator value for 'SNDRV_CTL_IOCTL_HWDEP_INFO' is not an integer constant ../../include/sound/asound.h:886: error: expected expression before 'int' ../../include/sound/asound.h:886: error: enumerator value for 'SNDRV_CTL_IOCTL_PCM_NEXT_DEVICE' is not an integer constant ../../include/sound/asound.h:887: error: expected expression before 'struct' ../../include/sound/asound.h:887: error: enumerator value for 'SNDRV_CTL_IOCTL_PCM_INFO' is not an integer constant ../../include/sound/asound.h:888: error: expected expression before 'int' ../../include/sound/asound.h:888: error: enumerator value for 'SNDRV_CTL_IOCTL_PCM_PREFER_SUBDEVICE' is not an integer constant ../../include/sound/asound.h:889: error: expected expression before 'int' ../../include/sound/asound.h:889: error: enumerator value for 'SNDRV_CTL_IOCTL_RAWMIDI_NEXT_DEVICE' is not an integer constant ../../include/sound/asound.h:890: error: expected expression before 'struct' ../../include/sound/asound.h:890: error: enumerator value for 'SNDRV_CTL_IOCTL_RAWMIDI_INFO' is not an integer constant ../../include/sound/asound.h:891: error: expected expression before 'int' ../../include/sound/asound.h:891: error: enumerator value for 'SNDRV_CTL_IOCTL_RAWMIDI_PREFER_SUBDEVICE' is not an integer constant ../../include/sound/asound.h:892: error: expected expression before 'int' ../../include/sound/asound.h:892: error: enumerator value for 'SNDRV_CTL_IOCTL_P
OWER' is not an integer constant ../../include/sound/asound.h:893: error: expected expression before 'int' ../../include/sound/asound.h:893: error: enumerator value for 'SNDRV_CTL_IOCTL_POWER_STATE' is not an integer constant ../../include/sound/asound.h:949: error: expected expression before 'struct' ../../include/sound/asound.h:949: error: enumerator value for 'SNDRV_IOCTL_READV
' is not an integer constant../../include/sound/asound.h:950: error: expected expression before 'struct' ../../include/sound/asound.h:950: error: enumerator value for 'SNDRV_IOCTL_WRITE
V' is not an integer constant
In file included from ../../include/local.h:109,
from control_local.h:22,
from cards.c:35:../../include/global.h:137: error: redefinition of 'struct timeval' ../../include/global.h:142: error: redefinition of 'struct timespec' make[2]: *** [cards.lo] Error 1
make[2]: Leaving directory `/nj/alsa-source/alsa-lib/src/control' make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/nj/alsa-source/alsa-lib/src'
make: *** [all-recursive] Error 1
(I know it's a lot of text, but I'm not sure how much is needed to determine what's wrong, not being overly familiar with alsa myself.)
Can someone help me out please? Remember that since I'm using cygwin, it could be as simple as not having all the packages installed.
Thanks,
Nathan
At Thu, 14 Feb 2008 10:01:24 -0600,
Quoted 8 lines · Linux Mercedes
Hi all,
I'm trying to build alsa from source. I'm guessing (I was not able to find any instructions on how to build alsa) that I build alsa-lib first. I'm compiling it with gcc 4.2.1. However, when I build it, I get the following errors:
Quoted 6 lines
In file included from
../../include/local.h:105,from control_local.h:22, from cards.c:35:
../../include/sound/asound.h:148: warning: implicit declaration of function '_IO
R'
(snip)
Does the patch below fix the problem?
Quoted 5 lines
In file included from
../../include/local.h:109,from control_local.h:22, from cards.c:35:
../../include/global.h:137: error: redefinition of 'struct timeval'../../include/global.h:142: error: redefinition of 'struct timespec'
Hm, try to pass -D_POSIX_C_SOURCE. These definitions are provided for non-POSIX compilers, and the header checks via ifdef.
Takashi
---
include/sound/asound.h +1 -0
@@ -59,6 +59,7 @@#ifndef __KERNEL__#include <sys/time.h> #include <sys/types.h> +#include <sys/ioctl.h> #endif /*
At Thu, 14 Feb 2008 10:18:33 -0600,
Quoted 4 lines · Linux Mercedes
Hi Takashi,
Where should I pass -D_POSIX_C_SOURCE?
$ CFLAGS="-O2 -Wall -D_POSIX_C_SOURCE" ./hgcompile ...
In the case of csh, use env.
Takashi