0
0

I’m trying to build a C++ app using the latest Dev-C++ ( 4.9.8.7), and I’m getting the following compiler error:

invalid use of undefined type ‘struct FSOUND_STREAM’

I was able to use these constructs under linux using g++, but under Windows/Dev-C++ it seems to be unhappy.

I modified the stream example code to demonstrate the problem:

[code:1hdm3oor]

if defined(WIN32) || defined(WATCOMC)

#include <windows.h>
#include <conio.h>

else

#include "../../api/inc/wincompat.h"

endif

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

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

class junk
{
public:
FSOUND_STREAM *str;
};

int main(int argc, char *argv[])
{
junk *j = new junk( );

j-&gt;str = 0;
if ( j-&gt;str ) 
{
  delete j-&gt;str;
}   
return ( -1 );

}[/code:1hdm3oor]

In the example it doesn’t seem to matter if j is a pointer or not. I can make it work by making j.str a FSOUND_STREAM ** , but that’s annoying.

Any suggestions?

-S-

  • You must to post comments
0
0

…interestingly enough it only gripes about the “delete j->str” line. If I want to leak memory I’ll be good to go. Am I missing something here?

-S-

  • You must to post comments
0
0

I don’t think you are supposed to delete that.
You should use FSOUND_Stream_Close for that I think.

The only thing you know about FSOUND_STREAM from fmod.h is that it is a pointer to a data structure, but you don’t know exactly what it contains,…
I think that is the reason why it can’t be deleted.

  • You must to post comments
0
0

Ahh..ok, I am calling FSOUND_Stream_Close – just didn’t realize that did all the cleanup I needed.

Thanks

  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.