I'm trying to get a demo working writing PCM to the I2S; I've created a small demo program that gives an error when I run with the following command ./demo stereo_small.wav
can't open /dev/mem
So I run with the this command sudo ./demo stereo_small.wav (added sudo) and the demo should now be able to run successfully with elevated privileges.
But I now get this error:
./demo: error while loading shared libraries: libsndfile.so.1: cannot open shared object file: No such file or directory
Initially to get the program working I had to execute this command export LD_LIBRARY_PATH=/usr/local/lib to get it to work, but the error has now retuned but only when I prefix with sudo
Please bare with me I've only been using C & Linux for a few hours!
Here's what i've done to compile and run:
gcc `pkg-config --cflags sndfile` -c demo.c
gcc 'pkg-config --libs sndfile' demo.o -o demo
sudo ./demo stereo_small.wav
Update - Cause: some environment variables aren't maintained under the SU context see here
linuxtag is probably redundant. It would be better if you provided your distribution instead (probably Debian). – Jivings♦ Jun 20 '12 at 23:15libsndfileis where you think it is? Check that directory. Also check the output ofecho $LD_LIBRARY_PATHmatches it. – Jivings♦ Jun 20 '12 at 23:23/dev/mem? – Jivings♦ Jun 20 '12 at 23:24