Linker errors with SDKsound.cpp

Last post 05-02-2008, 9:30 PM by Al. 13 replies.
Sort Posts: Previous Next
  •  04-29-2008, 7:31 PM

    Linker errors with SDKsound.cpp

    Hey,

    So I'm learning how to use DirectSound, and I'm using the classes in SDKsound.cpp and SDKsound.h to load .wav files. My project compiles ok, but I get linker errors about undefined external symbols. I tried copying the files from the SDK directly into my project folder, but all that did was force me to change my project's character set to unicode, making me cast all my strings with (LPWCSTR) (or something like that), and I still ended up with linker errors (even more actually). So, anyone who uses SDKsound know what's going on? Here is the build record:

    ------ Build started: Project: DirectXTest, Configuration: Debug Win32 ------
    Compiling...
    main.cpp
    c:\documents and settings\alec_2\desktop\directxtest\directxtest\main.cpp(96) : warning C4244: 'argument' : conversion from 'time_t' to 'unsigned int', possible loss of data
    Linking...
    main.obj : error LNK2019: unresolved external symbol "public: long __thiscall CSoundManager::Create(class CSound * *,wchar_t *,unsigned long,struct _GUID,unsigned long)" (?Create@CSoundManager@@QAEJPAPAVCSound@@PA_WKU_GUID@@K@Z) referenced in function "int __cdecl GameInit(struct HWND__ *)" (?GameInit@@YAHPAUHWND__@@@Z)
    main.obj : error LNK2019: unresolved external symbol "public: long __thiscall CSoundManager::Initialize(struct HWND__ *,unsigned long)" (?Initialize@CSoundManager@@QAEJPAUHWND__@@K@Z) referenced in function "int __cdecl InitDirectSound(struct HWND__ *)" (?InitDirectSound@@YAHPAUHWND__@@@Z)
    main.obj : error LNK2019: unresolved external symbol "public: __thiscall CSoundManager::CSoundManager(void)" (??0CSoundManager@@QAE@XZ) referenced in function "int __cdecl InitDirectSound(struct HWND__ *)" (?InitDirectSound@@YAHPAUHWND__@@@Z)
    main.obj : error LNK2019: unresolved external symbol "public: __thiscall CSoundManager::~CSoundManager(void)" (??1CSoundManager@@QAE@XZ) referenced in function "public: void * __thiscall CSoundManager::`scalar deleting destructor'(unsigned int)" (??_GCSoundManager@@QAEPAXI@Z)
    C:\Documents and Settings\Alec_2\Desktop\DirectXTest\Debug\DirectXTest.exe : fatal error LNK1120: 4 unresolved externals
    Build log was saved at "file://c:\Documents and Settings\Alec_2\Desktop\DirectXTest\DirectXTest\Debug\BuildLog.htm"
    DirectXTest - 5 error(s), 1 warning(s)
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

    Any help is GREATLY appreciated. And soory if this is the wrong forum.

    Viri qui habent nullum, timent nullum.
    Men who have nothing, fear nothing.
  •  04-30-2008, 8:33 PM

    Re: Linker errors with SDKsound.cpp

    Err.... anyone? I mean someone has to use SDKsound.h, dont they?

    Viri qui habent nullum, timent nullum.
    Men who have nothing, fear nothing.
  •  04-30-2008, 9:49 PM

    Re: Linker errors with SDKsound.cpp

    Well, from the output it looks like you do not compile the SDKsound.cpp with your project, e.g. it is not included in your project - there's only a main.cpp and the missing stuff is implemented in SDKsound.cpp.
    We are boki. The rest is known.
    The not so known part of the rest: It is Björn or Bjoern, but never Bjorn.
  •  04-30-2008, 9:59 PM

    Re: Linker errors with SDKsound.cpp

    SDKsound.cpp needs to be part of the project? At first I had tried including it like this:
    #include <SDKsound.h>


    and adding it's directory to the compiler options. I tried putting it directly in the project, and I remember getting simmilar errors, but I'll try again and see what I get.

    Edit: I copied SDKsound.cpp and SDKsound.h directly into my project and included it like like this: #include "SDKsound.h", and I still get basically the same errors:

    ------ Build started: Project: DirectXTest, Configuration: Debug Win32 ------
    Compiling...
    main.cpp
    c:\documents and settings\alec_2\desktop\directxtest\directxtest\main.cpp(97) : warning C4244: 'argument' : conversion from 'time_t' to 'unsigned int', possible loss of data
    Linking...
    SDKsound.obj : error LNK2019: unresolved external symbol "long __stdcall DXUTTrace(char const *,unsigned long,long,wchar_t const *,bool)" (?DXUTTrace@@YGJPBDKJPB_W_N@Z) referenced in function "public: long __thiscall CSoundManager::Initialize(struct HWND__ *,unsigned long)" (?Initialize@CSoundManager@@QAEJPAUHWND__@@K@Z)
    SDKsound.obj : error LNK2019: unresolved external symbol "public: unsigned long __thiscall CWaveFile::GetSize(void)" (?GetSize@CWaveFile@@QAEKXZ) referenced in function "public: long __thiscall CSoundManager::Create(class CSound * *,wchar_t *,unsigned long,struct _GUID,unsigned long)" (?Create@CSoundManager@@QAEJPAPAVCSound@@PA_WKU_GUID@@K@Z)
    SDKsound.obj : error LNK2019: unresolved external symbol "public: long __thiscall CWaveFile::Open(wchar_t *,struct tWAVEFORMATEX *,unsigned long)" (?Open@CWaveFile@@QAEJPA_WPAUtWAVEFORMATEX@@K@Z) referenced in function "public: long __thiscall CSoundManager::Create(class CSound * *,wchar_t *,unsigned long,struct _GUID,unsigned long)" (?Create@CSoundManager@@QAEJPAPAVCSound@@PA_WKU_GUID@@K@Z)
    SDKsound.obj : error LNK2019: unresolved external symbol "public: __thiscall CWaveFile::CWaveFile(void)" (??0CWaveFile@@QAE@XZ) referenced in function "public: long __thiscall CSoundManager::Create(class CSound * *,wchar_t *,unsigned long,struct _GUID,unsigned long)" (?Create@CSoundManager@@QAEJPAPAVCSound@@PA_WKU_GUID@@K@Z)
    SDKsound.obj : error LNK2019: unresolved external symbol "public: __thiscall CWaveFile::~CWaveFile(void)" (??1CWaveFile@@QAE@XZ) referenced in function "public: void * __thiscall CWaveFile::`scalar deleting destructor'(unsigned int)" (??_GCWaveFile@@QAEPAXI@Z)
    SDKsound.obj : error LNK2019: unresolved external symbol "public: long __thiscall CWaveFile::OpenFromMemory(unsigned char *,unsigned long,struct tWAVEFORMATEX *,unsigned long)" (?OpenFromMemory@CWaveFile@@QAEJPAEKPAUtWAVEFORMATEX@@K@Z) referenced in function "public: long __thiscall CSoundManager::CreateFromMemory(class CSound * *,unsigned char *,unsigned long,struct tWAVEFORMATEX *,unsigned long,struct _GUID,unsigned long)" (?CreateFromMemory@CSoundManager@@QAEJPAPAVCSound@@PAEKPAUtWAVEFORMATEX@@KU_GUID@@K@Z)
    SDKsound.obj : error LNK2019: unresolved external symbol "public: long __thiscall CWaveFile::Read(unsigned char *,unsigned long,unsigned long *)" (?Read@CWaveFile@@QAEJPAEKPAK@Z) referenced in function "public: long __thiscall CSound::FillBufferWithSound(struct IDirectSoundBuffer *,int)" (?FillBufferWithSound@CSound@@QAEJPAUIDirectSoundBuffer@@H@Z)
    SDKsound.obj : error LNK2019: unresolved external symbol "public: long __thiscall CWaveFile::ResetFile(void)" (?ResetFile@CWaveFile@@QAEJXZ) referenced in function "public: long __thiscall CSound::FillBufferWithSound(struct IDirectSoundBuffer *,int)" (?FillBufferWithSound@CSound@@QAEJPAUIDirectSoundBuffer@@H@Z)
    C:\Documents and Settings\Alec_2\Desktop\DirectXTest\Debug\DirectXTest.exe : fatal error LNK1120: 8 unresolved externals
    Build log was saved at "file://c:\Documents and Settings\Alec_2\Desktop\DirectXTest\DirectXTest\Debug\BuildLog.htm"
    DirectXTest - 9 error(s), 1 warning(s)
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


    Viri qui habent nullum, timent nullum.
    Men who have nothing, fear nothing.
  •  04-30-2008, 11:47 PM

    Re: Linker errors with SDKsound.cpp

    Now all that is left is to add DXUT.h and DXUT.cpp from the core folder to your project.
    We are boki. The rest is known.
    The not so known part of the rest: It is Björn or Bjoern, but never Bjorn.
  •  05-01-2008, 7:42 AM

    Re: Linker errors with SDKsound.cpp

    Allright, I'm away from my home computerright now, but I'll try it when I get home. Why do these files need to be directly placed in the project? Why that can't be linked(right word?) to remotely(again, right word?) like #include <stdio.h>?
    Viri qui habent nullum, timent nullum.
    Men who have nothing, fear nothing.
  •  05-01-2008, 12:02 PM

    Re: Linker errors with SDKsound.cpp

    That's the way C++ works :) The .h files define the interface while the .cpp implement it. The separation is there as compiling large chunks of code can take quite some time (as compared to languages like C#). Technically .cpp can be included just like .h files but this might result in global variable clashes and not really worth it anyway.


    We are boki. The rest is known.
    The not so known part of the rest: It is Björn or Bjoern, but never Bjorn.
  •  05-01-2008, 7:48 PM

    Re: Linker errors with SDKsound.cpp

    Ok, so I added DUXT.cpp and DXUT.h, causing me to change my project build to unicdoe (trying to avoid that, but w/e), then it complained about not having SDKwavefile(.cpp & .h), so I added those, and then I get these errors:

    ------ Build started: Project: DirectXTest, Configuration: Debug Win32 ------
    Compiling...
    main.cpp
    c:\documents and settings\alec_2\desktop\directxtest\directxtest\main.cpp(97) : warning C4244: 'argument' : conversion from 'time_t' to 'unsigned int', possible loss of data
    SDKsound.cpp
    SDKwavefile.cpp
    Generating Code...
    Linking...
    SDKsound.obj : error LNK2019: unresolved external symbol "long __stdcall DXUTTrace(char const *,unsigned long,long,wchar_t const *,bool)" (?DXUTTrace@@YGJPBDKJPB_W_N@Z) referenced in function "public: long __thiscall CSoundManager::Initialize(struct HWND__ *,unsigned long)" (?Initialize@CSoundManager@@QAEJPAUHWND__@@K@Z)
    DXUT.obj : error LNK2001: unresolved external symbol "long __stdcall DXUTTrace(char const *,unsigned long,long,wchar_t const *,bool)" (?DXUTTrace@@YGJPBDKJPB_W_N@Z)
    DXUT.obj : error LNK2019: unresolved external symbol "public: void __thiscall CDXUTTimer::Reset(void)" (?Reset@CDXUTTimer@@QAEXXZ) referenced in function "long __stdcall DXUTInit(bool,bool,wchar_t *,bool)" (?DXUTInit@@YGJ_N0PA_W0@Z)
    DXUT.obj : error LNK2019: unresolved external symbol "class CDXUTTimer * __stdcall DXUTGetGlobalTimer(void)" (?DXUTGetGlobalTimer@@YGPAVCDXUTTimer@@XZ) referenced in function "long __stdcall DXUTInit(bool,bool,wchar_t *,bool)" (?DXUTInit@@YGJ_N0PA_W0@Z)
    DXUT.obj : error LNK2019: unresolved external symbol "void __cdecl DXUTOutputDebugStringW(wchar_t const *,...)" (?DXUTOutputDebugStringW@@YAXPB_WZZ) referenced in function "void __cdecl DXUTParseCommandLine(wchar_t *)" (?DXUTParseCommandLine@@YAXPA_W@Z)
    DXUT.obj : error LNK2019: unresolved external symbol "void __cdecl DXUTEnableXInput(bool)" (?DXUTEnableXInput@@YAX_N@Z) referenced in function "long __stdcall DXUTStaticWndProc(struct HWND__ *,unsigned int,unsigned int,long)" (?DXUTStaticWndProc@@YGJPAUHWND__@@IIJ@Z)
    DXUT.obj : error LNK2019: unresolved external symbol "long __stdcall DXUTFindValidDeviceSettings(struct DXUTDeviceSettings *,struct DXUTDeviceSettings *,struct DXUTMatchOptions *)" (?DXUTFindValidDeviceSettings@@YGJPAUDXUTDeviceSettings@@0PAUDXUTMatchOptions@@@Z) referenced in function "long __stdcall DXUTCreateDevice(bool,int,int)" (?DXUTCreateDevice@@YGJ_NHH@Z)
    DXUT.obj : error LNK2019: unresolved external symbol "void __stdcall DXUTConvertDeviceSettings9to10(struct DXUTD3D9DeviceSettings *,struct DXUTD3D10DeviceSettings *)" (?DXUTConvertDeviceSettings9to10@@YGXPAUDXUTD3D9DeviceSettings@@PAUDXUTD3D10DeviceSettings@@@Z) referenced in function "long __stdcall DXUTCreateDevice(bool,int,int)" (?DXUTCreateDevice@@YGJ_NHH@Z)
    DXUT.obj : error LNK2019: unresolved external symbol "struct HMONITOR__ * __stdcall DXUTMonitorFromWindow(struct HWND__ *,unsigned long)" (?DXUTMonitorFromWindow@@YGPAUHMONITOR__@@PAUHWND__@@K@Z) referenced in function "long __cdecl DXUTChangeDevice(struct DXUTDeviceSettings *,struct IDirect3DDevice9 *,struct ID3D10Device *,bool,bool)" (?DXUTChangeDevice@@YAJPAUDXUTDeviceSettings@@PAUIDirect3DDevice9@@PAUID3D10Device@@_N3@Z)
    DXUT.obj : error LNK2019: unresolved external symbol "int __stdcall DXUTGetMonitorInfo(struct HMONITOR__ *,struct tagMONITORINFO *)" (?DXUTGetMonitorInfo@@YGHPAUHMONITOR__@@PAUtagMONITORINFO@@@Z) referenced in function "long __cdecl DXUTChangeDevice(struct DXUTDeviceSettings *,struct IDirect3DDevice9 *,struct ID3D10Device *,bool,bool)" (?DXUTChangeDevice@@YAJPAUDXUTDeviceSettings@@PAUIDirect3DDevice9@@PAUID3D10Device@@_N3@Z)
    DXUT.obj : error LNK2019: unresolved external symbol "long __stdcall DXUT_Dynamic_CreateDXGIFactory(struct _GUID const &,void * *)" (?DXUT_Dynamic_CreateDXGIFactory@@YGJABU_GUID@@PAPAX@Z) referenced in function "long __cdecl DXUTDelayLoadDXGI(void)" (?DXUTDelayLoadDXGI@@YAJXZ)
    DXUT.obj : error LNK2019: unresolved external symbol "struct IDirect3D9 * __stdcall DXUT_Dynamic_Direct3DCreate9(unsigned int)" (?DXUT_Dynamic_Direct3DCreate9@@YGPAUIDirect3D9@@I@Z) referenced in function "long __cdecl DXUTDelayLoadD3D9(void)" (?DXUTDelayLoadD3D9@@YAJXZ)
    DXUT.obj : error LNK2019: unresolved external symbol "public: class CD3D9EnumAdapterInfo * __thiscall CD3D9Enumeration::GetAdapterInfo(unsigned int)" (?GetAdapterInfo@CD3D9Enumeration@@QAEPAVCD3D9EnumAdapterInfo@@I@Z) referenced in function "long __cdecl DXUTCreate3DEnvironment9(struct IDirect3DDevice9 *)" (?DXUTCreate3DEnvironment9@@YAJPAUIDirect3DDevice9@@@Z)
    DXUT.obj : error LNK2019: unresolved external symbol "class CD3D9Enumeration * __stdcall DXUTGetD3D9Enumeration(bool)" (?DXUTGetD3D9Enumeration@@YGPAVCD3D9Enumeration@@_N@Z) referenced in function "long __cdecl DXUTCreate3DEnvironment9(struct IDirect3DDevice9 *)" (?DXUTCreate3DEnvironment9@@YAJPAUIDirect3DDevice9@@@Z)
    DXUT.obj : error LNK2019: unresolved external symbol "public: void __thiscall CDXUTTimer::GetTimeValues(double *,double *,float *)" (?GetTimeValues@CDXUTTimer@@QAEXPAN0PAM@Z) referenced in function "void __cdecl DXUTRender3DEnvironment9(void)" (?DXUTRender3DEnvironment9@@YAXXZ)
    DXUT.obj : error LNK2019: unresolved external symbol "public: class CD3D9EnumDeviceInfo * __thiscall CD3D9Enumeration::GetDeviceInfo(unsigned int,enum _D3DDEVTYPE)" (?GetDeviceInfo@CD3D9Enumeration@@QAEPAVCD3D9EnumDeviceInfo@@IW4_D3DDEVTYPE@@@Z) referenced in function "long __cdecl DXUTFindD3D9AdapterFormat(unsigned int,enum _D3DDEVTYPE,enum _D3DFORMAT,int,enum _D3DFORMAT *)" (?DXUTFindD3D9AdapterFormat@@YAJIW4_D3DDEVTYPE@@W4_D3DFORMAT@@HPAW42@@Z)
    DXUT.obj : error LNK2019: unresolved external symbol "public: class CGrowableArray<class CD3D10EnumAdapterInfo *> * __thiscall CD3D10Enumeration::GetAdapterInfoList(void)" (?GetAdapterInfoList@CD3D10Enumeration@@QAEPAV?$CGrowableArray@PAVCD3D10EnumAdapterInfo@@@@XZ) referenced in function "long __stdcall DXUTSetD3D10Device(struct ID3D10Device *,struct IDXGISwapChain *)" (?DXUTSetD3D10Device@@YGJPAUID3D10Device@@PAUIDXGISwapChain@@@Z)
    DXUT.obj : error LNK2019: unresolved external symbol "class CD3D10Enumeration * __stdcall DXUTGetD3D10Enumeration(bool,bool)" (?DXUTGetD3D10Enumeration@@YGPAVCD3D10Enumeration@@_N0@Z) referenced in function "long __stdcall DXUTSetD3D10Device(struct ID3D10Device *,struct IDXGISwapChain *)" (?DXUTSetD3D10Device@@YGJPAUID3D10Device@@PAUIDXGISwapChain@@@Z)
    DXUT.obj : error LNK2019: unresolved external symbol "public: class CD3D10EnumAdapterInfo * __thiscall CD3D10Enumeration::GetAdapterInfo(unsigned int)" (?GetAdapterInfo@CD3D10Enumeration@@QAEPAVCD3D10EnumAdapterInfo@@I@Z) referenced in function "long __cdecl DXUTCreate3DEnvironment10(struct ID3D10Device *)" (?DXUTCreate3DEnvironment10@@YAJPAUID3D10Device@@@Z)
    DXUT.obj : error LNK2019: unresolved external symbol "long __stdcall DXUT_Dynamic_D3D10CreateDevice(struct IDXGIAdapter *,enum D3D10_DRIVER_TYPE,unsigned int,void const *,unsigned int,struct ID3D10Device * *)" (?DXUT_Dynamic_D3D10CreateDevice@@YGJPAUIDXGIAdapter@@W4D3D10_DRIVER_TYPE@@IPBXIPAPAUID3D10Device@@@Z) referenced in function "long __cdecl DXUTCreate3DEnvironment10(struct ID3D10Device *)" (?DXUTCreate3DEnvironment10@@YAJPAUID3D10Device@@@Z)
    DXUT.obj : error LNK2019: unresolved external symbol "public: void __thiscall CDXUTTimer::Start(void)" (?Start@CDXUTTimer@@QAEXXZ) referenced in function "void __stdcall DXUTPause(bool,bool)" (?DXUTPause@@YGX_N0@Z)
    DXUT.obj : error LNK2019: unresolved external symbol "public: void __thiscall CDXUTTimer::Stop(void)" (?Stop@CDXUTTimer@@QAEXXZ) referenced in function "void __stdcall DXUTPause(bool,bool)" (?DXUTPause@@YGX_N0@Z)
    DXUT.obj : error LNK2019: unresolved external symbol "struct HMONITOR__ * __stdcall DXUTMonitorFromRect(struct tagRECT const *,unsigned long)" (?DXUTMonitorFromRect@@YGPAUHMONITOR__@@PBUtagRECT@@K@Z) referenced in function "struct HMONITOR__ * __cdecl DXUTGetMonitorFromAdapter(struct DXUTDeviceSettings *)" (?DXUTGetMonitorFromAdapter@@YAPAUHMONITOR__@@PAUDXUTDeviceSettings@@@Z)
    DXUT.obj : error LNK2019: unresolved external symbol "public: class CD3D10EnumOutputInfo * __thiscall CD3D10Enumeration::GetOutputInfo(unsigned int,unsigned int)" (?GetOutputInfo@CD3D10Enumeration@@QAEPAVCD3D10EnumOutputInfo@@II@Z) referenced in function "struct HMONITOR__ * __cdecl DXUTGetMonitorFromAdapter(struct DXUTDeviceSettings *)" (?DXUTGetMonitorFromAdapter@@YAPAUHMONITOR__@@PAUDXUTDeviceSettings@@@Z)
    DXUT.obj : error LNK2019: unresolved external symbol "public: class CGrowableArray<class CD3D9EnumAdapterInfo *> * __thiscall CD3D9Enumeration::GetAdapterInfoList(void)" (?GetAdapterInfoList@CD3D9Enumeration@@QAEPAV?$CGrowableArray@PAVCD3D9EnumAdapterInfo@@@@XZ) referenced in function "long __cdecl DXUTGetAdapterOrdinalFromMonitor(struct HMONITOR__ *,unsigned int *)" (?DXUTGetAdapterOrdinalFromMonitor@@YAJPAUHMONITOR__@@PAI@Z)
    DXUT.obj : error LNK2019: unresolved external symbol "wchar_t const * __stdcall DXUTDXGIFormatToString(enum DXGI_FORMAT,bool)" (?DXUTDXGIFormatToString@@YGPB_WW4DXGI_FORMAT@@_N@Z) referenced in function "void __cdecl DXUTUpdateStaticFrameStats(void)" (?DXUTUpdateStaticFrameStats@@YAXXZ)
    DXUT.obj : error LNK2019: unresolved external symbol "public: struct CD3D10EnumDeviceSettingsCombo * __thiscall CD3D10Enumeration::GetDeviceSettingsCombo(unsigned int,enum D3D10_DRIVER_TYPE,unsigned int,enum DXGI_FORMAT,int)" (?GetDeviceSettingsCombo@CD3D10Enumeration@@QAEPAUCD3D10EnumDeviceSettingsCombo@@IW4D3D10_DRIVER_TYPE@@IW4DXGI_FORMAT@@H@Z) referenced in function "void __cdecl DXUTUpdateStaticFrameStats(void)" (?DXUTUpdateStaticFrameStats@@YAXXZ)
    DXUT.obj : error LNK2019: unresolved external symbol "wchar_t const * __stdcall DXUTD3DFormatToString(enum _D3DFORMAT,bool)" (?DXUTD3DFormatToString@@YGPB_WW4_D3DFORMAT@@_N@Z) referenced in function "void __cdecl DXUTUpdateStaticFrameStats(void)" (?DXUTUpdateStaticFrameStats@@YAXXZ)
    DXUT.obj : error LNK2019: unresolved external symbol "public: struct CD3D9EnumDeviceSettingsCombo * __thiscall CD3D9Enumeration::GetDeviceSettingsCombo(unsigned int,enum _D3DDEVTYPE,enum _D3DFORMAT,enum _D3DFORMAT,int)" (?GetDeviceSettingsCombo@CD3D9Enumeration@@QAEPAUCD3D9EnumDeviceSettingsCombo@@IW4_D3DDEVTYPE@@W4_D3DFORMAT@@1H@Z) referenced in function "void __cdecl DXUTUpdateStaticFrameStats(void)" (?DXUTUpdateStaticFrameStats@@YAXXZ)
    DXUT.obj : error LNK2019: unresolved external symbol "bool __cdecl DXUTReLaunchMediaCenter(void)" (?DXUTReLaunchMediaCenter@@YA_NXZ) referenced in function "void __stdcall DXUTShutdown(int)" (?DXUTShutdown@@YGXH@Z)
    C:\Documents and Settings\Alec_2\Desktop\DirectXTest\Debug\DirectXTest.exe : fatal error LNK1120: 29 unresolved externals
    Build log was saved at "file://c:\Documents and Settings\Alec_2\Desktop\DirectXTest\DirectXTest\Debug\BuildLog.htm"
    DirectXTest - 31 error(s), 1 warning(s)
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


    Also, to the whole header file question, so files that you link to with angle brakets <> instead of quotes "" like stdio.h don't have sperate .cpp files containing their implementation? I.e., there is no file called stdio.cpp that stdio.h uses, it has everything it needs? Also, if .cpp files can be included just like .h files, then isn't the .h extension just a formality to let the user know this type of file should be linked to?

    Viri qui habent nullum, timent nullum.
    Men who have nothing, fear nothing.
  •  05-01-2008, 8:12 PM

    Re: Linker errors with SDKsound.cpp

    Hi,

    Are you linking to dsound.lib?

    :)
  •  05-01-2008, 8:15 PM

    Re: Linker errors with SDKsound.cpp

    Yes, there are the libraries I am linking to:

    d3d9.lib d3dx9.lib winmm.lib dsound.lib dxguid.lib dxerr9.lib comctl32.lib

    Viri qui habent nullum, timent nullum.
    Men who have nothing, fear nothing.
  •  05-01-2008, 11:58 PM

    Re: Linker errors with SDKsound.cpp

    Rather than trying to get all of this to work manually, there is an easier way. Start the DirectX Sample Brower application. Scroll down to the Empty Project sample. Click "Install Project". You will be prompted for a name for your project. It will then generate a project complete with all of the files you need to use DXUT. The SDKsound* files are actually installed as DXUTsound*, but the classes are the same.

    If you do that, you won't need to mess around with trying to get all the right .h/.cpp files into your project and you should be able to just compile and run the stub application. Then you can add whatever code you want in the appropriate stubs and away you go.

     

  •  05-02-2008, 7:25 PM

    Re: Linker errors with SDKsound.cpp

    Ok, so I tried making a sample project, and I tried compiling without any changes at all, and I got these errors:

    ------ Build started: Project: SoundTest, Configuration: Debug Win32 ------
    Compiling...
    cl : Command line warning D9035 : option 'Wp64' has been deprecated and will be removed in a future release
    DXUT.cpp
    Compiling...
    cl : Command line warning D9035 : option 'Wp64' has been deprecated and will be removed in a future release
    DXUTenum.cpp
    DXUTmisc.cpp
    SoundTest.cpp
    Generating Code...
    Compiling resources...
    Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0
    Copyright (C) Microsoft Corporation.  All rights reserved.
    Compiling manifest to resources...
    Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0
    Copyright (C) Microsoft Corporation.  All rights reserved.
    Linking...
    CVTRES : fatal error CVT1100: duplicate resource.  type:MANIFEST, name:1, language:0x0409
    LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt
    Build log was saved at "file://c:\Documents and Settings\Alec_2\Desktop\SoundTest\Debug\BuildLog.htm"
    SoundTest - 2 error(s), 2 warning(s)
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========




    I added my own main.cpp file (removing the file that was put there), and I got these errors:

    ------ Build started: Project: SoundTest, Configuration: Debug Win32 ------
    Linking...
    CVTRES : fatal error CVT1100: duplicate resource.  type:MANIFEST, name:1, language:0x0409
    LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt
    Build log was saved at "file://c:\Documents and Settings\Alec_2\Desktop\SoundTest\Debug\BuildLog.htm"
    SoundTest - 2 error(s), 0 warning(s)
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

    They seem to have to do with the resources the project had setup, and I don't want to go there. I didnt like the idea of having something configure the project for me anyway, though if it had worked I probably wouldn't have cared. But, it didnt work.





    I still don't get why I can't just link to SDKsound like this: #include <SDKsound.h>. Why does it need to be in the project and included like this: #include "SDKsound.h"? Anyway, if someone could help me with the errors in the post 4 posts ago, that would be a great help. DirectSound is really starting to bug me.


    Viri qui habent nullum, timent nullum.
    Men who have nothing, fear nothing.
  •  05-02-2008, 8:57 PM

    Re: Linker errors with SDKsound.cpp

    I just followed the instructions I gave you and I was able to successfully compile and run the project using both VS 2005 and VC++ 2008 Express. So, there appears to be an issue with your configuration.

    The reason you can't jusst link to SDKsound with #include <SDKsound.h> is because #include doesn't "link" to anything. It just provides declarations and nothing else. All of the classes declared in SDKsound.h are defined (implemented) in SDKsound.cpp. So, while any of your source files that need to use SDKsound classes need to #include the header file, you still have to include the implementation of those classes (in the form of SDKsound.cpp) in your project.

    This is further complicated by the fact that SDKsound has other SDK/DXUT dependencies. So, once you've added SDKsound.h/SDKsound.cpp to your project, you then find that you are missing some other .h/.cpp pair. That's why the EmptyProject template is included. It takes care of setting all of that up so you don't have to.

    As for DirectSound bugging you, your fight isn't with DirectSound. Your fight is with DXUT.

     

  •  05-02-2008, 9:30 PM

    Re: Linker errors with SDKsound.cpp

    David Hunt:
    there appears to be an issue with your configuration.

    Err... does that mean I didn't follow your directions correctly, or is there another problem? How would I go about finding out what that is and fixing it?

    David Hunt:
    As for DirectSound bugging you, your fight isn't with DirectSound. Your fight is with DXUT.
    Is there another way to load sound data from files into DirectSound buffers other than using DXUT. I would prefer not to use it if I don't have to. I tried finding a tutorial for using DirectSound without DXUT, but I had little luck. Do you know where I can find a sample/tutorial for just loading wave data into sound buffers?


    Viri qui habent nullum, timent nullum.
    Men who have nothing, fear nothing.
View as RSS news feed in XML
©2007 Microsoft Corporation. All rights reserved. Privacy Statement Terms of Use Code of Conduct Feedback