[PD] problems compiling pix_opencv in OSX (Was Re: pdp_opencv & pix_opencv new development)

lluisgomez at hangar.org lluisgomez at hangar.org
Sat Apr 26 04:07:06 CEST 2008

(sorry my last mail was incomplete)

hi marius,
today first time I have tried to compile this objects in macosx with  
no success ;( but i had gone a little bit far than you ... i think we  
are quite close.

first of all overwrite the Makefile you are using by the one i send  
attached in this mail. the one you are using is only for linux.

As I saw you had problems with pkg-config I added two new variables in  
the Makefile to fit manually with the CFLAGS and LIBS of openCV.

OPENCV_CFLAGS = -I/usr/local/include/opencv
OPENCV_LIBS   = -L/usr/local/lib -lcxcore -lcv -lhighgui -lcvaux -lml

As we are using the same openCv port I suppose you will not need to  
modify them but ensure are correct values for you.

then do:

   make clean

and now the objects will compile with no problem in macosx.

However, when I try to load any of them PD gives me this error::

10): Symbol not found: __ZN7GemBase10isRunnableEv
   Referenced from:  
   Expected in: dynamic lookup

Seems a problem with the linkage of the library but I'm really a  
neewbe in OSX compilations and don't know how to solve it,
maybe someone more experienced in it can put some light here?

thanks in advance,

> marius schebella <marius.schebella at gmail.com> ha escrito:
>> I hoped for such a long time that someone would start this. thanks 1000
>> times lluis!
>> unfortunately I could not get it compiling on my os x box.
>> I installed the opencv framework from
>> http://opencvlibrary.sourceforge.net/Mac_OS_X_OpenCV_Port
>> and then tried to find the correct directories to include but I think I
>> still got a problem with the opencv package
>> nyc-calling:pix_opencv marius$ make
>> g++ -DPD -O2 -funroll-loops -fomit-frame-pointer  -ffast-math -Wall -W
>> -Wno-unused -Wno-parentheses -Wno-switch -DGEM_OPENCV_VERSION=\"0.1\"
>> -g -I/Users/marius/devel/pd-rsync/pd-extended/pd/src -I.
>> -I/Users/marius/devel/pd-rsync/pd-extended/Gem/src
>> -I/Users/marius/devel/pd-rsync/pd-extended/pd/src -I/usr/local/include
>> -I/Users/marius/devel/opencv/OpenCV.framework/Versions/A `pkg-config
>> --cflags opencv` -o pix_opencv_edge.o -c pix_opencv_edge.cpp
>> Package opencv was not found in the pkg-config search path.
>> Perhaps you should add the directory containing `opencv.pc'
>> to the PKG_CONFIG_PATH environment variable
>> No package 'opencv' found
>> In file included from pix_opencv_edge.cpp:18:
>> pix_opencv_edge.h:22:16: error: cv.h: No such file or directory
>> [.........]
>> make: *** [pix_opencv_edge.o] Error 1
>> does someone have experience with opencv on mac?
>> thanks,
>> marius.
>> lluisgomez at hangar.org wrote:
>>> hi all,
>>> I started a new development for some OpenCV bindigs to PD, I have   
>>>   some objects working but no time to test or implement newones ...
>>> I want to encourage people to test them and report bugs, features   
>>>    requests, experiences, etc ... and why not, to help coding ...
>>> Please, note that this is alpha software with known bugs. It runs,  
>>>    and works at least some of the time, but use at your own   
>>> risk....   ;) i  mean, probably you will need to fight a bit to   
>>> get them   working ...  but you also will help a lot with feedback
>>> ok, here is the URL :
>>> http://hangar.org/wikis/lab/doku.php?id=start:puredata_opencv
>>> enjoi & thanks,
>>> ll
>>> ----------------------------------------------------------------
>>> This message was sent using IMP, the Internet Messaging Program.
>>> _______________________________________________
>>> PD-list at iem.at mailing list
>>> UNSUBSCRIBE and account-management ->     
>>> http://lists.puredata.info/listinfo/pd-list
> ----------------------------------------------------------------
> This message was sent using IMP, the Internet Messaging Program.

This message was sent using IMP, the Internet Messaging Program.

-------------- next part --------------
PD_DIR = /Users/lluisgomezbigorda/pd-0.41-4
GEM_DIR = /Users/lluisgomezbigorda/Gem

OPENCV_CFLAGS = -I/usr/local/include/opencv  
OPENCV_LIBS   = -L/usr/local/lib -lcxcore -lcv -lhighgui -lcvaux -lml 

LIBS =  -lm

# build flags

GEM_OPENCV_INCLUDE =  -I$(PD_DIR)/src -I.  -I$(GEM_DIR)/src -I$(PD_DIR)/src
GEM_OPENCV_CPPFLAGS  = -DPD -O2 -funroll-loops -fomit-frame-pointer  -ffast-math \
    -Wall -W -Wno-unused -Wno-parentheses -Wno-switch -g 

all: pix_opencv_edge.pd_darwin pix_opencv_laplace.pd_darwin pix_opencv_morphology.pd_darwin pix_opencv_distrans.pd_darwin pix_opencv_motempl.pd_darwin pix_opencv_haarcascade.pd_darwin pix_opencv_contours_boundingrect.pd_darwin pix_opencv_bgsubstract.pd_darwin pix_opencv_contours_convexity.pd_darwin

pix_opencv_contours_convexity.pd_darwin: pix_opencv_contours_convexity.o
	rm -f pix_opencv_contours_convexity.pd_darwin
	gcc -bundle -undefined dynamic_lookup -o pix_opencv_contours_convexity.pd_darwin pix_opencv_contours_convexity.o $(LIBS) $(OPENCV_LIBS)

pix_opencv_contours_boundingrect.pd_darwin: pix_opencv_contours_boundingrect.o
	rm -f pix_opencv_contours_boundingrect.pd_darwin
	gcc -bundle -undefined dynamic_lookup -o pix_opencv_contours_boundingrect.pd_darwin pix_opencv_contours_boundingrect.o $(LIBS) $(OPENCV_LIBS)

pix_opencv_haarcascade.pd_darwin: pix_opencv_haarcascade.o
	rm -f pix_opencv_haarcascade.pd_darwin
	gcc -bundle -undefined dynamic_lookup -o pix_opencv_haarcascade.pd_darwin pix_opencv_haarcascade.o $(LIBS) $(OPENCV_LIBS)

pix_opencv_motempl.pd_darwin: pix_opencv_motempl.o
	rm -f pix_opencv_motempl.pd_darwin
	gcc -bundle -undefined dynamic_lookup -o pix_opencv_motempl.pd_darwin pix_opencv_motempl.o $(LIBS) $(OPENCV_LIBS)

pix_opencv_distrans.pd_darwin: pix_opencv_distrans.o
	rm -f pix_opencv_distrans.pd_darwin
	gcc -bundle -undefined dynamic_lookup -o pix_opencv_distrans.pd_darwin pix_opencv_distrans.o $(LIBS) $(OPENCV_LIBS)

pix_opencv_morphology.pd_darwin: pix_opencv_morphology.o
	rm -f pix_opencv_morphology.pd_darwin
	gcc -bundle -undefined dynamic_lookup -o pix_opencv_morphology.pd_darwin pix_opencv_morphology.o $(LIBS) $(OPENCV_LIBS)

pix_opencv_laplace.pd_darwin: pix_opencv_laplace.o
	rm -f pix_opencv_laplace.pd_darwin
	gcc -bundle -undefined dynamic_lookup -o pix_opencv_laplace.pd_darwin pix_opencv_laplace.o $(LIBS) $(OPENCV_LIBS)

pix_opencv_edge.pd_darwin: pix_opencv_edge.o 
	rm -f pix_opencv_edge.pd_darwin
	gcc -bundle -undefined dynamic_lookup -o pix_opencv_edge.pd_darwin pix_opencv_edge.o $(LIBS) $(OPENCV_LIBS)

pix_opencv_bgsubstract.pd_darwin: pix_opencv_bgsubstract.o 
	rm -f pix_opencv_bgsubstract.pd_darwin
	gcc -bundle -undefined dynamic_lookup -o pix_opencv_bgsubstract.pd_darwin pix_opencv_bgsubstract.o $(LIBS) $(OPENCV_LIBS)

	rm -f *.o
	rm -f pix_opencv*.pd_darwin

distro: clean all
	rm *.o



	cp -f --remove-destination *.pd $(PD_DIR)/doc/5.reference

More information about the Pd-list mailing list