I've been trying to follow the C example for "synth" in Qt. I received this error when trying to pass my CALLBACK function to BASS_StreamCreate:http://msdn.microsoft.com/en-us/library/ewcf0002%28v=VS.80%29.aspx
In the constructor for a Dialog window in Qt, I set config options on BASS, initialized it, and then used this piece of code:
HSTREAM stream = BASS_StreamCreate(44100, 2, 0, &WriteStream, 0);
In the same code file ("dialog.cpp"), just below the constructor, I wrote a CALLBACK function:
uint CALLBACK WriteStream(HSTREAM handle, short* buffer, uint length, void* user)
These are my includes:
The actual error I'm receiving is "...\dialog.cpp:30: error: C2065: 'WriteStream' : undeclared identifier" (line 30 is the Bass_StreamCreate call).
I also tried this:
HSTREAM stream = BASS_StreamCreate(44100, 2, 0, (STREAMPROC*)WriteStream, 0);
as it was used in the synth example, and I tried using DWORD in the CALLBACK function just to make sure it wasn't some type of mismatch error (although from my understanding, DWORD and uint are replaceable):
DWORD CALLBACK WriteStream(HSTREAM handle, short* buffer, DWORD length, void* user)
I think it should go without saying, but if I comment out the Bass_StreamCreate call (and the BASS_ChannelPlay call after it, which I did not mention before because it's irrelevant), the code executes without any problems.
I'm new to C++ and Qt, so I'm not surprised to receive an error like this. It seems like the error I'm receiving is telling me that it's having problems "finding" my WriteStream CALLBACK function, but it's right there! :O What's wrong, and how do I fix it?