makefile

How make one archive Makefile in way file object it recognizes function
the asoundlib.h?

In my code .c simple #include <asoundlib.h>

Att.
Cláudio Fernando in Brasil.

David Gibbs wrote:

Claudio Fernando Pinto <> claudio@grupopro.com.br> > wrote:
How make one archive Makefile in way file object it recognizes function
the asoundlib.h?

In my code .c simple #include <asoundlib.h

I’m not sure exactly what you’re asking, but I would guess you are asking
about linking to the library.

It would be a “-lasound” on the link line.

-David

I am thankful for the reply.
It follows below my part code where it is the problem.

#include <stdlib.h>
#include <stdio.h>

#include <sys/asoundlib.h>

int main(int argc, char *argv[]) {
int num;

num = snd_cards();

printf(“Num\n”);

return EXIT_SUCCESS;
}

Its problem The problem is the function snd_cards () is not found.
None function of lib asoundlib.h it is found.
if possible, example make file for code above.

Thanks a lot.
Att,
Cláudio Fernando Pinto

Claudio Fernando Pinto wrote:

I am thankful for the reply.
It follows below my part code where it is the problem.

#include <stdlib.h
#include <stdio.h

#include <sys/asoundlib.h

int main(int argc, char *argv[]) {
int num;

num = snd_cards();

printf(“Num\n”);

return EXIT_SUCCESS;
}

Its problem The problem is the function snd_cards () is not found.
None function of lib asoundlib.h it is found.
if possible, example make file for code above.

The command line to build you sample (given the source is called snd.c):

qcc -osnd snd.c -lasound

The Makefile might look like this (I’ve add -Wall option for warning
levels):

#Makefile =======================

CC=qcc
CFLAGS=-Wall
LDFLAGS=-lasound

all: snd

snd: snd.c
$(CC) $(CFLAGS) -o$@ $^ $(LDFLAGS)

clean:
rm -rf *.o snd

#================================

-Adam