Sunday, 15 September 2013

c++ - gcc: cannot find -lasound when crosscompiling -



c++ - gcc: cannot find -lasound when crosscompiling -

i seek crosscompile this little programme arm device, error:

arm-none-linux-gnueabi/bin/ld: cannot find -lasound collect2: error: ld returned 1 exit status

then found libasound files in target device , have copied folder /usr/lib still no effect. utilize commands:

export cflags="-i/usr/include -i/usr/lib" $cc -o play sound_playback.c $cflags -lasound

i have installed libasound2-dev bundle on ubuntu 14.04 x64 , able compile programme on native computer without errors.

update solution marc , john have said below, should utilize -l flag set library path. command line should be:

$cc -o play sound_playback.c $cflags -l/usr/lib -lasound

c++ gcc compilation libasound

No comments:

Post a Comment