b-fitzpatrick / cpiped

Captures an audio stream and outputs to a pipe with buffering and silence detection
GNU General Public License v3.0
71 stars 13 forks source link

Cannot compile in ubuntu 16.10 32 bits #4

Closed n0rdik closed 7 years ago

n0rdik commented 7 years ago

Hello,

I'm trying to complie in my ubuntu box 32 bits but has this errors:

/tmp/ccnkWhD5.o: En la función myterm': /home/rafa/cpiped/cpiped.c:54: referencia asnd_pcm_drain' sin definir /home/rafa/cpiped/cpiped.c:55: referencia a snd_pcm_close' sin definir /tmp/ccnkWhD5.o: En la funciónmain': /home/rafa/cpiped/cpiped.c:233: referencia a snd_pcm_open' sin definir /home/rafa/cpiped/cpiped.c:235: referencia asnd_strerror' sin definir /home/rafa/cpiped/cpiped.c:238: referencia a snd_pcm_hw_params_sizeof' sin definir /home/rafa/cpiped/cpiped.c:238: referencia asnd_pcm_hw_params_sizeof' sin definir /home/rafa/cpiped/cpiped.c:239: referencia a snd_pcm_hw_params_any' sin definir /home/rafa/cpiped/cpiped.c:240: referencia asnd_pcm_hw_params_set_access' sin definir /home/rafa/cpiped/cpiped.c:241: referencia a snd_pcm_hw_params_set_format' sin definir /home/rafa/cpiped/cpiped.c:242: referencia asnd_pcm_hw_params_set_channels' sin definir /home/rafa/cpiped/cpiped.c:243: referencia a snd_pcm_hw_params_set_rate_near' sin definir /home/rafa/cpiped/cpiped.c:247: referencia asnd_pcm_hw_params_set_period_size_near' sin definir /home/rafa/cpiped/cpiped.c:250: referencia a snd_pcm_hw_params' sin definir /home/rafa/cpiped/cpiped.c:252: referencia asnd_strerror' sin definir /home/rafa/cpiped/cpiped.c:257: referencia a snd_pcm_hw_params_get_period_time' sin definir /home/rafa/cpiped/cpiped.c:260: referencia asnd_pcm_hw_params_get_period_size' sin definir /home/rafa/cpiped/cpiped.c:300: referencia a snd_pcm_readi' sin definir /home/rafa/cpiped/cpiped.c:316: referencia asqrt' sin definir /home/rafa/cpiped/cpiped.c:303: referencia a snd_pcm_prepare' sin definir /home/rafa/cpiped/cpiped.c:307: referencia asnd_strerror' sin definir

Sorry, it's in spanish. I have libasound2-dev installed, but I thing I'm missing any other package. Can you help me? Thanks in advance.

b-fitzpatrick commented 7 years ago

Sorry, I don't know. If you figure it out, please respond with the solution.

n0rdik commented 7 years ago

Well I found it here: http://stackoverflow.com/questions/19001312/linux-users-please-tell-me-if-you-manage-to-compile-this

The point is to place " -lm -lasound" at the end of the compiling line:

cc -g -O2 -Wall -Wextra -Isrc -rdynamic -DNDEBUG -lrt cpiped.c -o cpiped -lm -lasound

Now it worked. Thanks.

b-fitzpatrick commented 7 years ago

OK, thanks. When I run make on Raspian Jessie, I get:

cc -g -O2 -Wall -Wextra -Isrc -rdynamic -DNDEBUG -lrt -lm -lasound cpiped.c -o cpiped

But, it compiles fine.

I found this: http://stackoverflow.com/questions/28018601/why-am-i-getting-such-error-message-in-installing-package

Try changing LDFLAGS to LDLIBS in Makefile and compile. After that change, I get:

cc -g -O2 -Wall -Wextra -Isrc -rdynamic -DNDEBUG -lrt cpiped.c -lm -lasound -o cpiped

Which still compiles fine for me.

n0rdik commented 7 years ago

Yes, it also worked changing LDFLAGS to LDLIBS for me, returning this command:

cc -g -O2 -Wall -Wextra -Isrc -rdynamic -DNDEBUG -lrt cpiped.c -lm -lasound -o cpiped

I think that the point is to place the library reference before de source code file. Thanks.

b-fitzpatrick commented 7 years ago

Thanks. I committed the change to the Makefile.