• Advertisement

Archived

This topic is now archived and is closed to further replies.

Don't worry... THis is a different DSound question.

This topic is 5830 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Ok... I''m very close to getting this to work. Thanks to all who answered my last question, I had to do a lot of fiddling around and by mixing a couple of different people''s strategies, I was able to fix the problem. Now, I have made a class called CWave, which loads a sound file. When I compile the program however, I get a bunch of linker errors similiar to what you''d see if you forgot to include a .lib file. Here are the errors: SGTBM.obj : error LNK2001: unresolved external symbol "public: virtual __thiscall CWave::~CWave(void)" (??1CWave@@UAE@XZ) SGTBM.obj : error LNK2001: unresolved external symbol "public: int __thiscall CWave::Create(char const *)" (?Create@CWave@@QAEHPBD@Z) SGTBM.obj : error LNK2001: unresolved external symbol "public: __thiscall CWave::CWave(void)" (??0CWave@@QAE@XZ) SGTBM.obj : error LNK2001: unresolved external symbol "public: unsigned long __thiscall CWave::GetData(unsigned char * &,unsigned long)const " (?GetData@CWave@@QBEKAAPAEK@Z) SGTBM.obj : error LNK2001: unresolved external symbol "public: int __thiscall CWave::GetFormat(struct tWAVEFORMATEX &)const " (?GetFormat@CWave@@QBEHAAUtWAVEFORMATEX@@@Z) SGTBM.obj : error LNK2001: unresolved external symbol "public: unsigned long __thiscall CWave::GetDataLen(void)const " (?GetDataLen@CWave@@QBEKXZ) hmm... I realize this pasted a little messy... I hope you can decode it Could someone tell me what I''m doing wrong? I know it is simple.

Share this post


Link to post
Share on other sites
Advertisement
Did you write the member function implementations? ie. int CWave::Create( const char * ) { blah blah return 0; } I have had problems building an app if i forgot to do that for my member funcs before.

-SirKnight

Share this post


Link to post
Share on other sites
its quite simple you are not linking to the object code or the linker cant find it. which means you either did not include the source file in your project, you have the prject set not to compile the code, or the final soultion is you screwed something up royally

Share this post


Link to post
Share on other sites
Hmm... This is the way I'm including everything now, maybe that'll help
#include <windows.h> // include important windows stuff
#include <windowsx.h>
#include <stdlib.h>
#include <memory.h>
#include <string.h>
#include <stdarg.h>
#include <stdio.h>
#include <math.h>
#define INITGUID
#include <ddraw.h>
#include "ddutil.cpp"
#include <dinput.h>
#include <mmreg.h>
#include <dsound.h>
#include "Wave.h"


Sponge Factory
--Muzlack

Edited by - Muzlack on February 3, 2002 11:26:49 AM

Share this post


Link to post
Share on other sites
Hmm... No one knows the answer to this question? It shouldn''t even be a DirectSound question, its probably just a c++ thing that I''m not familiar with, could someone plz fill me in here?

Sponge Factory
--Muzlack

Share this post


Link to post
Share on other sites
i will REPEAT this for the illiterate.

quote:

... you are not linking to the object code or the linker cant find it. which means you either did not include the source file in your project, you have the project set not to compile the code ...



what part of that do you not understand? how to include files in your PROJECT (ie not use #include)? if thats the case get back to basics and learn the compiler before trying to code anything. you obviusly dont know what you are doing. maybe you should go through some tutorials on vc++ that are on the web (seek google.com for them).

Share this post


Link to post
Share on other sites
Ok, I DO know what include into the project meant, I tested that too, but when I did this, the compiler came up with even MORE errors, 60 to be exact for problems not even related to the problem, so I didn''t even bother mentioning this, cause I thought maybe I misinterpreted, and that you might not think I was #including them. This does not fix my error, I tried both suggestions, neither of them work, sorry

Sponge Factory
--Muzlack

Share this post


Link to post
Share on other sites
well that means you have problems with your code. simple as that. you may not realize this, but by not compiling the source file into object code the linker CANT link to that code. so technically according to the compiler you did NOT write the functions and SirKnight was correct.

this is why ppl should learn what a compiler is before programming and should learn basic syntax and debugging before using apis like dx or opengl. i mean if you cant debug a simple thing like this (it is simple, you go through ALL the errors and fix them, you may have forgotten thing like parentisis or brackets which can cause more then one error). try fixing all the errors or rewrite your class so it is coded correctly. in either case me or SirKnight are correct in how to fix your problem whether you like it or not.

i still stand by what i said previously as well

quote:

... get back to basics and learn the compiler before trying to code anything. you obviusly dont know what you are doing. maybe you should go through some tutorials on vc++ that are on the web (seek google.com for them).

Share this post


Link to post
Share on other sites

  • Advertisement