1.swig commands to link ruby & c++
swig -c++ -ruby Wrapper.i
ruby mkmf.rb Wrapper
make
ruby hello.rb
2.modify the makefile
2.1add the following lines below definition of CFLAGS & DLDFLAGS
CFLAGS += `pkg-config opencv --cflags`
DLDFLAGS += `pkg-config opencv --libs`
2.2 remove -arch ppc at following lines
DLDFLAGS = -L. -arch ppc -arch i386
LDSHARED = cc -arch ppc -arch i386 -pipe -bundle
3.If you don't want to mess your makefile
require 'mkmf'
$libs = append_library($libs, "stdc++")
$CFLAGS << " `pkg-config opencv --cflags`"
$LDFLAGS << " `pkg-config opencv --libs`"
create_makefile(ARGV[0])
from
http://developer.apple.com/releasenotes/OpenSource/PerlExtensionsRelNotes/index.html
% env ARCHFLAGS='-arch ppc' ruby extconf.rb
% make
% make install
Mar 26, 2008
swig & opencv & ruby
Posted by Lono at 09:17
Labels: Programming
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment