0
0

My program was workin fine then all of a sudden is starts up with this error:


Compiling…
Utopia.cpp
C:\Program Files\Microsoft Visual Studio\MyProjects\Utopia\Utopia.cpp(143) : error C2065: ‘stream’ : undeclared identifier
Error executing cl.exe.

Utopia.exe – 1 error(s), 0 warning(s)


I am learning functions in C++ and I am converting my program… This is the code it no like:

void FadeOut()
{
//Music Fade Out
for (int i=255; i>=0; i-=1)
{
FSOUND_SetVolumeAbsolute(0,i);
Sleep(1);
}

//Music Stop
FSOUND_Stream_Close(stream); 
FSOUND_Close();

}
help?!? Bret, save me again!

  • You must to post comments
0
0

Where do you have the stream variable declared?

  • You must to post comments
0
0

Yeha I thought about that but I never needed to have it declared before…
Is it an integer? Because ill try declaring it and see what happens.

  • You must to post comments
0
0

sry for the double post

I tried int and it didn’t work so I tried a ‘struct’ variable… I have no idea what one is and now the error is:

——————–Configuration: Utopia – Win32 Debug——————–
Compiling…
Utopia.cpp
C:\Program Files\Microsoft Visual Studio\MyProjects\Utopia\Utopia.cpp(195) : error C2275: ‘stream’ : illegal use of this type as an expression
C:\Program Files\Microsoft Visual Studio\MyProjects\Utopia\Utopia.cpp(27) : see declaration of ‘stream’
Error executing cl.exe.

Utopia.exe – 1 error(s), 0 warning(s)

this is how I tried to declare it (I R n00b):
struct stream;

  • You must to post comments
0
0

Just looking at the return value of FSOUND_Stream_Open and the parameter that FSOUND_Stream_Close takes tells you that the stream variable must be declared as a FSOUND_STREAM type. But what it could also be is that you have the stream variable in the wrong scope.

  • You must to post comments
0
0

variable in the wrong scope???

I tried declaring it as:
FSOUND_STREAM stream;

It didn’t like it…

I guess my question is when, how, and where u declare ‘stream’.

  • You must to post comments
Showing 5 results
Your Answer

Please first to submit.