p2pvc icon indicating copy to clipboard operation
p2pvc copied to clipboard

Error around make

Open seagullbird opened this issue 8 years ago • 4 comments

$ make gcc -Isrc/inc -O2 -Wall -DPA_USE_COREAUDIO pkg-config --cflags opencv src/audio.c -c -o objs/audio.o src/audio.c:34:10: fatal error: 'portaudio.h' file not found

include <portaudio.h>

     ^

1 error generated. make: *** [objs/audio.o] Error 1

Hi, I believe I have installed portaudio properly, why does this show every time? I can see portaudio.h in my usr/local/include/, what should I do? Many thanks.

seagullbird avatar Mar 28 '16 06:03 seagullbird

I got the same thing on Mac. Were you able to fix it?

atv2016 avatar Apr 14 '16 20:04 atv2016

Sry buddy, still no.. I've looked through net but can't get the solution

seagullbird avatar Apr 15 '16 03:04 seagullbird

I solved it. See below first lines of Makefile until "all: p2pvc". Just add the other include dir with -I and a space between to the INCDIR and the same for the library with -L and a space on the LDFLAGS.

It's strange it doesn't look in /usr/local/include by default, but at least this will compile it. Hope this helps for you.

CC=gcc OBJDIR=objs SRCDIR=src INCDIR=$(SRCDIR)/inc -I/usr/local/include CFLAGS+=-I$(INCDIR) platform=$(shell uname -s)

SRCS=$(wildcard $(SRCDIR)/*.c) OBJS=$(patsubst $(SRCDIR)/%.c,$(OBJDIR)/%.o,$(SRCS))

CFLAGS+=-O2 -Wall ifeq ($(platform), Linux) CFLAGS+=-DPA_USE_ALSA else CFLAGS+=-DPA_USE_COREAUDIO endif CFLAGS+=pkg-config --cflags opencv CFLAGS_DEBUG+=-O0 -g3 -Werror -DDEBUG LDFLAGS+=-lpthread -lncurses -lportaudio -lm LDFLAGS+=pkg-config --libs opencv -L/usr/local/lib

atv2016 avatar Apr 15 '16 04:04 atv2016

Thanks a loooooot!

seagullbird avatar Apr 15 '16 05:04 seagullbird