I have a problem with getting this one symbol resolved and I just can't seem to figure it out. I installed Dev-C++ & DirectX 9.0 Dev pack and got started. After a while, I built the program, which uses D3D9, D3DX, DSound, and DInput. So I set the libxxx.a equiliviants of them and began to link. One single error:
[Linker error] undefined reference to `DirectSoundCreate8@12'
Well, I am linking with the only library provided for DirectSound -- libdsound.a, and all of my other DirectSound functions work, eg: the class ones. Everything works fine except for that one function.
I opened libdsound.a and there were a few possible cananidates for it:
However, none of these seemed to actually resolve the reference. Of course this library resolved all of the other directSound functions, it just won't resolve this, and its very strange, considering atleast ONE of these functions should have a properly mangled name for me to use...
I don't consider myself an idiot, but I really want to know weither I am making a fundimental linking error or weither the actual DevPak for DirectX9 has a missing function call, which is what I suspect.
Here are the libs:
libdxtrans.a
libgdi32.a
libkernel32.a
libwinmm.a
libwinspool.a
libws2_32.a
libcomdlg32.a
libd3d9.a
libd3dx9d.a
libd3dxof.a
libdinput8.a
libdinput.a
libdsound.a
libdxapi.a
libdxguid.a
and the exact error:
(Sound.o)(.text+0x158):Sound.cpp: undefined reference to `DirectSoundCreate8@12'
PS -- I got really frustrated and just for grins, I tried linking with >>EVERY<< lib (*.a + *.lib) file just to see if *ONE* of them could resolve it. None did it and I wasted 5 minutes on linking. This is why I believe that the error is in the translation of the MS provided dsound.lib to libdsound.a had an error and therefore references (or atleast correct ones) may not exist and the DirectX 9 DevPak has an error. I will try to find a way to fix this problem, but I am fresh out of ideas. Any help will be apprieciated. Maybe someone could try making a simple DSound program with DirectSoundCreate8 function using <dsound.h>
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
DirectSoundCreate is in a DSOUND.DEF file which indicates it may be dynamically linked instead of static. Does the DirectX documentation have any information on this?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Its not dynamically linked, as I have used VC++ and you will get undefined references to all DSound functions if you don't link with dsound.lib. Whats more, its in the library file as I said before.
Well, I did solve my problem. I just downloaded DXSDK from MS, and linked with the original dsound.lib. I thought it was going to give ld a heartattack, but it turns out ld can link with the .lib files provided (and probably compiled on MSVC) by Microsoft. I have yet to test the program, so it might still crash or something...
--Figgles
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Yes, the program runs fine, and I was the Original Poster. I guess that is solved, whew. I just wish I could solve the problem completely, not just find a cheap work around. But to some degree, I don't care as long as it works.
-- Figgles
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have a problem with getting this one symbol resolved and I just can't seem to figure it out. I installed Dev-C++ & DirectX 9.0 Dev pack and got started. After a while, I built the program, which uses D3D9, D3DX, DSound, and DInput. So I set the libxxx.a equiliviants of them and began to link. One single error:
[Linker error] undefined reference to `DirectSoundCreate8@12'
Well, I am linking with the only library provided for DirectSound -- libdsound.a, and all of my other DirectSound functions work, eg: the class ones. Everything works fine except for that one function.
I opened libdsound.a and there were a few possible cananidates for it:
DirectSoundCreate8@12
_DirectSoundCreate8
__DirectSoundCreate8@12
__imp___DirectSoundCreate8@12
However, none of these seemed to actually resolve the reference. Of course this library resolved all of the other directSound functions, it just won't resolve this, and its very strange, considering atleast ONE of these functions should have a properly mangled name for me to use...
I don't consider myself an idiot, but I really want to know weither I am making a fundimental linking error or weither the actual DevPak for DirectX9 has a missing function call, which is what I suspect.
Here are the libs:
libdxtrans.a
libgdi32.a
libkernel32.a
libwinmm.a
libwinspool.a
libws2_32.a
libcomdlg32.a
libd3d9.a
libd3dx9d.a
libd3dxof.a
libdinput8.a
libdinput.a
libdsound.a
libdxapi.a
libdxguid.a
and the exact error:
(Sound.o)(.text+0x158):Sound.cpp: undefined reference to `DirectSoundCreate8@12'
PS -- I got really frustrated and just for grins, I tried linking with >>EVERY<< lib (*.a + *.lib) file just to see if *ONE* of them could resolve it. None did it and I wasted 5 minutes on linking. This is why I believe that the error is in the translation of the MS provided dsound.lib to libdsound.a had an error and therefore references (or atleast correct ones) may not exist and the DirectX 9 DevPak has an error. I will try to find a way to fix this problem, but I am fresh out of ideas. Any help will be apprieciated. Maybe someone could try making a simple DSound program with DirectSoundCreate8 function using <dsound.h>
DirectSoundCreate is in a DSOUND.DEF file which indicates it may be dynamically linked instead of static. Does the DirectX documentation have any information on this?
Its not dynamically linked, as I have used VC++ and you will get undefined references to all DSound functions if you don't link with dsound.lib. Whats more, its in the library file as I said before.
Well, I did solve my problem. I just downloaded DXSDK from MS, and linked with the original dsound.lib. I thought it was going to give ld a heartattack, but it turns out ld can link with the .lib files provided (and probably compiled on MSVC) by Microsoft. I have yet to test the program, so it might still crash or something...
--Figgles
OP (Figgles?) --
Nice work! This has come up before. I hope you'll report back on your testing....
-- Jim.
Yes, the program runs fine, and I was the Original Poster. I guess that is solved, whew. I just wish I could solve the problem completely, not just find a cheap work around. But to some degree, I don't care as long as it works.
-- Figgles