0
0

I’m having major linker errors.

OS: Vista64
Compiler: VC++ 2008 Express Edition
fmod: 0.4.12.7 64-bit

I’m just trying to copy/paste a sample from the examples folder that comes with the API. The examples execute fine in the example’s bin folder.

Here is the current error list:
[code:3vs0ug4z]1>Linking...
1>main.obj : error LNK2019: unresolved external symbol "public: enum FMOD_RESULT __stdcall FMOD::System::release(void)" (?release@System@FMOD@@QAG?AW4FMOD_RESULT@@XZ) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: enum FMOD_RESULT __stdcall FMOD::System::close(void)" (?close@System@FMOD@@QAG?AW4FMOD_RESULT@@XZ) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: enum FMOD_RESULT __stdcall FMOD::Sound::release(void)" (?release@Sound@FMOD@@QAG?AW4FMOD_RESULT@@XZ) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: enum FMOD_RESULT __stdcall FMOD::System::update(void)" (?update@System@FMOD@@QAG?AW4FMOD_RESULT@@XZ) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: enum FMOD_RESULT __stdcall FMOD::DSP::setParameter(int,float)" (?setParameter@DSP@FMOD@@QAG?AW4FMOD_RESULT@@HM@Z) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: enum FMOD_RESULT __stdcall FMOD::System::addDSP(class FMOD::DSP *)" (?addDSP@System@FMOD@@QAG?AW4FMOD_RESULT@@PAVDSP@2@@Z) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: enum FMOD_RESULT __stdcall FMOD::DSP::remove(void)" (?remove@DSP@FMOD@@QAG?AW4FMOD_RESULT@@XZ) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: enum FMOD_RESULT __stdcall FMOD::DSP::getActive(bool *)" (?getActive@DSP@FMOD@@QAG?AW4FMOD_RESULT@@PA_N@Z) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: enum FMOD_RESULT __stdcall FMOD::Channel::setPaused(bool)" (?setPaused@Channel@FMOD@@QAG?AW4FMOD_RESULT@@_N@Z) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: enum FMOD_RESULT __stdcall FMOD::Channel::getPaused(bool *)" (?getPaused@Channel@FMOD@@QAG?AW4FMOD_RESULT@@PA_N@Z) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: enum FMOD_RESULT __stdcall FMOD::System::createDSPByType(enum FMOD_DSP_TYPE,class FMOD::DSP * *)" (?createDSPByType@System@FMOD@@QAG?AW4FMOD_RESULT@@W4FMOD_DSP_TYPE@@PAPAVDSP@2@@Z) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: enum FMOD_RESULT __stdcall FMOD::System::playSound(enum FMOD_CHANNELINDEX,class FMOD::Sound *,bool,class FMOD::Channel * *)" (?playSound@System@FMOD@@QAG?AW4FMOD_RESULT@@W4FMOD_CHANNELINDEX@@PAVSound@2@_NPAPAVChannel@2@@Z) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: enum FMOD_RESULT __stdcall FMOD::System::createSound(char const *,unsigned int,struct FMOD_CREATESOUNDEXINFO *,class FMOD::Sound * *)" (?createSound@System@FMOD@@QAG?AW4FMOD_RESULT@@PBDIPAUFMOD_CREATESOUNDEXINFO@@PAPAVSound@2@@Z) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: enum FMOD_RESULT __stdcall FMOD::System::init(int,unsigned int,void *)" (?init@System@FMOD@@QAG?AW4FMOD_RESULT@@HIPAX@Z) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol "public: enum FMOD_RESULT __stdcall FMOD::System::getVersion(unsigned int *)" (?getVersion@System@FMOD@@QAG?AW4FMOD_RESULT@@PAI@Z) referenced in function _main
1>main.obj : error LNK2019: unresolved external symbol _FMOD_System_Create@4 referenced in function "enum FMOD_RESULT __cdecl FMOD::System_Create(class FMOD::System * *)" (?System_Create@FMOD@@YA?AW4FMOD_RESULT@@PAPAVSystem@1@@Z)
1>C:\lala\no\notrealfoldername\FMOD Test1\Debug\FMOD Test1.exe : fatal error LNK1120: 16 unresolved externals[/code:3vs0ug4z]

I’ve tried linking to fmodex_vc64.lib using a few different methods.. project property linker input dependencies, setting the lib folder as a default folder in the VC++ Directories options, and using pragma lib to directly import it. I have fmodex64.dll all over the place (something I was worried about, where should it be at compile time, in the working directory, the debug directory, etc), and the includes are being accessed directly with an include statement to a local inc folder in the working dir.

So the problem seems to be the lib, right? If I pragma the lib, I get these errors, if I change the name of the lib in the pragma to make sure that it’s actually finding the lib, it throws an error (i.e. cannot find made-up lib).. so it’s finding the lib..

Any help?

The sample I’m using is from examples\effects\main.cpp

  • You must to post comments
0
0

There’s an issue with FMOD_RESULT. All of the linker errors point to the FMOD_RESULT variable (unresolved external symbol). When I go to the definition of FMOD_RESULT it points to fmod.h, but that confuses me, as this sample uses fmod.hpp and not fmod.h

The code sample I’m trying to build is from the FMOD Ex examples folder that comes with FMOD Ex:

[code:296684js]/*===============================================================================================
Effects Example
Copyright (c), Firelight Technologies Pty, Ltd 2004-2005.

This example shows how to apply some of the built in software effects to sounds.
This example filters the global mix. All software sounds played here would be filtered in the
same way.
To filter per channel, and not have other channels affected, simply replace system->addDSP with
channel->addDSP.
Note in this example you don’t have to add and remove units each time, you could simply add them
all at the start then use DSP::setActive to toggle them on and off.
===============================================================================================*/

include "api\inc\fmod.hpp"

include "api\inc\fmod_dsp.h"

include "api\inc\fmod_errors.h"

include <windows.h>

include <stdio.h>

include <conio.h>

static void ERRCHECK(FMOD_RESULT result)
{
if (result != FMOD_OK)
{
printf("FMOD error! (%d) %s\n", result, FMOD_ErrorString(result));
exit(-1);
}
}

int main(int argc, char *argv[])
{
FMOD::System *system = 0;
FMOD::Sound *sound = 0;
FMOD::Channel *channel = 0;
FMOD::DSP *dsplowpass = 0;
FMOD::DSP *dsphighpass = 0;
FMOD::DSP *dspecho = 0;
FMOD::DSP *dspflange = 0;
FMOD::DSP *dspdistortion = 0;
FMOD::DSP *dspchorus = 0;
FMOD::DSP *dspparameq = 0;
FMOD_RESULT result;
int key;
unsigned int version;

/*
    Create a System object and initialize.
*/
result = FMOD::System_Create(&amp;system);
ERRCHECK(result);

result = system-&gt;getVersion(&amp;version);
ERRCHECK(result);

if (version &lt; FMOD_VERSION)
{
    printf(&quot;Error!  You are using an old version of FMOD %08x.  This program requires %08x\n&quot;, version, FMOD_VERSION);
    return 0;
}

result = system-&gt;init(32, FMOD_INIT_NORMAL, 0);
ERRCHECK(result);

result = system-&gt;createSound(&quot;../media/drumloop.wav&quot;, FMOD_SOFTWARE, 0, &amp;sound);
ERRCHECK(result);

printf(&quot;===================================================================\n&quot;);
printf(&quot;Effects Example.  Copyright (c) Firelight Technologies 2004-2005.\n&quot;);
printf(&quot;===================================================================\n&quot;);
printf(&quot;\n&quot;);
printf(&quot;Press SPACE to paused/unpause sound.\n&quot;);
printf(&quot;Press 1 to toggle dsplowpass effect.\n&quot;);
printf(&quot;Press 2 to toggle dsphighpass effect.\n&quot;);
printf(&quot;Press 3 to toggle dspecho effect.\n&quot;);
printf(&quot;Press 4 to toggle dspflange effect.\n&quot;);
printf(&quot;Press 5 to toggle dspdistortion effect.\n&quot;);
printf(&quot;Press 6 to toggle dspchorus effect.\n&quot;);
printf(&quot;Press 7 to toggle dspparameq effect.\n&quot;);
printf(&quot;Press 'Esc' to quit\n&quot;);
printf(&quot;\n&quot;);

result = system-&gt;playSound(FMOD_CHANNEL_FREE, sound, false, &amp;channel);
ERRCHECK(result);

/*
    Create some effects to play with.
*/
result = system-&gt;createDSPByType(FMOD_DSP_TYPE_LOWPASS, &amp;dsplowpass);
ERRCHECK(result);
result = system-&gt;createDSPByType(FMOD_DSP_TYPE_HIGHPASS, &amp;dsphighpass);
ERRCHECK(result);
result = system-&gt;createDSPByType(FMOD_DSP_TYPE_ECHO, &amp;dspecho);
ERRCHECK(result);
result = system-&gt;createDSPByType(FMOD_DSP_TYPE_FLANGE, &amp;dspflange);
ERRCHECK(result);
result = system-&gt;createDSPByType(FMOD_DSP_TYPE_DISTORTION, &amp;dspdistortion);
ERRCHECK(result);
result = system-&gt;createDSPByType(FMOD_DSP_TYPE_CHORUS, &amp;dspchorus);
ERRCHECK(result);
result = system-&gt;createDSPByType(FMOD_DSP_TYPE_PARAMEQ, &amp;dspparameq);
ERRCHECK(result);

/*
    Main loop.
*/
do
{
    if (kbhit())
    {
        key = getch();

        switch (key)
        {
            case ' ' :
            {
                bool paused;

                channel-&gt;getPaused(&amp;paused);
                ERRCHECK(result);

                paused = !paused;

                result = channel-&gt;setPaused(paused);
                ERRCHECK(result);
                break;
            }
            case '1' :
            {
                bool active;

                result = dsplowpass-&gt;getActive(&amp;active);
                ERRCHECK(result);

                if (active)
                {
                    result = dsplowpass-&gt;remove();
                    ERRCHECK(result);
                }
                else
                {
                    result = system-&gt;addDSP(dsplowpass);
                    ERRCHECK(result);
                }
                break;
            }
            case '2' :
            {
                bool active;

                result = dsphighpass-&gt;getActive(&amp;active);
                ERRCHECK(result);

                if (active)
                {
                    result = dsphighpass-&gt;remove();
                    ERRCHECK(result);
                }
                else
                {
                    result = system-&gt;addDSP(dsphighpass);
                    ERRCHECK(result);
                }
                break;
            }
            case '3' :
            {
                bool active;

                result = dspecho-&gt;getActive(&amp;active);
                ERRCHECK(result);

                if (active)
                {
                    result = dspecho-&gt;remove();
                    ERRCHECK(result);
                }
                else
                {
                    result = system-&gt;addDSP(dspecho);
                    ERRCHECK(result);

                    result = dspecho-&gt;setParameter(FMOD_DSP_ECHO_DELAY, 50.0f);
                    ERRCHECK(result);
                }
                break;
            }
            case '4' :
            {
                bool active;

                result = dspflange-&gt;getActive(&amp;active);
                ERRCHECK(result);

                if (active)
                {
                    result = dspflange-&gt;remove();
                    ERRCHECK(result);
                }
                else
                {
                    result = system-&gt;addDSP(dspflange);
                    ERRCHECK(result);
                }
                break;
            }
            case '5' :
            {
                bool active;

                result = dspdistortion-&gt;getActive(&amp;active);
                ERRCHECK(result);

                if (active)
                {
                    result = dspdistortion-&gt;remove();
                    ERRCHECK(result);
                }
                else
                {
                    result = system-&gt;addDSP(dspdistortion);
                    ERRCHECK(result);

                    result = dspdistortion-&gt;setParameter(FMOD_DSP_DISTORTION_LEVEL, 0.8f);
                    ERRCHECK(result);
                }
                break;
            }
            case '6' :
            {
                bool active;

                result = dspchorus-&gt;getActive(&amp;active);
                ERRCHECK(result);

                if (active)
                {
                    result = dspchorus-&gt;remove();
                    ERRCHECK(result);
                }
                else
                {
                    result = system-&gt;addDSP(dspchorus);
                    ERRCHECK(result);
                }
                break;
            }
            case '7' :
            {
                bool active;

                result = dspparameq-&gt;getActive(&amp;active);
                ERRCHECK(result);

                if (active)
                {
                    result = dspparameq-&gt;remove();
                    ERRCHECK(result);
                }
                else
                {
                    result = system-&gt;addDSP(dspparameq);
                    ERRCHECK(result);

                    result = dspparameq-&gt;setParameter(FMOD_DSP_PARAMEQ_CENTER, 5000.0f);
                    ERRCHECK(result);
                    result = dspparameq-&gt;setParameter(FMOD_DSP_PARAMEQ_GAIN, 0.0f);
                    ERRCHECK(result);
                }
                break;
            }
        }
    }

    system-&gt;update();

    {
        bool paused = 0;
        bool dsplowpass_active;
        bool dsphighpass_active;
        bool dspecho_active;
        bool dspflange_active;
        bool dspdistortion_active;
        bool dspchorus_active;
        bool dspparameq_active;

        dsplowpass   -&gt;getActive(&amp;dsplowpass_active);
        dsphighpass  -&gt;getActive(&amp;dsphighpass_active);
        dspecho      -&gt;getActive(&amp;dspecho_active);
        dspflange    -&gt;getActive(&amp;dspflange_active);
        dspdistortion-&gt;getActive(&amp;dspdistortion_active);
        dspchorus    -&gt;getActive(&amp;dspchorus_active);
        dspparameq   -&gt;getActive(&amp;dspparameq_active);

        if (channel)
        {
            result = channel-&gt;getPaused(&amp;paused);
            if ((result != FMOD_OK) &amp;&amp; (result != FMOD_ERR_INVALID_HANDLE) &amp;&amp; (result != FMOD_ERR_CHANNEL_STOLEN))
            {
                ERRCHECK(result);
            }
        }

        printf(&quot;%s : lowpass[%c] highpass[%c] echo[%c] flange[%c] dist[%c] chorus[%c] parameq[%c]\r&quot;, 
                paused ? &quot;Paused &quot; : &quot;Playing&quot;,
                dsplowpass_active ? 'x' : ' ',
                dsphighpass_active ? 'x' : ' ',
                dspecho_active ? 'x' : ' ',
                dspflange_active ? 'x' : ' ',
                dspdistortion_active ? 'x' : ' ',
                dspchorus_active ? 'x' : ' ',
                dspparameq_active ? 'x' : ' ');
    }

    Sleep(10);

} while (key != 27);

printf(&quot;\n&quot;);

/*
    Shut down
*/
result = sound-&gt;release();
ERRCHECK(result);
result = system-&gt;close();
ERRCHECK(result);
result = system-&gt;release();
ERRCHECK(result);

return 0;

}[/code:296684js]

  • You must to post comments
0
0

Are you sure you’re even using the platform sdk when using the 64bit version of fmod? Sounds to me like you’re using a 32bit compiler/linker with the 64bit version of fmod.

There is no issue with FMOD_RESULT, if there was it would be a compiler error not a linker error. It is just a type.

If you open fmod.hpp you will see it has #include fmod.h. FMOD_RESULT is in fmod.h.

  • You must to post comments
0
0

[quote="brett":dte8gjx2]Are you sure you’re even using the platform sdk when using the 64bit version of fmod? Sounds to me like you’re using a 32bit compiler/linker with the 64bit version of fmod.

There is no issue with FMOD_RESULT, if there was it would be a compiler error not a linker error. It is just a type.

If you open fmod.hpp you will see it has #include fmod.h. FMOD_RESULT is in fmod.h.[/quote:dte8gjx2]

Yes, you’re right. I made the switch earlier to see if the 32 bit version worked and it did. I’m stupid, I know! I did find I needed to use the x64 version of the DLL when using the C# fmod wrappers, however..

  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.