Touchlib compiling instructions (Fedora Core 9)

A linux compatible webcam (USB or a Firewire)

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 .
    (or you could get the source 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:

    – add #include <cstring>

    – add #include <cstring>

    – add #include <cstdlib>

    – add #include <cstdlib>

    – 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 .
    cmake . (or “ccmake .” if you want a GUI)

  5. Touchlib should now be ready to use.

More information:

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

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 Comment

    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!

    20 Feb 2009 | Reply

  1. mauricio

    Am trying to compile touchlib but I get this error in fc7: (something to do with /usr/lib/ ???

    /usr/lib/ 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.

    25 Apr 2009 | Reply

  2. Sim

    Do I need to designate path when im compiling?

    08 Jun 2009 | Reply

  3. Sim

    [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 ã… ã… 

    10 Jun 2009 | Reply

  4. 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, -o ./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: *** [] 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!

    24 Sep 2009 | Reply

  5. Marcelo

    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:
    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

    26 Nov 2009 | Reply

    Leave a reply