0
0

[url=http://www.fmod.org/forum/viewtopic.php?p=33677#33677:15c2c19r]SOLUTION FOUND HERE[/url:15c2c19r]

OK, I read everything related to this issue… All I saw was a bunch of dislocated half answers

Can you really compile in Devc++ or not?

Please provide a step by step instuction

Here’s what I did…
I set added the include directory fmod\inc
I set added the lib directory fmod\lib
does it know automatically to use libfmodex.a? How do I tell it to use it?
I tried the C referencing using #include <fmod.h>
[code:15c2c19r]

include <windows.h>

include <fmod.h>

int Fn(void)
{
FMOD_RESULT mainresult;
FMOD_SYSTEM *mainsystem;

mainresult = FMOD_System_Create(&amp;mainsystem);       // Create the main system object.
if (mainresult != FMOD_OK)
{
//    printf(&quot;FMOD error! (%d) %s\n&quot;, mainresult, FMOD_ErrorString(mainresult));
    exit(-1);
}

mainresult = FMOD_System_Init(mainsystem,100, FMOD_INIT_NORMAL, 0); // Initialize FMOD.
if (mainresult == FMOD_ERR_OUTPUT_CREATEBUFFER) 
{ 
   FMOD_System_SetSpeakerMode(mainsystem,FMOD_SPEAKERMODE_STEREO);
   mainresult = FMOD_System_Init(mainsystem,100, FMOD_INIT_NORMAL, 0); 
}
if (mainresult != FMOD_OK)
{
//    printf(&quot;FMOD error! (%d) %s\n&quot;, mainresult, FMOD_ErrorString(mainresult));
    exit(-1);
}

}
[/code:15c2c19r]

Linker error
[Linker error] undefined reference to FMOD_System_Create@4'
[Linker error] undefined reference to
FMOD_System_Init@16′
[Linker error] undefined reference to ‘FMOD_System_SetSpeakerMode@8’
[Linker error] undefined reference to `FMOD_System_Init@16′

Here, using C++ reference include <fmod.hpp>
[code:15c2c19r]

include <windows.h>

include <fmod.hpp>

int Fn(void)
{
FMOD_RESULT mainresult;
FMOD::System *mainsystem;

mainresult = (FMOD_RESULT) FMOD::System_Create(&amp;mainsystem);        // Create the main system object.
if (mainresult != FMOD_OK)
{
//    printf(&quot;FMOD error! (%d) %s\n&quot;, mainresult, FMOD_ErrorString(mainresult));
    exit(-1);
}

mainresult = mainsystem-&gt;init(100, FMOD_INIT_NORMAL, 0); // Initialize FMOD.
if (mainresult == FMOD_ERR_OUTPUT_CREATEBUFFER) 
{ 
   mainsystem-&gt;setSpeakerMode(FMOD_SPEAKERMODE_STEREO); 
   mainresult = mainsystem-&gt;init(100, FMOD_INIT_NORMAL, 0); 
}
if (mainresult != FMOD_OK)
{
//    printf(&quot;FMOD error! (%d) %s\n&quot;, mainresult, FMOD_ErrorString(mainresult));
    exit(-1);
}

}
[/code:15c2c19r]

linker errors:
[Linker error] undefined reference to _ZN4FMOD6System4initEijPv@16'
[Linker error] undefined reference to
_ZN4FMOD6System14setSpeakerModeE16FMOD_SPEAKERMODE@8′
[Linker error] undefined reference to _ZN4FMOD6System4initEijPv@16'
[Linker error] undefined reference to
FMOD_System_Create@4′

Please provide a proper step by step instruction (and dont point me to the "pinned topic" about the subject… I’ve read it, it has not valuable information/instructions to fix the problem).[url][/url]

  • You must to post comments
0
0

Hi,
Ok firstly you can’t use the c++ iterface, that thread must have said it about 10 times. You have to use the C interface only.

The issue is that libraries don’t just automatically link themselves by having them in a certain directory. You have to look in your makefile/project settings and actually specify the lib you want to link in the linker options section.

  • You must to post comments
0
0

SOLUTION FOUND

[quote="brett":2abzn88h]Hi,
Ok firstly you can’t use the c++ iterface, that thread must have said it about 10 times. You have to use the C interface only.
[/quote:2abzn88h]
That’s why I gave the 2 examples.
[quote:2abzn88h]
The issue is that libraries don’t just automatically link themselves by having them in a certain directory. You have to look in your makefile/project settings and actually specify the lib you want to link in the linker options section.[/quote:2abzn88h]

It looks like it… I really have now idea how to "Include" a specific lib file for linking in dev-c++. The only options I found was to include lib folders.

And I have no idea how to modify the make file either. The only thing that looks like a make file is a .win file that gets overwriten everytime you compile…

I know this is not the dev-c++ site but do you have a clue on how to do this?

I tried Add to project… Not the right place…

I’m getting to the point that I’m about to resort to late binding.

…Later

Ah ha! Did I mention I’m new to dev-c++ so I had no clue where to go?

[b:2abzn88h]To add the lib (.a) you have to go to
Project Menu\Project Options menu\Parameters tab\Add Library or Object button… Select libfmodex.a[/b:2abzn88h] Whoohoo.

Did someone recreate a wrapper set of the objects (in a cpp file) listed in the help using the API so I can use the object model?

So. the straight answer for using fmod in dev-c++:

[b:2abzn88h]
use the api standard C functions
include fmod.h

obj::function(…) becomes obj_function(fmod,…) (Useful to relate back to the help file)

add libfmodex.a to your linker parameters (see above on how to do this)
[/b:2abzn88h]
now THAT is a straight answer.

  • You must to post comments
0
0

To compile the "C" example(s) without dev-c++ complaining about errors in the fmod_h
change the include order at the top of the main.c file of the example
from (eg for the 3d example):
[code:1d068mot]
/*===============================================================================================
3d Example
Copyright (c), Firelight Technologies Pty, Ltd 2004-2005.

This example shows how to basic 3d positioning
===============================================================================================*/

include "../../api/inc/fmod.h"

include "../../api/inc/fmod_errors.h"

include <windows.h>

include <stdio.h>

include <conio.h>

include <math.h>

[/code:1d068mot]
to
[code:1d068mot]
/*===============================================================================================
3d Example
Copyright (c), Firelight Technologies Pty, Ltd 2004-2005.

This example shows how to basic 3d positioning
===============================================================================================*/

include <windows.h>

include <stdio.h>

include <conio.h>

include <math.h>

include "../../api/inc/fmod.h"

include "../../api/inc/fmod_errors.h"

[/code:1d068mot]

  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.