makefile

bridged with qnx.development_tools
Post Reply
Claudio Fernando Pinto

makefile

Post by Claudio Fernando Pinto » Tue May 30, 2006 8:16 pm

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.

Claudio Fernando Pinto

Re: makefile

Post by Claudio Fernando Pinto » Wed Jun 07, 2006 1:17 pm

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

Adam Mallory

Re: makefile

Post by Adam Mallory » Wed Jun 07, 2006 2:49 pm

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

Post Reply

Return to “qnx.development_tools”