Sign in to follow this  
sh1t4brains

DirectX linking errors

Recommended Posts

sh1t4brains    122
I downloaded DirectX, visual c++ 2005 express and platform sdk, and I'm trying to build the directsound samples. I'm getting linker errors I cant fix like: "1>capturesound.obj : error LNK2019: unresolved external symbol __imp__GetSaveFileNameW@4" or "DXUT1.obj : error LNK2019: unresolved external symbol __imp__CommandLineToArgvW@8 " can someone tell me in plain english how to link to the libraries I need? much obliged

Share this post


Link to post
Share on other sites
SiCrane    11839
You need to link against Comdlg32.lib and Shell32.lib. You can do so by going to your project properties, the linker folder, the input section and typing them on the line labelled Additional Dependencies.

Share this post


Link to post
Share on other sites
sh1t4brains    122
Thanks, that fixed 4 errors. unfortuantely I have 86 more just like them though:


1>Linking...
1>capturesound.obj : error LNK2019: unresolved external symbol __imp__DispatchMessageW@4 referenced in function _wWinMain@16
1>DXUT1.obj : error LNK2001: unresolved external symbol __imp__DispatchMessageW@4
1>capturesound.obj : error LNK2019: unresolved external symbol __imp__TranslateMessage@4 referenced in function _wWinMain@16
1>DXUT1.obj : error LNK2001: unresolved external symbol __imp__TranslateMessage@4
1>capturesound.obj : error LNK2019: unresolved external symbol __imp__IsDialogMessageW@8 referenced in function _wWinMain@16
1>capturesound.obj : error LNK2019: unresolved external symbol __imp__PeekMessageW@20 referenced in function _wWinMain@16
1>DXUT1.obj : error LNK2001: unresolved external symbol __imp__PeekMessageW@20
1>capturesound.obj : error LNK2019: unresolved external symbol __imp__MsgWaitForMultipleObjects@20 referenced in function _wWinMain@16
1>capturesound.obj : error LNK2019: unresolved external symbol __imp__ShowWindow@8 referenced in function _wWinMain@16
1>DXUT1.obj : error LNK2001: unresolved external symbol __imp__ShowWindow@8
1>capturesound.obj : error LNK2019: unresolved external symbol __imp__SetWindowTextW@8 referenced in function _wWinMain@16
1>capturesound.obj : error LNK2019: unresolved external symbol __imp__GetDlgItem@8 referenced in function _wWinMain@16
1>capturesound.obj : error LNK2019: unresolved external symbol __imp__MessageBoxW@16 referenced in function _wWinMain@16
1>DXUT1.obj : error LNK2001: unresolved external symbol __imp__MessageBoxW@16
1>dxerr.lib(dxerr.obj) : error LNK2001: unresolved external symbol __imp__MessageBoxW@16
1>capturesound.obj : error LNK2019: unresolved external symbol __imp__PostQuitMessage@4 referenced in function _wWinMain@16
1>DXUT1.obj : error LNK2001: unresolved external symbol __imp__PostQuitMessage@4
1>capturesound.obj : error LNK2019: unresolved external symbol __imp__DialogBoxParamW@20 referenced in function _wWinMain@16
1>capturesound.obj : error LNK2019: unresolved external symbol __imp__CreateDialogParamW@20 referenced in function _wWinMain@16
1>capturesound.obj : error LNK2019: unresolved external symbol __imp__CoInitialize@4 referenced in function "long __cdecl InitDirectSound(struct HWND__ *,struct _GUID *)" (?InitDirectSound@@YAJPAUHWND__@@PAU_GUID@@@Z)
1>capturesound.obj : error LNK2019: unresolved external symbol __imp__CoUninitialize@0 referenced in function "long __cdecl FreeDirectSound(void)" (?FreeDirectSound@@YAJXZ)
1>capturesound.obj : error LNK2019: unresolved external symbol __imp__SendMessageW@16 referenced in function "int __stdcall DevicesDlgProc(struct HWND__ *,unsigned int,unsigned int,long)" (?DevicesDlgProc@@YGHPAUHWND__@@IIJ@Z)
1>DXUT1.obj : error LNK2001: unresolved external symbol __imp__SendMessageW@16
1>capturesound.obj : error LNK2019: unresolved external symbol __imp__EndDialog@8 referenced in function "int __stdcall DevicesDlgProc(struct HWND__ *,unsigned int,unsigned int,long)" (?DevicesDlgProc@@YGHPAUHWND__@@IIJ@Z)
1>capturesound.obj : error LNK2019: unresolved external symbol __imp__SetCursor@4 referenced in function "long __cdecl ScanAvailableInputFormats(void)" (?ScanAvailableInputFormats@@YAJXZ)
1>DXUT1.obj : error LNK2001: unresolved external symbol __imp__SetCursor@4
1>capturesound.obj : error LNK2019: unresolved external symbol __imp__LoadCursorW@8 referenced in function "long __cdecl ScanAvailableInputFormats(void)" (?ScanAvailableInputFormats@@YAJXZ)
1>DXUT1.obj : error LNK2001: unresolved external symbol __imp__LoadCursorW@8
1>capturesound.obj : error LNK2019: unresolved external symbol __imp__GetCursor@0 referenced in function "long __cdecl ScanAvailableInputFormats(void)" (?ScanAvailableInputFormats@@YAJXZ)
1>capturesound.obj : error LNK2019: unresolved external symbol __imp__EnableWindow@8 referenced in function "long __cdecl OnInputFormatBoxSelected(struct HWND__ *)" (?OnInputFormatBoxSelected@@YAJPAUHWND__@@@Z)
1>capturesound.obj : error LNK2019: unresolved external symbol __imp__SetDlgItemTextW@12 referenced in function "long __cdecl OnInitMainDialog(struct HWND__ *)" (?OnInitMainDialog@@YAJPAUHWND__@@@Z)
1>capturesound.obj : error LNK2019: unresolved external symbol __imp__LoadIconW@8 referenced in function "long __cdecl OnInitMainDialog(struct HWND__ *)" (?OnInitMainDialog@@YAJPAUHWND__@@@Z)
1>DXUT1.obj : error LNK2019: unresolved external symbol __imp__GetClientRect@8 referenced in function "struct tagRECT __stdcall DXUTGetWindowClientRect(void)" (?DXUTGetWindowClientRect@@YG?AUtagRECT@@XZ)
1>DXUT1.obj : error LNK2019: unresolved external symbol __imp__SystemParametersInfoW@16 referenced in function "long __stdcall DXUTInit(bool,bool,wchar_t *,bool)" (?DXUTInit@@YGJ_N0PA_W0@Z)
1>DXUT1.obj : error LNK2019: unresolved external symbol __imp__CreateWindowExW@48 referenced in function "long __stdcall DXUTCreateWindow(wchar_t const *,struct HINSTANCE__ *,struct HICON__ *,struct HMENU__ *,int,int)" (?DXUTCreateWindow@@YGJPB_WPAUHINSTANCE__@@PAUHICON__@@PAUHMENU__@@HH@Z)
1>DXUT1.obj : error LNK2019: unresolved external symbol __imp__AdjustWindowRect@12 referenced in function "long __stdcall DXUTCreateWindow(wchar_t const *,struct HINSTANCE__ *,struct HICON__ *,struct HMENU__ *,int,int)" (?DXUTCreateWindow@@YGJPB_WPAUHINSTANCE__@@PAUHICON__@@PAUHMENU__@@HH@Z)
1>DXUTenum1.obj : error LNK2001: unresolved external symbol __imp__AdjustWindowRect@12
1>DXUT1.obj : error LNK2019: unresolved external symbol __imp__SetRect@20 referenced in function "long __stdcall DXUTCreateWindow(wchar_t const *,struct HINSTANCE__ *,struct HICON__ *,struct HMENU__ *,int,int)" (?DXUTCreateWindow@@YGJPB_WPAUHINSTANCE__@@PAUHICON__@@PAUHMENU__@@HH@Z)
1>DXUT1.obj : error LNK2019: unresolved external symbol __imp__RegisterClassW@4 referenced in function "long __stdcall DXUTCreateWindow(wchar_t const *,struct HINSTANCE__ *,struct HICON__ *,struct HMENU__ *,int,int)" (?DXUTCreateWindow@@YGJPB_WPAUHINSTANCE__@@PAUHICON__@@PAUHMENU__@@HH@Z)
1>DXUT1.obj : error LNK2019: unresolved external symbol __imp__GetStockObject@4 referenced in function "long __stdcall DXUTCreateWindow(wchar_t const *,struct HINSTANCE__ *,struct HICON__ *,struct HMENU__ *,int,int)" (?DXUTCreateWindow@@YGJPB_WPAUHINSTANCE__@@PAUHICON__@@PAUHMENU__@@HH@Z)
1>DXUT1.obj : error LNK2019: unresolved external symbol __imp__GetWindowLongW@8 referenced in function "long __stdcall DXUTSetWindow(struct HWND__ *,struct HWND__ *,struct HWND__ *,bool)" (?DXUTSetWindow@@YGJPAUHWND__@@00_N@Z)
1>DXUTenum1.obj : error LNK2001: unresolved external symbol __imp__GetWindowLongW@8
1>DXUT1.obj : error LNK2019: unresolved external symbol __imp__GetWindowTextW@12 referenced in function "long __stdcall DXUTSetWindow(struct HWND__ *,struct HWND__ *,struct HWND__ *,bool)" (?DXUTSetWindow@@YGJPAUHWND__@@00_N@Z)
1>DXUT1.obj : error LNK2019: unresolved external symbol __imp__SetWindowLongW@12 referenced in function "long __stdcall DXUTSetWindow(struct HWND__ *,struct HWND__ *,struct HWND__ *,bool)" (?DXUTSetWindow@@YGJPAUHWND__@@00_N@Z)
1>DXUT1.obj : error LNK2019: unresolved external symbol __imp__DefWindowProcW@16 referenced in function "long __stdcall DXUTStaticWndProc(struct HWND__ *,unsigned int,unsigned int,long)" (?DXUTStaticWndProc@@YGJPAUHWND__@@IIJ@Z)
1>DXUT1.obj : error LNK2019: unresolved external symbol __imp__UnregisterClassW@8 referenced in function "long __stdcall DXUTStaticWndProc(struct HWND__ *,unsigned int,unsigned int,long)" (?DXUTStaticWndProc@@YGJPAUHWND__@@IIJ@Z)
1>DXUT1.obj : error LNK2019: unresolved external symbol __imp__DestroyWindow@4 referenced in function "long __stdcall DXUTStaticWndProc(struct HWND__ *,unsigned int,unsigned int,long)" (?DXUTStaticWndProc@@YGJPAUHWND__@@IIJ@Z)
1>DXUT1.obj : error LNK2019: unresolved external symbol __imp__DestroyMenu@4 referenced in function "long __stdcall DXUTStaticWndProc(struct HWND__ *,unsigned int,unsigned int,long)" (?DXUTStaticWndProc@@YGJPAUHWND__@@IIJ@Z)
1>DXUT1.obj : error LNK2019: unresolved external symbol __imp__GetMenu@4 referenced in function "long __stdcall DXUTStaticWndProc(struct HWND__ *,unsigned int,unsigned int,long)" (?DXUTStaticWndProc@@YGJPAUHWND__@@IIJ@Z)
1>DXUT1.obj : error LNK2019: unresolved external symbol __imp__ClipCursor@4 referenced in function "long __stdcall DXUTStaticWndProc(struct HWND__ *,unsigned int,unsigned int,long)" (?DXUTStaticWndProc@@YGJPAUHWND__@@IIJ@Z)
1>DXUT1.obj : error LNK2019: unresolved external symbol __imp__GetCursorPos@4 referenced in function "long __stdcall DXUTStaticWndProc(struct HWND__ *,unsigned int,unsigned int,long)" (?DXUTStaticWndProc@@YGJPAUHWND__@@IIJ@Z)
1>DXUT1.obj : error LNK2019: unresolved external symbol __imp__ScreenToClient@8 referenced in function "long __stdcall DXUTStaticWndProc(struct HWND__ *,unsigned int,unsigned int,long)" (?DXUTStaticWndProc@@YGJPAUHWND__@@IIJ@Z)
1>DXUT1.obj : error LNK2019: unresolved external symbol __imp__DestroyAcceleratorTable@4 referenced in function "long __stdcall DXUTMainLoop(struct HACCEL__ *)" (?DXUTMainLoop@@YGJPAUHACCEL__@@@Z)
1>DXUT1.obj : error LNK2019: unresolved external symbol __imp__TranslateAcceleratorW@12 referenced in function "long __stdcall DXUTMainLoop(struct HACCEL__ *)" (?DXUTMainLoop@@YGJPAUHACCEL__@@@Z)
1>DXUT1.obj : error LNK2019: unresolved external symbol __imp__IsWindowVisible@4 referenced in function "long __cdecl DXUTChangeDevice(struct DXUTDeviceSettings *,struct IDirect3DDevice9 *,struct ID3D10Device *,bool,bool)" (?DXUTChangeDevice@@YAJPAUDXUTDeviceSettings@@PAUIDirect3DDevice9@@PAUID3D10Device@@_N3@Z)
1>DXUT1.obj : error LNK2019: unresolved external symbol __imp__IsZoomed@4 referenced in function "long __cdecl DXUTChangeDevice(struct DXUTDeviceSettings *,struct IDirect3DDevice9 *,struct ID3D10Device *,bool,bool)" (?DXUTChangeDevice@@YAJPAUDXUTDeviceSettings@@PAUIDirect3DDevice9@@PAUID3D10Device@@_N3@Z)
1>DXUT1.obj : error LNK2019: unresolved external symbol __imp__GetWindowRect@8 referenced in function "long __cdecl DXUTChangeDevice(struct DXUTDeviceSettings *,struct IDirect3DDevice9 *,struct ID3D10Device *,bool,bool)" (?DXUTChangeDevice@@YAJPAUDXUTDeviceSettings@@PAUIDirect3DDevice9@@PAUID3D10Device@@_N3@Z)
1>DXUT1.obj : error LNK2019: unresolved external symbol __imp__IsIconic@4 referenced in function "long __cdecl DXUTChangeDevice(struct DXUTDeviceSettings *,struct IDirect3DDevice9 *,struct ID3D10Device *,bool,bool)" (?DXUTChangeDevice@@YAJPAUDXUTDeviceSettings@@PAUIDirect3DDevice9@@PAUID3D10Device@@_N3@Z)
1>DXUT1.obj : error LNK2019: unresolved external symbol __imp__SetWindowPos@28 referenced in function "long __cdecl DXUTChangeDevice(struct DXUTDeviceSettings *,struct IDirect3DDevice9 *,struct ID3D10Device *,bool,bool)" (?DXUTChangeDevice@@YAJPAUDXUTDeviceSettings@@PAUIDirect3DDevice9@@PAUID3D10Device@@_N3@Z)
1>DXUT1.obj : error LNK2019: unresolved external symbol __imp__SetWindowPlacement@8 referenced in function "long __cdecl DXUTChangeDevice(struct DXUTDeviceSettings *,struct IDirect3DDevice9 *,struct ID3D10Device *,bool,bool)" (?DXUTChangeDevice@@YAJPAUDXUTDeviceSettings@@PAUIDirect3DDevice9@@PAUID3D10Device@@_N3@Z)
1>DXUT1.obj : error LNK2019: unresolved external symbol __imp__GetWindowPlacement@8 referenced in function "long __cdecl DXUTChangeDevice(struct DXUTDeviceSettings *,struct IDirect3DDevice9 *,struct ID3D10Device *,bool,bool)" (?DXUTChangeDevice@@YAJPAUDXUTDeviceSettings@@PAUIDirect3DDevice9@@PAUID3D10Device@@_N3@Z)
1>DXUT1.obj : error LNK2019: unresolved external symbol __imp__SetMenu@8 referenced in function "long __cdecl DXUTChangeDevice(struct DXUTDeviceSettings *,struct IDirect3DDevice9 *,struct ID3D10Device *,bool,bool)" (?DXUTChangeDevice@@YAJPAUDXUTDeviceSettings@@PAUIDirect3DDevice9@@PAUID3D10Device@@_N3@Z)
1>DXUT1.obj : error LNK2019: unresolved external symbol __imp__DeleteDC@4 referenced in function "long __cdecl DXUTSetD3D9DeviceCursor(struct IDirect3DDevice9 *,struct HICON__ *,bool)" (?DXUTSetD3D9DeviceCursor@@YAJPAUIDirect3DDevice9@@PAUHICON__@@_N@Z)
1>DXUT1.obj : error LNK2019: unresolved external symbol __imp__ReleaseDC@8 referenced in function "long __cdecl DXUTSetD3D9DeviceCursor(struct IDirect3DDevice9 *,struct HICON__ *,bool)" (?DXUTSetD3D9DeviceCursor@@YAJPAUIDirect3DDevice9@@PAUHICON__@@_N@Z)
1>DXUT1.obj : error LNK2019: unresolved external symbol __imp__DeleteObject@4 referenced in function "long __cdecl DXUTSetD3D9DeviceCursor(struct IDirect3DDevice9 *,struct HICON__ *,bool)" (?DXUTSetD3D9DeviceCursor@@YAJPAUIDirect3DDevice9@@PAUHICON__@@_N@Z)
1>DXUT1.obj : error LNK2019: unresolved external symbol __imp__GetDIBits@28 referenced in function "long __cdecl DXUTSetD3D9DeviceCursor(struct IDirect3DDevice9 *,struct HICON__ *,bool)" (?DXUTSetD3D9DeviceCursor@@YAJPAUIDirect3DDevice9@@PAUHICON__@@_N@Z)
1>DXUT1.obj : error LNK2019: unresolved external symbol __imp__SelectObject@8 referenced in function "long __cdecl DXUTSetD3D9DeviceCursor(struct IDirect3DDevice9 *,struct HICON__ *,bool)" (?DXUTSetD3D9DeviceCursor@@YAJPAUIDirect3DDevice9@@PAUHICON__@@_N@Z)
1>DXUT1.obj : error LNK2019: unresolved external symbol __imp__CreateCompatibleDC@4 referenced in function "long __cdecl DXUTSetD3D9DeviceCursor(struct IDirect3DDevice9 *,struct HICON__ *,bool)" (?DXUTSetD3D9DeviceCursor@@YAJPAUIDirect3DDevice9@@PAUHICON__@@_N@Z)
1>DXUT1.obj : error LNK2019: unresolved external symbol __imp__GetDC@4 referenced in function "long __cdecl DXUTSetD3D9DeviceCursor(struct IDirect3DDevice9 *,struct HICON__ *,bool)" (?DXUTSetD3D9DeviceCursor@@YAJPAUIDirect3DDevice9@@PAUHICON__@@_N@Z)
1>DXUT1.obj : error LNK2019: unresolved external symbol __imp__GetObjectW@12 referenced in function "long __cdecl DXUTSetD3D9DeviceCursor(struct IDirect3DDevice9 *,struct HICON__ *,bool)" (?DXUTSetD3D9DeviceCursor@@YAJPAUIDirect3DDevice9@@PAUHICON__@@_N@Z)
1>DXUT1.obj : error LNK2019: unresolved external symbol __imp__GetIconInfo@8 referenced in function "long __cdecl DXUTSetD3D9DeviceCursor(struct IDirect3DDevice9 *,struct HICON__ *,bool)" (?DXUTSetD3D9DeviceCursor@@YAJPAUIDirect3DDevice9@@PAUHICON__@@_N@Z)
1>DXUT1.obj : error LNK2019: unresolved external symbol __imp__CallNextHookEx@16 referenced in function "long __stdcall DXUTLowLevelKeyboardProc(int,unsigned int,long)" (?DXUTLowLevelKeyboardProc@@YGJHIJ@Z)
1>DXUT1.obj : error LNK2019: unresolved external symbol __imp__SetWindowsHookExW@16 referenced in function "void __cdecl DXUTAllowShortcutKeys(bool)" (?DXUTAllowShortcutKeys@@YAX_N@Z)
1>DXUT1.obj : error LNK2019: unresolved external symbol __imp__UnhookWindowsHookEx@4 referenced in function "void __cdecl DXUTAllowShortcutKeys(bool)" (?DXUTAllowShortcutKeys@@YAX_N@Z)
1>DXUT1.obj : error LNK2019: unresolved external symbol __imp__GetSystemMetrics@4 referenced in function "void __cdecl DXUTDisplayErrorMessage(long)" (?DXUTDisplayErrorMessage@@YAXJ@Z)
1>DXUTenum1.obj : error LNK2001: unresolved external symbol __imp__GetSystemMetrics@4
1>DXUTmisc1.obj : error LNK2001: unresolved external symbol __imp__GetSystemMetrics@4
1>DXUT1.obj : error LNK2019: unresolved external symbol __imp__GetClassLongW@8 referenced in function "void __cdecl DXUTSetupCursor(void)" (?DXUTSetupCursor@@YAXXZ)
1>DXUT1.obj : error LNK2019: unresolved external symbol __imp__GetAsyncKeyState@4 referenced in function "bool __stdcall DXUTIsKeyDown(unsigned char)" (?DXUTIsKeyDown@@YG_NE@Z)
1>DXUTenum1.obj : error LNK2019: unresolved external symbol __imp__EnumDisplaySettingsW@12 referenced in function "private: long __thiscall CD3D10Enumeration::EnumerateDisplayModes(class CD3D10EnumOutputInfo *)" (?EnumerateDisplayModes@CD3D10Enumeration@@AAEJPAVCD3D10EnumOutputInfo@@@Z)
1>DXUTmisc1.obj : error LNK2001: unresolved external symbol __imp__EnumDisplaySettingsW@12
1>DXUTenum1.obj : error LNK2019: unresolved external symbol __imp__GetMonitorInfoW@8 referenced in function "long __cdecl DXUTFindValidD3D10Resolution(struct CD3D10EnumDeviceSettingsCombo *,struct DXGI_MODE_DESC,struct DXGI_MODE_DESC *)" (?DXUTFindValidD3D10Resolution@@YAJPAUCD3D10EnumDeviceSettingsCombo@@UDXGI_MODE_DESC@@PAU2@@Z)
1>DXUTmisc1.obj : error LNK2019: unresolved external symbol __imp__SystemParametersInfoA@16 referenced in function "int __stdcall DXUTGetMonitorInfo(struct HMONITOR__ *,struct tagMONITORINFO *)" (?DXUTGetMonitorInfo@@YGHPAUHMONITOR__@@PAUtagMONITORINFO@@@Z)
1>dxerr.lib(dxerr.obj) : error LNK2019: unresolved external symbol __imp__GetForegroundWindow@0 referenced in function _DXTraceW@20
1>dxerr.lib(dxerr.obj) : error LNK2019: unresolved external symbol __imp__MessageBoxA@16 referenced in function _DXTraceA@20
1>C:\Program Files\Microsoft DirectX SDK (June 2007)\Samples\C++\DirectSound\CaptureSound\Debug\CaptureSound.exe : fatal error LNK1120: 70 unresolved externals
1>Build log was saved at "file://c:\Program Files\Microsoft DirectX SDK (June 2007)\Samples\C++\DirectSound\CaptureSound\Debug\BuildLog.htm"
1>CaptureSound - 86 error(s), 0 warning(s)
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========


EDIT: Please don't dump such a huge amount of text. Please use 'source' tags in future.

[Edited by - jollyjeffers on July 11, 2007 4:43:26 PM]

Share this post


Link to post
Share on other sites
Evil Steve    2017
Did you follow These Steps when you installed the Platform SDK? Sounds like you've missed (at least) step 4. Those linker errors are caused by not linking several libraries, all of which should be auto-added in step 4 there.

Share this post


Link to post
Share on other sites
jollyjeffers    1570
Moved to 'for beginners'. The root cause here isn't DirectX's SDK by the looks of things; configuring your IDE for a different SDK belongs elsewhere [smile]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this