[C++-sig] [Boost.Python] Problems to make a wrapper of a OpenCV program

Filipe M. S. de Campos filipemscampos at yahoo.com.br
Tue Jul 20 03:59:47 CEST 2010


Hello!

I've been searching during the last few days a way to solve the problem I'm
having, but I can't find the apropriate answer. I hope somebody can help me.

I have written a program in C++ that uses the opencv library. It is
compiling and working fine.
(I use this to compile the code: gcc -o foo foo.c
-I/usr/local/include/opencv -L/usr/local/lib -lcxcore -lcv -lml -lhighgui
-lcvaux)

Last week, I started to write a wrapper to use this program with another one
written in python. To do that, I am using Boost.Python. I followed the Boost
tutorial and it is working fine with the examples that came with it.
The problem happens when I try to use bjam with my first program that uses
opencv.
At first, it complained about the includes... To solve that, I modified the
requirements section of the Jamroot to:

# Set up the project-wide requirements that everything uses the
# boost_python library from the project whose global ID is
# /boost/python.
project
  : requirements <library>/boost/python//boost_python
                 <include>/usr/local/include/opencv ;

This solved the first problem, but now, when using the bjam command, I
receive that message:

darwin.link.dll bin/darwin-4.2.1/debug/abreJanela_ext.so
Undefined symbols:
  "_cvSetZero", referenced from:
      abreJanela()     in abreJanela.o
  "_cvNamedWindow", referenced from:
      abreJanela()     in abreJanela.o
  "_cvCreateImage", referenced from:
      abreJanela()     in abreJanela.o
  "_cvShowImage", referenced from:
      abreJanela()     in abreJanela.o
ld: symbol(s) not found


What is the correct way to configure bjam or Jamroot (or another thing) to
have my wrapper compiled sucessfully?



Regards

(I'm on a macosx 10.6.4, opencv 2.1, bjam 3.1.18 and boost 1_43_0)
-----
Filipe Morgado Simões de Campos


www.amodindin.com.br
www.bitabit.eng.br
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20100719/e92c1c72/attachment.html>


More information about the Cplusplus-sig mailing list