VS2019 linker error using SDL library

Pages: 12
I tried to build with release, but same errors again.
Not sure what is wrong here?

Severity Code Description Project File Line Suppression State
Error LNK1104 cannot open file 'SDL_image.lib' SDL_image C:\Users\Denver\Documents\Test\SDL_image-1.2.12\VisualC\LINK 1
Error LNK1104 cannot open file '..\Release\SDL_image.lib' showimage C:\Users\Denver\Documents\Test\SDL_image-1.2.12\VisualC\showimage\LINK 1
From your previous post:

either change the path to ..\x64\Release\SDL_image.lib or move the .lib file to the desired path.


Have you tried either of those things?
I manually copied the SDL_image.lib from another folder to that path and issue got resolved.
Now I can dynamically link .dlls and run my application using SDL.
I need to know how to do static linking of SDL to VS2019, there by creating a stand alone application.exe that can be run on multiple systems without installing any other programs? Do you have any info on SDL static link to VS? Also once I build SDL, should I copy those .lib files to both Release and Debug directories of my VS project application folders for 64bit ? I am planning to statically build all dependent SDL libraries and then statically link to my stand alone application .exe? is that the right way to do? please advise me.
Last edited on
I am able to statically create SDL. Now trying for other SDL libraries. For exampel SDL_image to be created as static, has lot of SDL_image dependencies. i need to compile each of these separately to get for example like libpng16.lib, libwebp.lib, libjpeg and zlib.lib. Any idea how this can be created? Need to download those packages separately and compile as static? Once I create those .lib files, where in my application project in VS should I place these files along with their dependent header files? i mean which path in my application work space to copy all these .lib files so that I can create a stand alone .exe application which can be run on multiple systems?
While doing SDL static linking to vs2019, i got below errors. is it due to sdl dependencies? I have not installed any directx sdk, but it points like SDL_dx5video.obj below?

error LNK2001: unresolved external symbol __imp__time64
1>SDL.lib(SDL_dx5video.obj) : error LNK2001: unresolved external symbol GUID_XAxis
1>SDL.lib(SDL_dx5video.obj) : error LNK2001: unresolved external symbol GUID_YAxis
1>SDL.lib(SDL_dx5video.obj) : error LNK2001: unresolved external symbol GUID_ZAxis
1>SDL.lib(SDL_dx5video.obj) : error LNK2001: unresolved external symbol GUID_RxAxis
1>SDL.lib(SDL_dx5video.obj) : error LNK2001: unresolved external symbol GUID_RyAxis
1>SDL.lib(SDL_dx5video.obj) : error LNK2001: unresolved external symbol GUID_RzAxis
1>SDL.lib(SDL_dx5video.obj) : error LNK2001: unresolved external symbol GUID_Slider
1>SDL.lib(SDL_dx5video.obj) : error LNK2001: unresolved external symbol GUID_Key
1>SDL.lib(SDL_dx5video.obj) : error LNK2001: unresolved external symbol GUID_POV
1>SDL.lib(SDL_dx5video.obj) : error LNK2001: unresolved external symbol IID_IDirectDraw2
1>SDL.lib(SDL_dx5video.obj) : error LNK2001: unresolved external symbol IID_IDirectDrawSurface3
1>SDL.lib(SDL_dx5yuv.obj) : error LNK2001: unresolved external symbol IID_IDirectDrawSurface3
1>SDL.lib(SDL_dx5video.obj) : error LNK2001: unresolved external symbol IID_IDirectDrawGammaControl
1>SDL.lib(SDL_dx5events.obj) : error LNK2001: unresolved external symbol GUID_SysMouse
1>SDL.lib(SDL_dx5events.obj) : error LNK2001: unresolved external symbol GUID_SysKeyboard
1>SDL.lib(SDL_dx5events.obj) : error LNK2001: unresolved external symbol IID_IDirectInputDevice2A
fixed all SDL ERRORS by recompiling sdl code. but I am just left with error.
any idea to fix it? is time64 a function in time.h? should i add any .lib for time64 while static linking in vs 2019 64 bit release build version?

Error LNK2001 unresolved external symbol __imp__time64
LNK2001 is gone, after I CHANGED FROM (Multi-threaded DLL(/MD)) TO

Configuration Properties-> C/C++->Code Generation ->Runtimelibrary ->Multi-threaded(/MT)

BUT MY PROJECT STILL HAS Configuration Properties-> General ->Configuration Type ->Application(.exe)

Also in Linker->Input->Additional dependencies, have added all .lib files that need to statically linked to VS.
Is this the right way to create stand alone Application.exe?

Last edited on
Topic archived. No new replies allowed.
Pages: 12