--------------------Configuration: DMusic - Win32 Debug--------------------
Linking...
winmain.obj : error LNK2001: unresolved external symbol "public: long __thiscall CWaveFile::Read(unsigned char *,unsigned long,unsigned long *)" (?Read@CWaveFile@@QAEJPAEKPAK@Z)
winmain.obj : error LNK2001: unresolved external symbol "public: long __thiscall CWaveFile::ResetFile(void)" (?ResetFile@CWaveFile@@QAEJXZ)
winmain.obj : error LNK2001: unresolved external symbol "public: unsigned long __thiscall CWaveFile::GetSize(void)" (?GetSize@CWaveFile@@QAEKXZ)
winmain.obj : error LNK2001: unresolved external symbol "public: long __thiscall CWaveFile::Open(char *,struct tWAVEFORMATEX *,unsigned long)" (?Open@CWaveFile@@QAEJPADPAUtWAVEFORMATEX@@K@Z)
winmain.obj : error LNK2001: unresolved external symbol "public: __thiscall CWaveFile::CWaveFile(void)" (??0CWaveFile@@QAE@XZ)
Debug/DMusic.exe : fatal error LNK1120: 5 unresolved externals
Error executing link.exe.
DMusic.exe - 6 error(s), 0 warning(s)
I never understood this
Hey, I've never understood what these errors mean. Could someone help me please?
Thanks in advance.
Usually signifies that you have included the header but not the associated .lib(library) file. Do you mean you want to know exactly what 'unresolved external symbol' means?
Or if CWaveFile is your own class, you forgot to include CWaveFile:: part in front of all your function definitions, or just outright forgot to define the functions at all.
It actually is a bit wider than that, it says: 'You have called a function, which I see is defined, but I cannot find the declaration.'
So it can find the prototype, but not the code itself. This can either be caused by an unlinked .lib, or unfilled function (in a class).
So it can find the prototype, but not the code itself. This can either be caused by an unlinked .lib, or unfilled function (in a class).
Oops, yeah that too. I usually overlook the most obvious problem. (very bad habit when debugin')[wink]
I don't know, my code looks like this:
As to me knowing what unresolved link error means, I only know that somtimes it means you forgot to include a .lib file in the linking settings. But that's not the case this time I knwo for sure. I have all the required .lib's I already checked.
CWaveFile *wavFile; wavFile = new CWaveFile(); //Open the wav file test.wav wavFile->Open( "test.wav", NULL, WAVEFILE_READ ); //check to make sure the wav file is vaild if( wavFile->GetSize( ) == 0 ) { //invaild file msgwar( "DSound Error", "Failed to open sound file" ); return(0); } //The previous block of code opens the file test.wav, //then makes sure the file has data in it. If the file has no data, //the program stops reading the file. DSBuffer->Lock(0, 64000, &pDSLockedBuffer, &dwDSLockedBufferSize, NULL, // No secondary is needed, NULL, // No secondary is needed //lock the entire buffer DSBLOCK_ENTIREBUFFER); //check the return code to make sure the lock was successful if(FAILED( hr )) { msgwar( "DSound Error", "Failed to lock buffer" ); return(0); } wavFile->ResetFile( ); //reset the wav file to the beginning //Read the wav file hr = wavFile->Read( ( BYTE* ) pDSLockedBuffer, dwDSLockedBufferSize, &dwWavDataRead ); //Check to make sure that the read process was successful if(FAILED( hr )) { msgwar( "DS Error", "Failed to read wav file" ); return(0); } //Play the file DSBuffer->Play( 0, 0, DSBPLAY_LOOPING );
As to me knowing what unresolved link error means, I only know that somtimes it means you forgot to include a .lib file in the linking settings. But that's not the case this time I knwo for sure. I have all the required .lib's I already checked.
Linker says you don't, and the linker is what matters.
And in this particular case, it's not a lib, it's DirectX's Direct Sound util code [dsutil.cpp, dsutil.h]
[edit: curses, too slow]
And in this particular case, it's not a lib, it's DirectX's Direct Sound util code [dsutil.cpp, dsutil.h]
[edit: curses, too slow]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement