Touchlib compiling instructions (Fedora Core 9)

Hardware:
A linux compatible webcam (USB or a Firewire)

Software:
Fedora Core 9 (i386)
Also compatible with Fedora Core 10 (i386)

Installation instructions:

  1. I’m asuming you have a clean installation of Fedora Core 9 (with Software Development packages) installed.
  2. First install all dependencies:
    su –  
    yum install cmake svn opencv opencv-devel freeglut freeglut-devel fftw2 fftw2-devel libXmu libXmu-devel  
    exit
    
  3. Now to install osc, checkout the latest version on the SVN:
    cd ~  
    mkdir multitouch  
    cd multitouch  
    mkdir oscpack
    cd oscpack
    svn co https://www.smartelectronix.com:9000/repos/osc/oscpack/trunk/ .
    

    (or you could get the source oscpack_1_0_2.zip)

    Unfortuntately rev. 76 of oscpack is not compatible with gcc 4.3. Before running make it is required to make some fixes in the sourcecode. Use your favorite editor and edit the following files:

    tests/OscUnitTests.cpp
    – add #include <cstring>

    osc/OscPrintReceivedElements.cpp
    – add #include <cstring>

    tests/OscSendTests.cpp
    – add #include <cstdlib>

    tests/OscReceiveTest.cpp
    – add #include <cstdlib>

    examples/OscDump.cpp
    – add #include <cstring>
    – add #include <cstdlib>

    Next type the following commands:

    cd oscpack/  
    make  
    su –  
    cd /home/username/multitouch/oscpack  
    make install  
    exit
    
  4. Now compile touchlib:
    cd /home/username/multitouch  
    mkdir touchlib  
    cd touchlib  
    svn checkout http://touchlib.googlecode.com/svn/trunk/ .  
    cmake . (or “ccmake .” if you want a GUI)  
    make
    
  5. Touchlib should now be ready to use.

More information:
http://gcc.gnu.org/gcc-4.3/porting_to.html

Known bugs:
Due a problem with the OpenCV library in Linux, Touchlib might crash after a few minutes.

A fix for rev.393 is available here.
A mirror to the file: Touchlib race condition fix rev.393

(old)
A fix for rev.90 is available in here.
A mirror to the file: Touchlib race condition fix rev.90

(Optional) Import the touchlib project in Eclipse (3.4+ Ganymeade):

  1. Open up a console and go to the touchlib directory
  2. Type:
    cmake -G”Eclipse CDT4 – Unix Makefiles” .
    
  3. Two new files should be added to the directory (.project and .cproject).
  4. Launch Eclipse.
  5. Import the project using File -> Import…
  6. Select General -> Existing projects into workspace.
  7. Browse to your touchlib directory.
  8. After selecting the directory, the project should be visible in the overview.
  9. Keep “Copy projects into workspace” unchecked.
  10. Done!

6 responses

  1. Hello! very valuable info , but unfortunately I can’t get any signal from my camera to any of the demo applications (they compile fine). I use Fedora 10. At /dev there’s nothing like cam0 or similar that is requested at the CvCaptureFilter.cpp . I ‘ve been experimenting with fw0 etc which do appear at the /dev folder. Any ideas? Thanks in advance!

    constanton February 20th, 2009
  2. Hi, Am trying to compile touchlib but I get this error in fc7: (something to do with /usr/lib/libgtk-x11-2.0.so.0 ??? /usr/lib/libgtk-x11-2.0.so.0: undefined reference to `g_bookmark_file_get_applications’ collect2: ld returned 1 exit status make[2]: ** [src/configapp] Error 1 make[1]: ** [src/CMakeFiles/configapp.dir/all] Error 2 make: *** [all] Error 2 Any suggestions ?? Many thanks.

    mauricio – April 25th, 2009
  3. Do I need to designate path when im compiling?

    Sim – June 8th, 2009
  4. [root@localhost js]# gcc -I/usr/local/opencv/include/opencv -L/usr/local/opencv/lib -I/home/SimJS/multitouch/touchlib/include -L/home/SimJS/multitouch/touchlib/lib -lcv -lhighgui -lstdc++ touch.cpp -o touch /tmp/cc07Cjyt.o: In function main’: touch.cpp:(.text+0x84): undefined reference to touchlib::TouchScreenDevice::getTouchScreen()’ collect2: ld returned 1 exit status i try to compile .. why occur this error? please help me ㅠㅠ

    Sim – June 10th, 2009
  5. in GNU/linux ubuntu 9.04 at “make install” i get this error (don’t pay attention to the spanish things): g++ -shared -Wl,-soname,liboscpack.so -o liboscpack.so.1.0.2 ./ip/IpEndpointName.o ./ip/posix/NetworkingUtils.o ./ip/posix/UdpSocket.o ./osc/OscOutboundPacketStream.o ./osc/OscPrintReceivedElements.o ./osc/OscReceivedElements.o ./osc/OscTypes.o -lc -fPIC /usr/bin/ld: ./ip/IpEndpointName.o: relocation R_X86_64_32 against `a local symbol’ can not be used when making a shared object; recompile with -fPIC ./ip/IpEndpointName.o: could not read symbols: Bad value collect2: ld devolvió el estado de salida 1 make: *** [liboscpack.so.1.0.2] Error 1 i fix it editing the makefile like this change this line COPTS = -Wall -O3 for this one COPTS = -Wall -O3 -fPIC i hope help someone thanks for this great tutorial!

    julian September 24th, 2009
  6. in GNU/linux fedora 12 at “cmake .” CMake Error: The following variables are used in this project, but they are set to NOTFOUND. Please set them or make sure they are set and tested correctly in the CMake files: GLUT_Xi_LIBRARY (ADVANCED) linked by target “configapp” in directory /home/marz/multitouch/src linked by target “smoke” in directory /home/marz/multitouch/demos/smoke – Configuring incomplete, errors occurred! I fix it installing the libXi-devel.i686 Awesome work

    Marcelo – November 26th, 2009