PascalGameDevelopment / SDL2-for-Pascal

Unit files for building Free Pascal and Delphi applications using the SDL2 library
https://pascalgamedevelopment.github.io/SDL2-for-Pascal/
Mozilla Public License 2.0
103 stars 20 forks source link

Is it possible to static link `libSDL2.a` in windows x64? #126

Closed cpicanco closed 1 year ago

cpicanco commented 1 year ago

Hi, I was trying to static link libSDL2.a, x64, (from SDL2-devel-2.26.5-mingw.zip) and I am getting windows api related undefined symbols. Can you shed some light on this?

eyelink_project.lpr(23,1) Error: Undefined symbol: __imp_LoadLibraryA (first seen in libSDL2.a(SDL_dynapi.o))
eyelink_project.lpr(23,1) Error: Undefined symbol: __imp_GetProcAddress (first seen in libSDL2.a(SDL_dynapi.o))
eyelink_project.lpr(23,1) Error: Undefined symbol: __imp_FreeLibrary (first seen in libSDL2.a(SDL_dynapi.o))
eyelink_project.lpr(23,1) Error: Undefined symbol: __imp_MessageBoxA (first seen in libSDL2.a(SDL_dynapi.o))
eyelink_project.lpr(23,1) Error: Undefined symbol: __imp_OutputDebugStringW (first seen in libSDL2.a(SDL_log.o))
eyelink_project.lpr(23,1) Error: Undefined symbol: __imp_AttachConsole (first seen in libSDL2.a(SDL_log.o))
eyelink_project.lpr(23,1) Error: Undefined symbol: __imp_GetStdHandle (first seen in libSDL2.a(SDL_log.o))
eyelink_project.lpr(23,1) Error: Undefined symbol: __imp_GetConsoleMode (first seen in libSDL2.a(SDL_log.o))
eyelink_project.lpr(23,1) Error: Undefined symbol: __imp_WriteConsoleW (first seen in libSDL2.a(SDL_log.o))
eyelink_project.lpr(23,1) Error: Undefined symbol: __imp_GetLastError (first seen in libSDL2.a(SDL_log.o))
eyelink_project.lpr(23,1) Error: Undefined symbol: __imp_WriteFile (first seen in libSDL2.a(SDL_log.o))
eyelink_project.lpr(23,1) Error: Undefined symbol: strlen (first seen in libSDL2.a(SDL_string.o))
eyelink_project.lpr(23,1) Error: Undefined symbol: __imp_CloseHandle (first seen in libSDL2.a(SDL_rwops.o))
eyelink_project.lpr(23,1) Error: Undefined symbol: __imp_SetFilePointer (first seen in libSDL2.a(SDL_rwops.o))
eyelink_project.lpr(23,1) Error: Undefined symbol: __imp_ReadFile (first seen in libSDL2.a(SDL_rwops.o))
eyelink_project.lpr(23,1) Error: Undefined symbol: __imp_SetFilePointerEx (first seen in libSDL2.a(SDL_rwops.o))
eyelink_project.lpr(23,1) Error: Undefined symbol: __imp_GetFileSizeEx (first seen in libSDL2.a(SDL_rwops.o))
eyelink_project.lpr(23,1) Error: Undefined symbol: __imp_SetErrorMode (first seen in libSDL2.a(SDL_rwops.o))
eyelink_project.lpr(23,1) Error: Undefined symbol: __imp_CreateFileW (first seen in libSDL2.a(SDL_rwops.o))
eyelink_project.lpr(23,1) Error: Undefined symbol: __imp_GetSystemMetrics (first seen in libSDL2.a(SDL_windowsevents.o))
eyelink_project.lpr(23,1) Error: Undefined symbol: __imp_GetAsyncKeyState (first seen in libSDL2.a(SDL_windowsevents.o))
eyelink_project.lpr(23,1) Error: Undefined symbol: __imp_GetForegroundWindow (first seen in libSDL2.a(SDL_windowsevents.o))
eyelink_project.lpr(23,1) Error: Undefined symbol: __imp_GetClipCursor (first seen in libSDL2.a(SDL_windowsevents.o))
eyelink_project.lpr(23,1) Error: Undefined symbol: __imp_GetKeyState (first seen in libSDL2.a(SDL_windowsevents.o))
eyelink_project.lpr(23,1) Error: Undefined symbol: __imp_ClipCursor (first seen in libSDL2.a(SDL_windowsevents.o))
eyelink_project.lpr(23,1) Error: Undefined symbol: __imp_GetCursorPos (first seen in libSDL2.a(SDL_windowsevents.o))
eyelink_project.lpr(23,1) Error: Undefined symbol: __imp_ScreenToClient (first seen in libSDL2.a(SDL_windowsevents.o))
eyelink_project.lpr(23,1) Error: Undefined symbol: __imp_GetPropW (first seen in libSDL2.a(SDL_windowsevents.o))
eyelink_project.lpr(23,1) Error: Undefined symbol: __imp_GetWindowLongW (first seen in libSDL2.a(SDL_windowsevents.o))
eyelink_project.lpr(23,1) Error: Undefined symbol: __imp_DefWindowProcW (first seen in libSDL2.a(SDL_windowsevents.o))
eyelink_project.lpr(23,1) Error: Undefined symbol: __imp_CallWindowProcW (first seen in libSDL2.a(SDL_windowsevents.o))
eyelink_project.lpr(23,1) Error: Undefined symbol: __imp_GetMessageExtraInfo (first seen in libSDL2.a(SDL_windowsevents.o))
eyelink_project.lpr(23,1) Error: Undefined symbol: __imp_GetWindowRect (first seen in libSDL2.a(SDL_windowsevents.o))
eyelink_project.lpr(23,1) Error: Undefined symbol: __imp_SetCursor (first seen in libSDL2.a(SDL_windowsevents.o))
eyelink_project.lpr(23,1) Error: Undefined symbol: __imp_IsIconic (first seen in libSDL2.a(SDL_windowsevents.o))
eyelink_project.lpr(23,1) Error: Undefined symbol: __imp_GetClientRect (first seen in libSDL2.a(SDL_windowsevents.o))
eyelink_project.lpr(23,1) Error: Undefined symbol: __imp_IsRectEmpty (first seen in libSDL2.a(SDL_windowsevents.o))
eyelink_project.lpr(23,1) Error: Undefined symbol: __imp_ClientToScreen (first seen in libSDL2.a(SDL_windowsevents.o))
eyelink_project.lpr(23,1) Error: Undefined symbol: __imp_InvalidateRect (first seen in libSDL2.a(SDL_windowsevents.o))
eyelink_project.lpr(23,1) Error: Undefined symbol: __imp_CreateSolidBrush (first seen in libSDL2.a(SDL_windowsevents.o))
eyelink_project.lpr(23,1) Error: Undefined symbol: __imp_GetDC (first seen in libSDL2.a(SDL_windowsevents.o))
eyelink_project.lpr(23,1) Error: Undefined symbol: __imp_FillRect (first seen in libSDL2.a(SDL_windowsevents.o))
eyelink_project.lpr(23,1) Error: Undefined symbol: __imp_DeleteObject (first seen in libSDL2.a(SDL_windowsevents.o))
eyelink_project.lpr(23,1) Error: Undefined symbol: __imp_GetUpdateRect (first seen in libSDL2.a(SDL_windowsevents.o))
eyelink_project.lpr(23,1) Error: Undefined symbol: __imp_ValidateRect (first seen in libSDL2.a(SDL_windowsevents.o))
eyelink_project.lpr(23,1) Error: Undefined symbol: __imp_DragQueryFileW (first seen in libSDL2.a(SDL_windowsevents.o))
eyelink_project.lpr(23,1) Error: Undefined symbol: __imp_DragFinish (first seen in libSDL2.a(SDL_windowsevents.o))
eyelink_project.lpr(23,1) Error: Undefined symbol: __imp_SetWindowPos (first seen in libSDL2.a(SDL_windowsevents.o))
eyelink_project.lpr(23,1) Error: Undefined symbol: __imp_TrackMouseEvent (first seen in libSDL2.a(SDL_windowsevents.o))
eyelink_project.lpr(23,1) Error: Undefined symbol: __imp_GetMenu (first seen in libSDL2.a(SDL_windowsevents.o))
eyelink_project.lpr(23,1) Verbose: There were 50 errors compiling module, stopping
Verbose: Compilation aborted
cpicanco commented 1 year ago

I will close this issues because SDL guys discouraged doing static link.

Free-Pascal-meets-SDL-Website commented 1 year ago

Alright, thanks.