I want to play around with ARToolKit. My plan is to take the pattern detection information and ship it off to places for further processing. I figured the easiest way to do that would be to use Open Sound Control. Since ARToolKit is a C framework, I though it would make sense to use an OSC library written in C. oscpack looked like a good candidate.
I’m using a Intel-based Mac. To build and install the oscpack library I needed make a few changes to the Makefile. I thought I would share these changes in case anybody else tries to do this.
Step zero is ONLY NECESSARY IF YOU ARE RUNNING ON A POWER PC-BASED MAC. Sorry to shout, I just want to emphasize this. I didn’t need to do this, but I’m pointing it out anyway in case it helps somebody. At the beginning of the Makefile, change
This next step, step one, is only necessary if you don’t want to create (or have not already created) a /usr/local directory. It doesn’t exist by default, and if it isn’t there then the installation process will fail. You need to change
PREFIX = /usr/local
PREFIX = /usr
The thrid step involves using the right compiler syntax to set up a shared library. Change this part of the code
$(CXX) -shared -Wl,-soname,$(LIBSONAME) -o $(LIBFILENAME) $(LIBOBJECTS) -lc
@#Mac OS X case
@#$(CXX) -dynamiclib -Wl,-install_name,$(LIBSONAME) -o $(LIBFILENAME) $(LIBOBJECTS) -lc
@#$(CXX) -shared -Wl,-soname,$(LIBSONAME) -o $(LIBFILENAME) $(LIBOBJECTS) -lc
@#Mac OS X case
$(CXX) -dynamiclib -Wl,-install_name,$(LIBSONAME) -o $(LIBFILENAME) $(LIBOBJECTS) -lc
Now you can run
sudo make install and the libraries and headers will be installed on your system. Awesome! Now try to build one of the examples, like examples/SimpleSend.cpp. Don’t forget to point to the include files (-I) and the shared library (-l).
g++ I/usr/lib/oscpack -loscpack -o SimpleSend SimpleSend.cpp
Now if you listen to port 7000 and run the program you should see the message.