Undefined reference question
<p>When I try compiling this:</p>

<pre><code>#include "OriAudioCache.hpp"

int main()
{
    System *audioSystem(0);
    FMOD_RESULT result;
    result = System_Create(&amp;audioSystem);
    FMOD_CHECK_STATE(result);
    OriAudioCache cache(audioSystem, 20);
    string title("Ambitious Girl");
    string path("/home/findrzkeeprz/Desktop/Resources/The_Ambitious_Girl.mp3");
    cache.LoadSound(title, path, Default);
    vector&lt;OriSound&gt;::iterator v_iter(cache.FindSound(title));
    cache.PlaySound(v_iter-&gt;sound());
}
</code></pre>

<p>Which uses these files:
OriAudioCache.hpp</p>

<pre><code>#ifndef ORI_AUDIO_CACHE_HPP_
#define ORI_AUDIO_CACHE_HPP_

#include "OriSound.hpp"
#include "OriChannel.hpp"

class OriAudioCache
{
    public:
         OriAudioCache(System *audioSystem, int maxChannels);

        ~OriAudioCache()
        {
            vector&lt;OriSound&gt;::iterator v_iter(audioCache_.begin());
            for(; v_iter != audioCache_.end(); ++v_iter)
            {
                v_iter-&gt;~OriSound();
            }
                delete audioSystem_;
        }

        void LoadSound(string const&amp; title, string const&amp; path, AudioLoadMode mode);
        vector&lt;OriSound&gt;::iterator FindSound(string const&amp; title);
        void RemoveSound(string const&amp; title);
        void PlaySound(Sound* sound);
        vector&lt;OriChannel&gt;::iterator RequestChannel(bool &amp;allocStatus, FMOD_CHANNELINDEX &amp;allocMode);
        void ReleaseChannel(Channel *channel);

    private:
        void inline SortChannels() {sort(channels_.begin(),channels_.end());}

        vector&lt;OriSound&gt; audioCache_;
        vector&lt;OriChannel&gt; channels_;
        System *audioSystem_;
};

#endif
</code></pre>

<p>and OriAudioCache.cpp</p>

<pre><code>#include "OriAudioCache.hpp"

OriAudioCache::OriAudioCache(System *audioSystem, int maxChannels)
        :audioSystem_(audioSystem), channels_(maxChannels){}

void OriAudioCache::LoadSound(string const&amp; title, string const&amp; path, AudioLoadMode mode)
{
    OriSound sound(title, path, audioSystem_, mode);
    vector&lt;OriSound&gt;::iterator pos =lower_bound(audioCache_.begin(), audioCache_.end(), sound);
    audioCache_.insert(pos, sound);
}

vector&lt;OriSound&gt;::iterator OriAudioCache::FindSound(string const&amp; title)
{
    vector&lt;OriSound&gt;::iterator v_iter(audioCache_.begin());
    for(; v_iter != audioCache_.end(); ++v_iter) //Would better if I could use a binary search here
    {
        if(v_iter-&gt;title() == title) return v_iter;
        else continue;
    }
    return audioCache_.end(); 
}
void OriAudioCache::RemoveSound(string const&amp; title)
{
    vector&lt;OriSound&gt;::iterator v_iter(audioCache_.begin());
    for(; v_iter != audioCache_.end(); ++v_iter) //Would better if I could use a binary search here
    {
        if(v_iter-&gt;title() == title) audioCache_.erase(v_iter);
        else continue;
    }
}

void OriAudioCache::PlaySound(Sound* sound)
{
    bool channelAlloc(false);
    FMOD_CHANNELINDEX allocMode = FMOD_CHANNEL_FREE;
    vector&lt;OriChannel&gt;::iterator oriChannel = RequestChannel(channelAlloc, allocMode);
    if(channelAlloc)
    {
        FMOD_RESULT result;
        Channel *chnl = oriChannel-&gt;channel();
        result = audioSystem_-&gt;playSound(allocMode, sound, false, &amp;chnl);
        FMOD_CHECK_STATE(result);
        bool isPlaying(false);
        chnl-&gt;isPlaying(&amp;isPlaying);

        while(isPlaying)
        {
            chnl-&gt;isPlaying(&amp;isPlaying);
        }

        bool paused(false);
        chnl-&gt;getPaused(&amp;paused);
        if(!paused)
        {
            ReleaseChannel(chnl);
        }
        SortChannels(); //sort channels, reoder for channel requests
    }
}

vector&lt;OriChannel&gt;::iterator OriAudioCache::RequestChannel(bool &amp;allocStatus, FMOD_CHANNELINDEX &amp;allocMode)
{
    vector&lt;OriChannel&gt;::iterator vOri_iter(channels_.begin());
    if(vOri_iter-&gt;status() == false)
    {
        if(vOri_iter-&gt;channel() == 0) 
        {
            allocMode = FMOD_CHANNEL_FREE;
            vOri_iter-&gt;setStatus(true); // flag channel as being used
            return vOri_iter;
        }
        else allocMode = FMOD_CHANNEL_REUSE;
        vOri_iter-&gt;setStatus(true); // flag channel as being used
        return vOri_iter;
    }
    else return channels_.end();
}

void OriAudioCache::ReleaseChannel(Channel *channel)
{
    bool playing(false);
    bool paused(false);
    channel-&gt;isPlaying(&amp;playing);
    channel-&gt;getPaused(&amp;paused);
    if(!playing &amp;&amp; !paused)
    {
        vector&lt;OriChannel&gt;::iterator vOri_iter(channels_.begin());
        for(; vOri_iter != channels_.end(); ++vOri_iter)
        {
            if(vOri_iter-&gt;channel() == channel) vOri_iter-&gt;setStatus(false);
        }
    }
}
</code></pre>

<p>I get undefined reference errors:</p>

<pre><code>findrzkeeprz@Aardvak:~/Documents/Chidori/Engine/Audio$ make
    g++ -ggdb -I../../ -I../../Engine -I../../Include -I../../Public -o audio main.cpp ../../Libraries/FMODEX/libfmodex.so
    /tmp/cctNhPVy.o: In function `main':
    /home/findrzkeeprz/Documents/Chidori/Engine/Audio/main.cpp:9: undefined reference to `OriAudioCache::OriAudioCache(FMOD::System*, int)'
    /home/findrzkeeprz/Documents/Chidori/Engine/Audio/main.cpp:12: undefined reference to `OriAudioCache::LoadSound(std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; const&amp;, std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; const&amp;, AudioLoadMode)'
    /home/findrzkeeprz/Documents/Chidori/Engine/Audio/main.cpp:13: undefined reference to `OriAudioCache::FindSound(std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; const&amp;)'
    /home/findrzkeeprz/Documents/Chidori/Engine/Audio/main.cpp:14: undefined reference to `OriAudioCache::PlaySound(FMOD::Sound*)'
    collect2: ld returned 1 exit status
    make: *** [audio] Error 1
</code></pre>

<p>What I'm I doing wrong here?</p>
