Dev-C++ - linker error with DirectSoundCreate!

Started by
3 comments, last by MoreK 20 years, 5 months ago
Hi I installed Dev-C++ 4.9.8.4 and downloaded DirectX9 package with the WebUpdate utility. To test the setup I downloaded some example code from http://www.gametutorials.com/Tutorials/DirectX/DirectX_Pg1.htm I managed to compile, link and run the fist two (DirectDraw) examples. But when I downloaded Direct Sound examples, I started to get the same linker error: [Linker error] undefined reference to `DirectSoundCreate@12'' Yes, I have added all DirectX libraries (including libdsound.a) to Project Options/Parameter/Linker. Does anyone know how to fix this, PLEASE? DirectSound was the first reason I started to digging into this. I have searched all possible sites and forums, and I can see some other persons have had the same issue. But I haven''t found a solution yet. PLEASE! BR; More K, Helsinki
Advertisement
Hey, I''m having *exactly* the same problem!

Direct Draw works fine, directsound gives the ''DirectSoundCreate@12'' error.

I''ve tried googling for every possible combination of "DirectSoundCreate", "Linker error", "libraries", etc, etc, but I can''t find the answer anywhere.

I also tried using DirectSound8 rather than DirectSound but that doesn''t help either, other than giving a slightly different error.

I did find that including "mmsystem.h" is neccessary when using DirectSound, otherwise I got even more errors. I guess you might need the corresponding library too (libwinmm.a with MingW) though that doesn''t seem to make any difference.

Another thing I found was something about someone having a problem with the number of "_" underscores in front of function names in DirectX. I started experimenting with underscores in the directsound header file, the directsound library file and the directsound .ref file (not even sure exactly what that last sort of file is), under the assumption that I could always just reinstall DirectX.

However, for some reason the DirectX devpack has disappeared from the available packagage list in Dev-C++ update - is that just my computer, a temporary problem with the server, or an indication of a more major issue?

I think I''ll be leaving DirectSound alone for now, I sure hope someone can help us though.
Try putting these in a source file.
#pragma comment(lib,"dsound.lib")
#pragma comment(lib,"dxguid.lib")

and use these headers also:
#include <dsound.h>
Go on an Intense Rampage
He''s talking about Dev C++ not Visual C++ ...
I''m the anon guy again.

I think I''ve found a solution - it compiles OK if I use the DirectX 8 dsound library rather than the DX 9 one.

You can download the DirectX 8 dev kit for Dev-C++ under the resources section of th Dev-C++ site.

I hope I don''t speak too soon though, I''ve not actually tried to make it play a sound yet...

This topic is closed to new replies.

Advertisement