title: OpenNI linking erros, lots of undefined references
body: <p>I am driving nuts....
  I'm working on a program to read out Joint Coordinates from an Xtion Primesense sensor with OpenNI and NiTE. I got the program splittet in 3 parts. Main, sensorOpenNI.hpp and sensorOpenNI.cpp. Now while linking the parts together I get lots of errors saying there are undefined references to some NiTE functions. I'm working with Kubuntu and g++. The NiTE and OpenNI libs are in a directory called Include...
  Here's the error message:</p>
  
  <blockquote>
    <p>/tmp/ccrPQHEg.o: In function <code>openni::VideoFrameRef::release()':
    sensorOpenNI.cpp:(.text._ZN6openni13VideoFrameRef7releaseEv[openni::VideoFrameRef::release()]+0x18): undefined reference to</code>oniFrameRelease'
    /tmp/ccrPQHEg.o: In function <code>openni::VideoFrameRef::_setFrame(OniFrame*)':
    sensorOpenNI.cpp:(.text._ZN6openni13VideoFrameRef9_setFrameEP8OniFrame[openni::VideoFrameRef::_setFrame(OniFrame*)]+0x25): undefined reference to</code>oniFrameAddRef'
    /tmp/ccrPQHEg.o: In function <code>nite::UserTrackerFrameRef::release()':
    sensorOpenNI.cpp:(.text._ZN4nite19UserTrackerFrameRef7releaseEv[nite::UserTrackerFrameRef::release()]+0x24): undefined reference to</code>niteUserTrackerFrameRelease'
    /tmp/ccrPQHEg.o: In function <code>nite::UserTracker::create(openni::Device*)':
    sensorOpenNI.cpp:(.text._ZN4nite11UserTracker6createEPN6openni6DeviceE[nite::UserTracker::create(openni::Device*)]+0x13): undefined reference to</code>niteInitializeUserTracker'
    sensorOpenNI.cpp:(.text._ZN4nite11UserTracker6createEPN6openni6DeviceE[nite::UserTracker::create(openni::Device*)]+0x27): undefined reference to <code>niteInitializeUserTrackerByDevice'
    /tmp/ccrPQHEg.o: In function</code>nite::UserTracker::destroy()':
    sensorOpenNI.cpp:(.text._ZN4nite11UserTracker7destroyEv[nite::UserTracker::destroy()]+0x1e): undefined reference to <code>niteShutdownUserTracker'
    /tmp/ccrPQHEg.o: In function</code>nite::UserTracker::readFrame(nite::UserTrackerFrameRef*)':
    sensorOpenNI.cpp:(.text._ZN4nite11UserTracker9readFrameEPNS_19UserTrackerFrameRefE[nite::UserTracker::readFrame(nite::UserTrackerFrameRef*)]+0x1d): undefined reference to <code>niteReadUserTrackerFrame'
    /tmp/ccrPQHEg.o: In function</code>nite::UserTracker::startSkeletonTracking(short)':
    sensorOpenNI.cpp:(.text._ZN4nite11UserTracker21startSkeletonTrackingEs[nite::UserTracker::startSkeletonTracking(short)]+0x1e): undefined reference to <code>niteStartSkeletonTracking'
    /tmp/ccrPQHEg.o: In function</code>nite::NiTE::initialize()':
    sensorOpenNI.cpp:(.text._ZN4nite4NiTE10initializeEv[nite::NiTE::initialize()]+0x7): undefined reference to <code>niteInitialize'
    collect2: ld returned 1 exit status
    patrick@ubuntu:~/Koerpersteuerung$ g++ -c sensorOpenNI.cpp sensorOpenNI.hpp -I Include/
    patrick@ubuntu:~/Koerpersteuerung$ g++ mainSensor.cpp sensorOpenNI.o -I Include/
    sensorOpenNI.o: In function</code>openni::VideoFrameRef::release()':
    sensorOpenNI.cpp:(.text._ZN6openni13VideoFrameRef7releaseEv[openni::VideoFrameRef::release()]+0x18): undefined reference to <code>oniFrameRelease'
    sensorOpenNI.o: In function</code>openni::VideoFrameRef::_setFrame(OniFrame*)':
    sensorOpenNI.cpp:(.text._ZN6openni13VideoFrameRef9_setFrameEP8OniFrame[openni::VideoFrameRef::_setFrame(OniFrame*)]+0x25): undefined reference to <code>oniFrameAddRef'
    sensorOpenNI.o: In function</code>nite::UserTrackerFrameRef::release()':
    sensorOpenNI.cpp:(.text._ZN4nite19UserTrackerFrameRef7releaseEv[nite::UserTrackerFrameRef::release()]+0x24): undefined reference to <code>niteUserTrackerFrameRelease'
    sensorOpenNI.o: In function</code>nite::UserTracker::create(openni::Device*)':
    sensorOpenNI.cpp:(.text._ZN4nite11UserTracker6createEPN6openni6DeviceE[nite::UserTracker::create(openni::Device*)]+0x13): undefined reference to <code>niteInitializeUserTracker'
    sensorOpenNI.cpp:(.text._ZN4nite11UserTracker6createEPN6openni6DeviceE[nite::UserTracker::create(openni::Device*)]+0x27): undefined reference to</code>niteInitializeUserTrackerByDevice'
    sensorOpenNI.o: In function <code>nite::UserTracker::destroy()':
    sensorOpenNI.cpp:(.text._ZN4nite11UserTracker7destroyEv[nite::UserTracker::destroy()]+0x1e): undefined reference to</code>niteShutdownUserTracker'
    sensorOpenNI.o: In function <code>nite::UserTracker::readFrame(nite::UserTrackerFrameRef*)':
    sensorOpenNI.cpp:(.text._ZN4nite11UserTracker9readFrameEPNS_19UserTrackerFrameRefE[nite::UserTracker::readFrame(nite::UserTrackerFrameRef*)]+0x1d): undefined reference to</code>niteReadUserTrackerFrame'
    sensorOpenNI.o: In function <code>nite::UserTracker::startSkeletonTracking(short)':
    sensorOpenNI.cpp:(.text._ZN4nite11UserTracker21startSkeletonTrackingEs[nite::UserTracker::startSkeletonTracking(short)]+0x1e): undefined reference to</code>niteStartSkeletonTracking'
    sensorOpenNI.o: In function <code>nite::NiTE::initialize()':
    sensorOpenNI.cpp:(.text._ZN4nite4NiTE10initializeEv[nite::NiTE::initialize()]+0x7): undefined reference to</code>niteInitialize'
    collect2: ld returned 1 exit status </p>
  </blockquote>
  
  <p>I'm calling g++ like this:</p>
  
  <pre><code>g++ -o test mainSensor.cpp sensorOpenNI.cpp -I Include/
  </code></pre>