The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.
SDL
Simple Directmedia Layer Forums
SDL2 linking problem using VC 2008 express
umen
Joined: 24 Aug 2011
Posts: 7
Posted: Sun Mar 01, 2015 2:06 pm
Hey all im new to SDL , i managed to compile SDL2 using cmake as static lib
but when i try to compile simple hello world app linking the SDL2 as static lib im getting alot of unresolved external symbol errors
do i miss something in the compilation or configuration ?
i link both SDLmain.lib and SDL2.lib in debug mode
but getting this while compiling .
Code:
1> Creating library D:\dev\cpp\2d\SDL\SDL-b577c4753421\SDL-b577c4753421\build\Debug\sdl-static-test1.lib and object D:\dev\cpp\2d\SDL\SDL-b577c4753421\SDL-b577c4753421\build\Debug\sdl-static-test1.exp
1>SDL2.lib(SDL_dynapi.obj) : error LNK2019: unresolved external symbol _SDL_GameControllerAddMappingsFromRW_REAL referenced in function _SDL_DYNAPI_entry
1>SDL2.lib(SDL_dynapi.obj) : error LNK2019: unresolved external symbol _SDL_JoystickClose_REAL referenced in function _SDL_DYNAPI_entry
1>SDL2.lib(SDL_dynapi.obj) : error LNK2019: unresolved external symbol _SDL_JoystickGetButton_REAL referenced in function _SDL_DYNAPI_entry
1>SDL2.lib(SDL_dynapi.obj) : error LNK2019: unresolved external symbol _SDL_JoystickGetBall_REAL referenced in function _SDL_DYNAPI_entry
1>SDL2.lib(SDL_dynapi.obj) : error LNK2019: unresolved external symbol _SDL_JoystickGetHat_REAL referenced in function _SDL_DYNAPI_entry
1>SDL2.lib(SDL_dynapi.obj) : error LNK2019: unresolved external symbol _SDL_JoystickGetAxis_REAL referenced in function _SDL_DYNAPI_entry
1>SDL2.lib(SDL_dynapi.obj) : error LNK2019: unresolved external symbol _SDL_JoystickEventState_REAL referenced in function _SDL_DYNAPI_entry
1>SDL2.lib(SDL_dynapi.obj) : error LNK2019: unresolved external symbol _SDL_JoystickUpdate_REAL referenced in function _SDL_DYNAPI_entry
1>SDL2.lib(SDL_dynapi.obj) : error LNK2019: unresolved external symbol _SDL_JoystickNumButtons_REAL referenced in function _SDL_DYNAPI_entry
1>SDL2.lib(SDL_dynapi.obj) : error LNK2019: unresolved external symbol _SDL_JoystickNumHats_REAL referenced in function _SDL_DYNAPI_entry
1>SDL2.lib(SDL_dynapi.obj) : error LNK2019: unresolved external symbol _SDL_JoystickNumBalls_REAL referenced in function _SDL_DYNAPI_entry
1>SDL2.lib(SDL_dynapi.obj) : error LNK2019: unresolved external symbol _SDL_JoystickNumAxes_REAL referenced in function _SDL_DYNAPI_entry
1>SDL2.lib(SDL_dynapi.obj) : error LNK2019: unresolved external symbol _SDL_JoystickInstanceID_REAL referenced in function _SDL_DYNAPI_entry
1>SDL2.lib(SDL_dynapi.obj) : error LNK2019: unresolved external symbol _SDL_JoystickGetAttached_REAL referenced in function _SDL_DYNAPI_entry
1>SDL2.lib(SDL_dynapi.obj) : error LNK2019: unresolved external symbol _SDL_JoystickGetGUIDFromString_REAL referenced in function _SDL_DYNAPI_entry
1>SDL2.lib(SDL_dynapi.obj) : error LNK2019: unresolved external symbol _SDL_JoystickGetGUIDString_REAL referenced in function _SDL_DYNAPI_entry
1>SDL2.lib(SDL_dynapi.obj) : error LNK2019: unresolved external symbol _SDL_JoystickGetGUID_REAL referenced in function _SDL_DYNAPI_entry
1>SDL2.lib(SDL_dynapi.obj) : error LNK2019: unresolved external symbol _SDL_JoystickGetDeviceGUID_REAL referenced in function _SDL_DYNAPI_entry
1>SDL2.lib(SDL_dynapi.obj) : error LNK2019: unresolved external symbol _SDL_JoystickName_REAL referenced in function _SDL_DYNAPI_entry
1>SDL2.lib(SDL_dynapi.obj) : error LNK2019: unresolved external symbol _SDL_JoystickOpen_REAL referenced in function _SDL_DYNAPI_entry
1>SDL2.lib(SDL_dynapi.obj) : error LNK2019: unresolved external symbol _SDL_JoystickNameForIndex_REAL referenced in function _SDL_DYNAPI_entry
1>SDL2.lib(SDL_dynapi.obj) : error LNK2019: unresolved external symbol _SDL_NumJoysticks_REAL referenced in function _SDL_DYNAPI_entry
1>SDL2.lib(SDL_dynapi.obj) : error LNK2019: unresolved external symbol _SDL_HapticRumbleStop_REAL referenced in function _SDL_DYNAPI_entry
1>SDL2.lib(SDL_dynapi.obj) : error LNK2019: unresolved external symbol _SDL_HapticRumblePlay_REAL referenced in function _SDL_DYNAPI_entry
1>SDL2.lib(SDL_dynapi.obj) : error LNK2019: unresolved external symbol _SDL_HapticRumbleInit_REAL referenced in function _SDL_DYNAPI_entry
1>SDL2.lib(SDL_dynapi.obj) : error LNK2019: unresolved external symbol _SDL_HapticRumbleSupported_REAL referenced in function _SDL_DYNAPI_entry
1>SDL2.lib(SDL_dynapi.obj) : error LNK2019: unresolved external symbol _SDL_HapticStopAll_REAL referenced in function _SDL_DYNAPI_entry
1>SDL2.lib(SDL_dynapi.obj) : error LNK2019: unresolved external symbol _SDL_HapticUnpause_REAL referenced in function _SDL_DYNAPI_entry
1>SDL2.lib(SDL_dynapi.obj) : error LNK2019: unresolved external symbol _SDL_HapticPause_REAL referenced in function _SDL_DYNAPI_entry
1>SDL2.lib(SDL_dynapi.obj) : error LNK2019: unresolved external symbol _SDL_HapticSetAutocenter_REAL referenced in function _SDL_DYNAPI_entry
1>SDL2.lib(SDL_dynapi.obj) : error LNK2019: unresolved external symbol _SDL_HapticSetGain_REAL referenced in function _SDL_DYNAPI_entry
1>SDL2.lib(SDL_dynapi.obj) : error LNK2019: unresolved external symbol _SDL_HapticGetEffectStatus_REAL referenced in function _SDL_DYNAPI_entry
1>SDL2.lib(SDL_dynapi.obj) : error LNK2019: unresolved external symbol _SDL_HapticDestroyEffect_REAL referenced in function _SDL_DYNAPI_entry
1>SDL2.lib(SDL_dynapi.obj) : error LNK2019: unresolved external symbol _SDL_HapticStopEffect_REAL referenced in function _SDL_DYNAPI_entry
1>SDL2.lib(SDL_dynapi.obj) : error LNK2019: unresolved external symbol _SDL_HapticRunEffect_REAL referenced in function _SDL_DYNAPI_entry
1>SDL2.lib(SDL_dynapi.obj) : error LNK2019: unresolved external symbol _SDL_HapticUpdateEffect_REAL referenced in function _SDL_DYNAPI_entry
1>SDL2.lib(SDL_dynapi.obj) : error LNK2019: unresolved external symbol _SDL_HapticNewEffect_REAL referenced in function _SDL_DYNAPI_entry
1>SDL2.lib(SDL_dynapi.obj) : error LNK2019: unresolved external symbol _SDL_HapticEffectSupported_REAL referenced in function _SDL_DYNAPI_entry
1>SDL2.lib(SDL_dynapi.obj) : error LNK2019: unresolved external symbol _SDL_HapticNumAxes_REAL referenced in function _SDL_DYNAPI_entry
1>SDL2.lib(SDL_dynapi.obj) : error LNK2019: unresolved external symbol _SDL_HapticQuery_REAL referenced in function _SDL_DYNAPI_entry
1>SDL2.lib(SDL_dynapi.obj) : error LNK2019: unresolved external symbol _SDL_HapticNumEffectsPlaying_REAL referenced in function _SDL_DYNAPI_entry
1>SDL2.lib(SDL_dynapi.obj) : error LNK2019: unresolved external symbol _SDL_HapticNumEffects_REAL referenced in function _SDL_DYNAPI_entry
1>SDL2.lib(SDL_dynapi.obj) : error LNK2019: unresolved external symbol _SDL_HapticClose_REAL referenced in function _SDL_DYNAPI_entry
1>SDL2.lib(SDL_dynapi.obj) : error LNK2019: unresolved external symbol _SDL_HapticOpenFromJoystick_REAL referenced in function _SDL_DYNAPI_entry
1>SDL2.lib(SDL_dynapi.obj) : error LNK2019: unresolved external symbol _SDL_JoystickIsHaptic_REAL referenced in function _SDL_DYNAPI_entry
1>SDL2.lib(SDL_dynapi.obj) : error LNK2019: unresolved external symbol _SDL_HapticOpenFromMouse_REAL referenced in function _SDL_DYNAPI_entry
1>SDL2.lib(SDL_dynapi.obj) : error LNK2019: unresolved external symbol _SDL_MouseIsHaptic_REAL referenced in function _SDL_DYNAPI_entry
1>SDL2.lib(SDL_dynapi.obj) : error LNK2019: unresolved external symbol _SDL_HapticIndex_REAL referenced in function _SDL_DYNAPI_entry
1>SDL2.lib(SDL_dynapi.obj) : error LNK2019: unresolved external symbol _SDL_HapticOpened_REAL referenced in function _SDL_DYNAPI_entry
1>SDL2.lib(SDL_dynapi.obj) : error LNK2019: unresolved external symbol _SDL_HapticOpen_REAL referenced in function _SDL_DYNAPI_entry
1>SDL2.lib(SDL_dynapi.obj) : error LNK2019: unresolved external symbol _SDL_HapticName_REAL referenced in function _SDL_DYNAPI_entry
1>SDL2.lib(SDL_dynapi.obj) : error LNK2019: unresolved external symbol _SDL_NumHaptics_REAL referenced in function _SDL_DYNAPI_entry
1>SDL2.lib(SDL_dynapi.obj) : error LNK2019: unresolved external symbol _SDL_GameControllerClose_REAL referenced in function _SDL_DYNAPI_entry
1>SDL2.lib(SDL_dynapi.obj) : error LNK2019: unresolved external symbol _SDL_GameControllerGetButton_REAL referenced in function _SDL_DYNAPI_entry
1>SDL2.lib(SDL_dynapi.obj) : error LNK2019: unresolved external symbol _SDL_GameControllerGetBindForButton_REAL referenced in function _SDL_DYNAPI_entry
1>SDL2.lib(SDL_dynapi.obj) : error LNK2019: unresolved external symbol _SDL_GameControllerGetStringForButton_REAL referenced in function _SDL_DYNAPI_entry
1>SDL2.lib(SDL_dynapi.obj) : error LNK2019: unresolved external symbol _SDL_GameControllerGetButtonFromString_REAL referenced in function _SDL_DYNAPI_entry
1>SDL2.lib(SDL_dynapi.obj) : error LNK2019: unresolved external symbol _SDL_GameControllerGetAxis_REAL referenced in function _SDL_DYNAPI_entry
1>SDL2.lib(SDL_dynapi.obj) : error LNK2019: unresolved external symbol _SDL_GameControllerGetBindForAxis_REAL referenced in function _SDL_DYNAPI_entry
1>SDL2.lib(SDL_dynapi.obj) : error LNK2019: unresolved external symbol _SDL_GameControllerGetStringForAxis_REAL referenced in function _SDL_DYNAPI_entry
1>SDL2.lib(SDL_dynapi.obj) : error LNK2019: unresolved external symbol _SDL_GameControllerGetAxisFromString_REAL referenced in function _SDL_DYNAPI_entry
1>SDL2.lib(SDL_dynapi.obj) : error LNK2019: unresolved external symbol _SDL_GameControllerUpdate_REAL referenced in function _SDL_DYNAPI_entry
1>SDL2.lib(SDL_dynapi.obj) : error LNK2019: unresolved external symbol _SDL_GameControllerEventState_REAL referenced in function _SDL_DYNAPI_entry
1>SDL2.lib(SDL_dynapi.obj) : error LNK2019: unresolved external symbol _SDL_GameControllerGetJoystick_REAL referenced in function _SDL_DYNAPI_entry
1>SDL2.lib(SDL_dynapi.obj) : error LNK2019: unresolved external symbol _SDL_GameControllerGetAttached_REAL referenced in function _SDL_DYNAPI_entry
1>SDL2.lib(SDL_dynapi.obj) : error LNK2019: unresolved external symbol _SDL_GameControllerName_REAL referenced in function _SDL_DYNAPI_entry
1>SDL2.lib(SDL_dynapi.obj) : error LNK2019: unresolved external symbol _SDL_GameControllerOpen_REAL referenced in function _SDL_DYNAPI_entry
1>SDL2.lib(SDL_dynapi.obj) : error LNK2019: unresolved external symbol _SDL_GameControllerNameForIndex_REAL referenced in function _SDL_DYNAPI_entry
1>SDL2.lib(SDL_dynapi.obj) : error LNK2019: unresolved external symbol _SDL_IsGameController_REAL referenced in function _SDL_DYNAPI_entry
1>SDL2.lib(SDL_dynapi.obj) : error LNK2019: unresolved external symbol _SDL_GameControllerMapping_REAL referenced in function _SDL_DYNAPI_entry
1>SDL2.lib(SDL_dynapi.obj) : error LNK2019: unresolved external symbol _SDL_GameControllerMappingForGUID_REAL referenced in function _SDL_DYNAPI_entry
1>SDL2.lib(SDL_dynapi.obj) : error LNK2019: unresolved external symbol _SDL_GameControllerAddMapping_REAL referenced in function _SDL_DYNAPI_entry
1>SDL2.lib(SDL_systimer.obj) : error LNK2019: unresolved external symbol __imp__timeGetTime@0 referenced in function _SDL_TicksInit
1>SDL2.lib(SDL_systimer.obj) : error LNK2019: unresolved external symbol __imp__timeBeginPeriod@4 referenced in function _timeSetPeriod
1>SDL2.lib(SDL_systimer.obj) : error LNK2019: unresolved external symbol __imp__timeEndPeriod@4 referenced in function _timeSetPeriod
1>SDL2.lib(SDL_winmm.obj) : error LNK2019: unresolved external symbol __imp__waveOutGetDevCapsW@12 referenced in function _DetectWaveOutDevs
1>SDL2.lib(SDL_winmm.obj) : error LNK2019: unresolved external symbol __imp__waveOutGetNumDevs@0 referenced in function _DetectWaveOutDevs
1>SDL2.lib(SDL_winmm.obj) : error LNK2019: unresolved external symbol __imp__waveInGetDevCapsW@12 referenced in function _DetectWaveInDevs
1>SDL2.lib(SDL_winmm.obj) : error LNK2019: unresolved external symbol __imp__waveInGetNumDevs@0 referenced in function _DetectWaveInDevs
1>SDL2.lib(SDL_winmm.obj) : error LNK2019: unresolved external symbol __imp__waveOutWrite@12 referenced in function _WINMM_PlayDevice
1>SDL2.lib(SDL_winmm.obj) : error LNK2019: unresolved external symbol __imp__waveOutClose@4 referenced in function _WINMM_CloseDevice
1>SDL2.lib(SDL_winmm.obj) : error LNK2019: unresolved external symbol __imp__waveInClose@4 referenced in function _WINMM_CloseDevice
1>SDL2.lib(SDL_winmm.obj) : error LNK2019: unresolved external symbol __imp__waveOutUnprepareHeader@12 referenced in function _WINMM_CloseDevice
1>SDL2.lib(SDL_winmm.obj) : error LNK2019: unresolved external symbol __imp__waveOutPrepareHeader@12 referenced in function _WINMM_OpenDevice
1>SDL2.lib(SDL_winmm.obj) : error LNK2019: unresolved external symbol __imp__waveOutOpen@24 referenced in function _WINMM_OpenDevice
1>SDL2.lib(SDL_winmm.obj) : error LNK2019: unresolved external symbol __imp__waveInOpen@24 referenced in function _WINMM_OpenDevice
1>SDL2.lib(SDL_winmm.obj) : error LNK2019: unresolved external symbol __imp__waveOutGetErrorTextW@12 referenced in function _SetMMerror
1>SDL2.lib(SDL_windowskeyboard.obj) : error LNK2019: unresolved external symbol _ImmReleaseContext@8 referenced in function _IME_Init
1>SDL2.lib(SDL_windowskeyboard.obj) : error LNK2019: unresolved external symbol _ImmGetContext@4 referenced in function _IME_Init
1>SDL2.lib(SDL_windowskeyboard.obj) : error LNK2019: unresolved external symbol _ImmAssociateContext@8 referenced in function _IME_Enable
1>SDL2.lib(SDL_windowskeyboard.obj) : error LNK2019: unresolved external symbol _ImmGetIMEFileNameA@12 referenced in function _IME_SetupAPI
1>SDL2.lib(SDL_windowskeyboard.obj) : error LNK2019: unresolved external symbol _ImmSetCompositionStringW@24 referenced in function _IME_ClearComposition
1>SDL2.lib(SDL_windowskeyboard.obj) : error LNK2019: unresolved external symbol _ImmNotifyIME@16 referenced in function _IME_ClearComposition
1>SDL2.lib(SDL_windowskeyboard.obj) : error LNK2019: unresolved external symbol _VerQueryValueA@16 referenced in function _IME_GetId
1>SDL2.lib(SDL_windowskeyboard.obj) : error LNK2019: unresolved external symbol _GetFileVersionInfoA@16 referenced in function _IME_GetId
1>SDL2.lib(SDL_windowskeyboard.obj) : error LNK2019: unresolved external symbol _GetFileVersionInfoSizeA@8 referenced in function _IME_GetId
1>SDL2.lib(SDL_windowskeyboard.obj) : error LNK2019: unresolved external symbol _ImmGetCompositionStringW@16 referenced in function _IME_GetCompositionString
1>SDL2.lib(SDL_windowskeyboard.obj) : error LNK2019: unresolved external symbol _ImmGetCandidateListW@16 referenced in function _IME_GetCandidateList
1>D:\dev\cpp\2d\SDL\SDL-b577c4753421\SDL-b577c4753421\build\Debug\sdl-static-test1.exe : fatal error LNK1120: 98 unresolved externals
the cmake mode is this :
Code:
Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE)
0.4.0 :: 4 :: 0 :: 4 :: 2.0
SDL2 was configured with the following options:
Platform: Windows-6.1
64-bit: FALSE
Compiler: C:/Program Files/Microsoft Visual Studio 9.0/VC/bin/cl.exe
Subsystems:
Atomic: ON
Audio: ON
Video: ON
Render: ON
Events: ON
Joystick: OFF
Haptic: OFF
Power: ON
Threads: ON
Timers: ON
File: ON
Loadso: ON
CPUinfo: ON
Filesystem: ON
Options:
3DNOW (Wanted: ON): OFF
ALSA (Wanted: OFF): OFF
ALSA_SHARED (Wanted: OFF): OFF
ALTIVEC (Wanted: ON): OFF
ARTS (Wanted: OFF): OFF
ARTS_SHARED (Wanted: OFF): OFF
ASSEMBLY (Wanted: ON): OFF
ASSERTIONS (Wanted: auto): auto
CLOCK_GETTIME (Wanted: OFF): OFF
DIRECTFB_SHARED (Wanted: OFF): OFF
DIRECTX (Wanted: OFF): OFF
DISKAUDIO (Wanted: ON): ON
DUMMYAUDIO (Wanted: ON): ON
ESD (Wanted: OFF): OFF
ESD_SHARED (Wanted: OFF): OFF
FUSIONSOUND (Wanted: OFF): OFF
FUSIONSOUND_SHARED (Wanted: OFF): OFF
GCC_ATOMICS (Wanted: OFF): OFF
INPUT_TSLIB (Wanted: OFF): OFF
LIBC (Wanted: OFF): OFF
MMX (Wanted: ON): OFF
NAS (Wanted: OFF): OFF
NAS_SHARED (Wanted: OFF): OFF
OSS (Wanted: OFF): OFF
PTHREADS (Wanted: OFF): OFF
PTHREADS_SEM (Wanted: OFF): OFF
PULSEAUDIO (Wanted: OFF): OFF
PULSEAUDIO_SHARED (Wanted: OFF): OFF
RENDER_D3D (Wanted: ON): OFF
RPATH (Wanted: OFF): OFF
SDL_DLOPEN (Wanted: OFF): OFF
SNDIO (Wanted: OFF): OFF
SSE (Wanted: ON): OFF
SSE2 (Wanted: OFF): OFF
SSEMATH (Wanted: OFF): OFF
VIDEO_COCOA (Wanted: OFF): OFF
VIDEO_DIRECTFB (Wanted: OFF): OFF
VIDEO_DUMMY (Wanted: ON): ON
VIDEO_MIR (Wanted: OFF): OFF
VIDEO_OPENGL (Wanted: ON): ON
VIDEO_OPENGLES (Wanted: ON): OFF
VIDEO_RPI (Wanted: OFF): OFF
VIDEO_VIVANTE (Wanted: OFF): OFF
VIDEO_WAYLAND (Wanted: OFF): OFF
VIDEO_X11 (Wanted: OFF): OFF
VIDEO_X11_XCURSOR (Wanted: OFF): OFF
VIDEO_X11_XINERAMA (Wanted: OFF): OFF
VIDEO_X11_XINPUT (Wanted: OFF): OFF
VIDEO_X11_XRANDR (Wanted: OFF): OFF
VIDEO_X11_XSCRNSAVER (Wanted: OFF): OFF
VIDEO_X11_XSHAPE (Wanted: OFF): OFF
VIDEO_X11_XVM (Wanted: OFF): OFF
X11_SHARED (Wanted: OFF): OFF