Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Unable to statically link library using SMFL_STATIC - premake  (Read 1246 times)

0 Members and 1 Guest are viewing this topic.

mohragk

  • Newbie
  • *
  • Posts: 4
    • View Profile
Unable to statically link library using SMFL_STATIC - premake
« on: November 11, 2020, 12:58:18 pm »
I'm trying to setup a VS2019 solution that uses the static version of the SFML library. No matter what I do, I get several linker errors when trying to build the example "Hello World" script.

I'm using this premake script:

workspace "bake_snird"
   configurations { "Debug", "Release" }
   location "build"
   platforms {"x64"}

project "bake_snird"
   kind "ConsoleApp"
   language "C++"
   
   targetdir "bin/%{cfg.buildcfg}"

   files { "src/**.*" }

   filter "configurations:*"
      defines { "SFML_STATIC" }
      includedirs { "dependencies/SFML/include" }
      libdirs { "dependencies/SFML/lib" }
      links
      {
         "opengl32",
         "freetype",
         "winmm",
         "gdi32",
         "flac",
         "vorbisenc",
         "vorbisfile",
         "vorbis",
         "ogg",
         "ws2_32"
      }

   filter "configurations:Debug"
      defines { "DEBUG" }
      symbols "On"
      links
      {   
         "sfml-graphics-s-d",
         "sfml-window-s-d",
         "sfml-system-s-d",
         "sfml-audio-s-d",
         "sfml-network-s-d"
      }

   filter "configurations:Release"
      defines { "NDEBUG" }
      optimize "On"
      links
      {   
         "sfml-graphics-s",
         "sfml-window-s",
         "sfml-system-s",
         "sfml-audio-s",
         "sfml-network-s"
      }



Main.cpp:

#include <SFML/Audio.hpp>
#include <SFML/Graphics.hpp>
int main()
{
    // Create the main window
    sf::RenderWindow window(sf::VideoMode(800, 600), "SFML window");
    // Load a sprite to display
    sf::Texture texture;
    if (!texture.loadFromFile("cute_image.jpg"))
        return EXIT_FAILURE;
    sf::Sprite sprite(texture);
    // Create a graphical text to display
    sf::Font font;
    if (!font.loadFromFile("arial.ttf"))
        return EXIT_FAILURE;
    sf::Text text("Hello SFML", font, 50);
    // Load a music to play
    sf::Music music;
    if (!music.openFromFile("nice_music.ogg"))
        return EXIT_FAILURE;
    // Play the music
    music.play();
    // Start the game loop
    while (window.isOpen())
    {
        // Process events
        sf::Event event;
        while (window.pollEvent(event))
        {
            // Close window: exit
            if (event.type == sf::Event::Closed)
                window.close();
        }
        // Clear screen
        window.clear();
        // Draw the sprite
        window.draw(sprite);
        // Draw the string
        window.draw(text);
        // Update the window
        window.display();
    }
    return EXIT_SUCCESS;
}


This is the output when trying to build a debug x64 solution:

1>------ Build started: Project: bake_snird, Configuration: Debug x64 ------
1>sfml-window-s-d.lib(VideoModeImpl.cpp.obj) : error LNK2019: unresolved external symbol __imp_EnumDisplaySettingsW referenced in function "public: static class std::vector<class sf::VideoMode,class std::allocator<class sf::VideoMode> > __cdecl sf::priv::VideoModeImpl::getFullscreenModes(void)" (?getFullscreenModes@VideoModeImpl@priv@sf@@SA?AV?$vector@VVideoMode@sf@@V?$allocator@VVideoMode@sf@@@std@@@std@@XZ)
1>sfml-window-s-d.lib(CursorImpl.cpp.obj) : error LNK2019: unresolved external symbol __imp_GetDC referenced in function "public: bool __cdecl sf::priv::CursorImpl::loadFromPixels(unsigned char const *,class sf::Vector2<unsigned int>,class sf::Vector2<unsigned int>)" (?loadFromPixels@CursorImpl@priv@sf@@QEAA_NPEBEV?$Vector2@I@3@1@Z)
1>sfml-window-s-d.lib(WglContext.cpp.obj) : error LNK2001: unresolved external symbol __imp_GetDC
1>sfml-window-s-d.lib(WindowImplWin32.cpp.obj) : error LNK2001: unresolved external symbol __imp_GetDC
1>sfml-window-s-d.lib(CursorImpl.cpp.obj) : error LNK2019: unresolved external symbol __imp_ReleaseDC referenced in function "public: bool __cdecl sf::priv::CursorImpl::loadFromPixels(unsigned char const *,class sf::Vector2<unsigned int>,class sf::Vector2<unsigned int>)" (?loadFromPixels@CursorImpl@priv@sf@@QEAA_NPEBEV?$Vector2@I@3@1@Z)
1>sfml-window-s-d.lib(WglContext.cpp.obj) : error LNK2001: unresolved external symbol __imp_ReleaseDC
1>sfml-window-s-d.lib(WindowImplWin32.cpp.obj) : error LNK2001: unresolved external symbol __imp_ReleaseDC
1>sfml-window-s-d.lib(CursorImpl.cpp.obj) : error LNK2019: unresolved external symbol __imp_LoadCursorW referenced in function "public: bool __cdecl sf::priv::CursorImpl::loadFromSystem(enum sf::Cursor::Type)" (?loadFromSystem@CursorImpl@priv@sf@@QEAA_NW4Type@Cursor@3@@Z)
1>sfml-window-s-d.lib(WindowImplWin32.cpp.obj) : error LNK2001: unresolved external symbol __imp_LoadCursorW
1>sfml-window-s-d.lib(CursorImpl.cpp.obj) : error LNK2019: unresolved external symbol __imp_DestroyCursor referenced in function "private: void __cdecl sf::priv::CursorImpl::release(void)" (?release@CursorImpl@priv@sf@@AEAAXXZ)
1>sfml-window-s-d.lib(CursorImpl.cpp.obj) : error LNK2019: unresolved external symbol __imp_CreateIconIndirect referenced in function "public: bool __cdecl sf::priv::CursorImpl::loadFromPixels(unsigned char const *,class sf::Vector2<unsigned int>,class sf::Vector2<unsigned int>)" (?loadFromPixels@CursorImpl@priv@sf@@QEAA_NPEBEV?$Vector2@I@3@1@Z)
1>sfml-window-s-d.lib(CursorImpl.cpp.obj) : error LNK2019: unresolved external symbol __imp_CopyIcon referenced in function "public: bool __cdecl sf::priv::CursorImpl::loadFromSystem(enum sf::Cursor::Type)" (?loadFromSystem@CursorImpl@priv@sf@@QEAA_NW4Type@Cursor@3@@Z)
1>sfml-window-s-d.lib(WglContext.cpp.obj) : error LNK2019: unresolved external symbol __imp_CreateWindowExA referenced in function "private: void __cdecl sf::priv::WglContext::createSurface(class sf::priv::WglContext *,unsigned int,unsigned int,unsigned int)" (?createSurface@WglContext@priv@sf@@AEAAXPEAV123@III@Z)
1>sfml-window-s-d.lib(WglContext.cpp.obj) : error LNK2019: unresolved external symbol __imp_DestroyWindow referenced in function "public: virtual __cdecl sf::priv::WglContext::~WglContext(void)" (??1WglContext@priv@sf@@UEAA@XZ)
1>sfml-window-s-d.lib(WindowImplWin32.cpp.obj) : error LNK2001: unresolved external symbol __imp_DestroyWindow
1>sfml-window-s-d.lib(WglContext.cpp.obj) : error LNK2019: unresolved external symbol __imp_ShowWindow referenced in function "private: void __cdecl sf::priv::WglContext::createSurface(class sf::priv::WglContext *,unsigned int,unsigned int,unsigned int)" (?createSurface@WglContext@priv@sf@@AEAAXPEAV123@III@Z)
1>sfml-window-s-d.lib(WindowImplWin32.cpp.obj) : error LNK2001: unresolved external symbol __imp_ShowWindow
1>sfml-window-s-d.lib(WindowImplWin32.cpp.obj) : error LNK2019: unresolved external symbol __imp_TrackMouseEvent referenced in function "private: void __cdecl sf::priv::WindowImplWin32::setTracking(bool)" (?setTracking@WindowImplWin32@priv@sf@@AEAAX_N@Z)
1>sfml-window-s-d.lib(WindowImplWin32.cpp.obj) : error LNK2019: unresolved external symbol __imp_TranslateMessage referenced in function "protected: virtual void __cdecl sf::priv::WindowImplWin32::processEvents(void)" (?processEvents@WindowImplWin32@priv@sf@@MEAAXXZ)
1>sfml-window-s-d.lib(WindowImplWin32.cpp.obj) : error LNK2019: unresolved external symbol __imp_DispatchMessageW referenced in function "protected: virtual void __cdecl sf::priv::WindowImplWin32::processEvents(void)" (?processEvents@WindowImplWin32@priv@sf@@MEAAXXZ)
1>sfml-window-s-d.lib(WindowImplWin32.cpp.obj) : error LNK2019: unresolved external symbol __imp_PeekMessageW referenced in function "protected: virtual void __cdecl sf::priv::WindowImplWin32::processEvents(void)" (?processEvents@WindowImplWin32@priv@sf@@MEAAXXZ)
1>sfml-window-s-d.lib(WindowImplWin32.cpp.obj) : error LNK2019: unresolved external symbol __imp_SendMessageW referenced in function "public: virtual void __cdecl sf::priv::WindowImplWin32::setIcon(unsigned int,unsigned int,unsigned char const *)" (?setIcon@WindowImplWin32@priv@sf@@UEAAXIIPEBE@Z)
1>sfml-window-s-d.lib(WindowImplWin32.cpp.obj) : error LNK2019: unresolved external symbol __imp_RegisterDeviceNotificationW referenced in function "public: __cdecl sf::priv::WindowImplWin32::WindowImplWin32(class sf::VideoMode,class sf::String const &,unsigned int,struct sf::ContextSettings const &)" (??0WindowImplWin32@priv@sf@@QEAA@VVideoMode@2@AEBVString@2@IAEBUContextSettings@2@@Z)
1>sfml-window-s-d.lib(WindowImplWin32.cpp.obj) : error LNK2019: unresolved external symbol __imp_DefWindowProcW referenced in function "private: static __int64 __cdecl sf::priv::WindowImplWin32::globalOnEvent(struct HWND__ *,unsigned int,unsigned __int64,__int64)" (?globalOnEvent@WindowImplWin32@priv@sf@@CA_JPEAUHWND__@@I_K_J@Z)
1>sfml-window-s-d.lib(WindowImplWin32.cpp.obj) : error LNK2019: unresolved external symbol __imp_CallWindowProcW referenced in function "private: static __int64 __cdecl sf::priv::WindowImplWin32::globalOnEvent(struct HWND__ *,unsigned int,unsigned __int64,__int64)" (?globalOnEvent@WindowImplWin32@priv@sf@@CA_JPEAUHWND__@@I_K_J@Z)
1>sfml-window-s-d.lib(WindowImplWin32.cpp.obj) : error LNK2019: unresolved external symbol __imp_RegisterClassW referenced in function "private: void __cdecl sf::priv::WindowImplWin32::registerWindowClass(void)" (?registerWindowClass@WindowImplWin32@priv@sf@@AEAAXXZ)
1>sfml-window-s-d.lib(WindowImplWin32.cpp.obj) : error LNK2019: unresolved external symbol __imp_UnregisterClassW referenced in function "public: virtual __cdecl sf::priv::WindowImplWin32::~WindowImplWin32(void)" (??1WindowImplWin32@priv@sf@@UEAA@XZ)
1>sfml-window-s-d.lib(WindowImplWin32.cpp.obj) : error LNK2019: unresolved external symbol __imp_CreateWindowExW referenced in function "public: __cdecl sf::priv::WindowImplWin32::WindowImplWin32(class sf::VideoMode,class sf::String const &,unsigned int,struct sf::ContextSettings const &)" (??0WindowImplWin32@priv@sf@@QEAA@VVideoMode@2@AEBVString@2@IAEBUContextSettings@2@@Z)
1>sfml-window-s-d.lib(WindowImplWin32.cpp.obj) : error LNK2019: unresolved external symbol __imp_FlashWindowEx referenced in function "public: virtual void __cdecl sf::priv::WindowImplWin32::requestFocus(void)" (?requestFocus@WindowImplWin32@priv@sf@@UEAAXXZ)
1>sfml-window-s-d.lib(WindowImplWin32.cpp.obj) : error LNK2019: unresolved external symbol __imp_SetWindowPos referenced in function "public: virtual void __cdecl sf::priv::WindowImplWin32::setPosition(class sf::Vector2<int> const &)" (?setPosition@WindowImplWin32@priv@sf@@UEAAXAEBV?$Vector2@H@3@@Z)
1>sfml-window-s-d.lib(WindowImplWin32.cpp.obj) : error LNK2019: unresolved external symbol __imp_GetKeyState referenced in function "private: void __cdecl sf::priv::WindowImplWin32::processEvent(unsigned int,unsigned __int64,__int64)" (?processEvent@WindowImplWin32@priv@sf@@AEAAXI_K_J@Z)
1>sfml-window-s-d.lib(WindowImplWin32.cpp.obj) : error LNK2019: unresolved external symbol __imp_MapVirtualKeyW referenced in function "private: static enum sf::Keyboard::Key __cdecl sf::priv::WindowImplWin32::virtualKeyCodeToSF(unsigned __int64,__int64)" (?virtualKeyCodeToSF@WindowImplWin32@priv@sf@@CA?AW4Key@Keyboard@3@_K_J@Z)
1>sfml-window-s-d.lib(WindowImplWin32.cpp.obj) : error LNK2019: unresolved external symbol __imp_GetCapture referenced in function "private: void __cdecl sf::priv::WindowImplWin32::processEvent(unsigned int,unsigned __int64,__int64)" (?processEvent@WindowImplWin32@priv@sf@@AEAAXI_K_J@Z)
1>sfml-window-s-d.lib(WindowImplWin32.cpp.obj) : error LNK2019: unresolved external symbol __imp_SetCapture referenced in function "private: void __cdecl sf::priv::WindowImplWin32::processEvent(unsigned int,unsigned __int64,__int64)" (?processEvent@WindowImplWin32@priv@sf@@AEAAXI_K_J@Z)
1>sfml-window-s-d.lib(WindowImplWin32.cpp.obj) : error LNK2019: unresolved external symbol __imp_ReleaseCapture referenced in function "private: void __cdecl sf::priv::WindowImplWin32::cleanup(void)" (?cleanup@WindowImplWin32@priv@sf@@AEAAXXZ)
1>sfml-window-s-d.lib(WindowImplWin32.cpp.obj) : error LNK2019: unresolved external symbol __imp_GetForegroundWindow referenced in function "public: virtual void __cdecl sf::priv::WindowImplWin32::requestFocus(void)" (?requestFocus@WindowImplWin32@priv@sf@@UEAAXXZ)
1>sfml-window-s-d.lib(WindowImplWin32.cpp.obj) : error LNK2019: unresolved external symbol __imp_SetForegroundWindow referenced in function "public: virtual void __cdecl sf::priv::WindowImplWin32::requestFocus(void)" (?requestFocus@WindowImplWin32@priv@sf@@UEAAXXZ)
1>sfml-window-s-d.lib(WindowImplWin32.cpp.obj) : error LNK2019: unresolved external symbol __imp_SetWindowTextW referenced in function "public: virtual void __cdecl sf::priv::WindowImplWin32::setTitle(class sf::String const &)" (?setTitle@WindowImplWin32@priv@sf@@UEAAXAEBVString@3@@Z)
1>sfml-window-s-d.lib(WindowImplWin32.cpp.obj) : error LNK2019: unresolved external symbol __imp_GetClientRect referenced in function "public: virtual class sf::Vector2<unsigned int> __cdecl sf::priv::WindowImplWin32::getSize(void)const " (?getSize@WindowImplWin32@priv@sf@@UEBA?AV?$Vector2@I@3@XZ)
1>sfml-window-s-d.lib(WindowImplWin32.cpp.obj) : error LNK2019: unresolved external symbol __imp_GetWindowRect referenced in function "public: virtual class sf::Vector2<int> __cdecl sf::priv::WindowImplWin32::getPosition(void)const " (?getPosition@WindowImplWin32@priv@sf@@UEBA?AV?$Vector2@H@3@XZ)
1>sfml-window-s-d.lib(WindowImplWin32.cpp.obj) : error LNK2019: unresolved external symbol __imp_AdjustWindowRect referenced in function "public: __cdecl sf::priv::WindowImplWin32::WindowImplWin32(class sf::VideoMode,class sf::String const &,unsigned int,struct sf::ContextSettings const &)" (??0WindowImplWin32@priv@sf@@QEAA@VVideoMode@2@AEBVString@2@IAEBUContextSettings@2@@Z)
1>sfml-window-s-d.lib(WindowImplWin32.cpp.obj) : error LNK2019: unresolved external symbol __imp_ShowCursor referenced in function "public: virtual void __cdecl sf::priv::WindowImplWin32::setMouseCursorVisible(bool)" (?setMouseCursorVisible@WindowImplWin32@priv@sf@@UEAAX_N@Z)
1>sfml-window-s-d.lib(WindowImplWin32.cpp.obj) : error LNK2019: unresolved external symbol __imp_SetCursor referenced in function "public: virtual void __cdecl sf::priv::WindowImplWin32::setMouseCursor(class sf::priv::CursorImpl const &)" (?setMouseCursor@WindowImplWin32@priv@sf@@UEAAXAEBVCursorImpl@23@@Z)
1>sfml-window-s-d.lib(WindowImplWin32.cpp.obj) : error LNK2019: unresolved external symbol __imp_ScreenToClient referenced in function "private: void __cdecl sf::priv::WindowImplWin32::processEvent(unsigned int,unsigned __int64,__int64)" (?processEvent@WindowImplWin32@priv@sf@@AEAAXI_K_J@Z)
1>sfml-window-s-d.lib(WindowImplWin32.cpp.obj) : error LNK2019: unresolved external symbol __imp_MapWindowPoints referenced in function "private: void __cdecl sf::priv::WindowImplWin32::grabCursor(bool)" (?grabCursor@WindowImplWin32@priv@sf@@AEAAX_N@Z)
1>sfml-window-s-d.lib(WindowImplWin32.cpp.obj) : error LNK2019: unresolved external symbol __imp_ClipCursor referenced in function "private: void __cdecl sf::priv::WindowImplWin32::grabCursor(bool)" (?grabCursor@WindowImplWin32@priv@sf@@AEAAX_N@Z)
1>sfml-window-s-d.lib(WindowImplWin32.cpp.obj) : error LNK2019: unresolved external symbol __imp_GetWindowLongW referenced in function "public: virtual void __cdecl sf::priv::WindowImplWin32::setSize(class sf::Vector2<unsigned int> const &)" (?setSize@WindowImplWin32@priv@sf@@UEAAXAEBV?$Vector2@I@3@@Z)
1>sfml-window-s-d.lib(WindowImplWin32.cpp.obj) : error LNK2019: unresolved external symbol __imp_SetWindowLongW referenced in function "private: void __cdecl sf::priv::WindowImplWin32::switchToFullscreen(class sf::VideoMode const &)" (?switchToFullscreen@WindowImplWin32@priv@sf@@AEAAXAEBVVideoMode@3@@Z)
1>sfml-window-s-d.lib(WindowImplWin32.cpp.obj) : error LNK2019: unresolved external symbol __imp_GetWindowLongPtrW referenced in function "private: static __int64 __cdecl sf::priv::WindowImplWin32::globalOnEvent(struct HWND__ *,unsigned int,unsigned __int64,__int64)" (?globalOnEvent@WindowImplWin32@priv@sf@@CA_JPEAUHWND__@@I_K_J@Z)
1>sfml-window-s-d.lib(WindowImplWin32.cpp.obj) : error LNK2019: unresolved external symbol __imp_SetWindowLongPtrW referenced in function "public: __cdecl sf::priv::WindowImplWin32::WindowImplWin32(struct HWND__ *)" (??0WindowImplWin32@priv@sf@@QEAA@PEAUHWND__@@@Z)
1>sfml-window-s-d.lib(WindowImplWin32.cpp.obj) : error LNK2019: unresolved external symbol __imp_GetWindowThreadProcessId referenced in function "public: virtual void __cdecl sf::priv::WindowImplWin32::requestFocus(void)" (?requestFocus@WindowImplWin32@priv@sf@@UEAAXXZ)
1>sfml-window-s-d.lib(WindowImplWin32.cpp.obj) : error LNK2019: unresolved external symbol __imp_CreateIcon referenced in function "public: virtual void __cdecl sf::priv::WindowImplWin32::setIcon(unsigned int,unsigned int,unsigned char const *)" (?setIcon@WindowImplWin32@priv@sf@@UEAAXIIPEBE@Z)
1>sfml-window-s-d.lib(WindowImplWin32.cpp.obj) : error LNK2019: unresolved external symbol __imp_DestroyIcon referenced in function "public: virtual __cdecl sf::priv::WindowImplWin32::~WindowImplWin32(void)" (??1WindowImplWin32@priv@sf@@UEAA@XZ)
1>sfml-window-s-d.lib(WindowImplWin32.cpp.obj) : error LNK2019: unresolved external symbol __imp_ChangeDisplaySettingsW referenced in function "private: void __cdecl sf::priv::WindowImplWin32::switchToFullscreen(class sf::VideoMode const &)" (?switchToFullscreen@WindowImplWin32@priv@sf@@AEAAXAEBVVideoMode@3@@Z)
1>sfml-window-s-d.lib(JoystickImpl.cpp.obj) : error LNK2019: unresolved external symbol __imp_RegCloseKey referenced in function "class sf::String __cdecl `anonymous namespace'::getDeviceName(unsigned int,struct tagJOYCAPSW)" (?getDeviceName@?A0x8939b4a8@@YA?AVString@sf@@IUtagJOYCAPSW@@@Z)
1>sfml-window-s-d.lib(JoystickImpl.cpp.obj) : error LNK2019: unresolved external symbol __imp_RegOpenKeyExW referenced in function "class sf::String __cdecl `anonymous namespace'::getDeviceName(unsigned int,struct tagJOYCAPSW)" (?getDeviceName@?A0x8939b4a8@@YA?AVString@sf@@IUtagJOYCAPSW@@@Z)
1>sfml-window-s-d.lib(JoystickImpl.cpp.obj) : error LNK2019: unresolved external symbol __imp_RegQueryValueExW referenced in function "class sf::String __cdecl `anonymous namespace'::getDeviceName(unsigned int,struct tagJOYCAPSW)" (?getDeviceName@?A0x8939b4a8@@YA?AVString@sf@@IUtagJOYCAPSW@@@Z)
1>sfml-audio-s-d.lib(SoundStream.cpp.obj) : error LNK2019: unresolved external symbol __imp_alSourcei referenced in function "private: void __cdecl sf::SoundStream::streamData(void)" (?streamData@SoundStream@sf@@AEAAXXZ)
1>sfml-audio-s-d.lib(SoundSource.cpp.obj) : error LNK2001: unresolved external symbol __imp_alSourcei
1>sfml-audio-s-d.lib(SoundStream.cpp.obj) : error LNK2019: unresolved external symbol __imp_alGetSourcef referenced in function "public: class sf::Time __cdecl sf::SoundStream::getPlayingOffset(void)const " (?getPlayingOffset@SoundStream@sf@@QEBA?AVTime@2@XZ)
1>sfml-audio-s-d.lib(SoundSource.cpp.obj) : error LNK2001: unresolved external symbol __imp_alGetSourcef
1>sfml-audio-s-d.lib(SoundStream.cpp.obj) : error LNK2019: unresolved external symbol __imp_alGetSourcei referenced in function "private: void __cdecl sf::SoundStream::streamData(void)" (?streamData@SoundStream@sf@@AEAAXXZ)
1>sfml-audio-s-d.lib(SoundSource.cpp.obj) : error LNK2001: unresolved external symbol __imp_alGetSourcei
1>sfml-audio-s-d.lib(SoundStream.cpp.obj) : error LNK2019: unresolved external symbol __imp_alSourcePlay referenced in function "public: virtual void __cdecl sf::SoundStream::play(void)" (?play@SoundStream@sf@@UEAAXXZ)
1>sfml-audio-s-d.lib(SoundStream.cpp.obj) : error LNK2019: unresolved external symbol __imp_alSourceStop referenced in function "private: void __cdecl sf::SoundStream::streamData(void)" (?streamData@SoundStream@sf@@AEAAXXZ)
1>sfml-audio-s-d.lib(SoundStream.cpp.obj) : error LNK2019: unresolved external symbol __imp_alSourcePause referenced in function "public: virtual void __cdecl sf::SoundStream::pause(void)" (?pause@SoundStream@sf@@UEAAXXZ)
1>sfml-audio-s-d.lib(SoundStream.cpp.obj) : error LNK2019: unresolved external symbol __imp_alSourceQueueBuffers referenced in function "private: bool __cdecl sf::SoundStream::fillAndPushBuffer(unsigned int,bool)" (?fillAndPushBuffer@SoundStream@sf@@AEAA_NI_N@Z)
1>sfml-audio-s-d.lib(SoundStream.cpp.obj) : error LNK2019: unresolved external symbol __imp_alSourceUnqueueBuffers referenced in function "private: void __cdecl sf::SoundStream::streamData(void)" (?streamData@SoundStream@sf@@AEAAXXZ)
1>sfml-audio-s-d.lib(SoundStream.cpp.obj) : error LNK2019: unresolved external symbol __imp_alGenBuffers referenced in function "private: void __cdecl sf::SoundStream::streamData(void)" (?streamData@SoundStream@sf@@AEAAXXZ)
1>sfml-audio-s-d.lib(SoundStream.cpp.obj) : error LNK2019: unresolved external symbol __imp_alDeleteBuffers referenced in function "private: void __cdecl sf::SoundStream::streamData(void)" (?streamData@SoundStream@sf@@AEAAXXZ)
1>sfml-audio-s-d.lib(SoundStream.cpp.obj) : error LNK2019: unresolved external symbol __imp_alBufferData referenced in function "private: bool __cdecl sf::SoundStream::fillAndPushBuffer(unsigned int,bool)" (?fillAndPushBuffer@SoundStream@sf@@AEAA_NI_N@Z)
1>sfml-audio-s-d.lib(SoundStream.cpp.obj) : error LNK2019: unresolved external symbol __imp_alGetBufferi referenced in function "private: void __cdecl sf::SoundStream::streamData(void)" (?streamData@SoundStream@sf@@AEAAXXZ)
1>sfml-audio-s-d.lib(SoundSource.cpp.obj) : error LNK2019: unresolved external symbol __imp_alGenSources referenced in function "public: __cdecl sf::SoundSource::SoundSource(class sf::SoundSource const &)" (??0SoundSource@sf@@QEAA@AEBV01@@Z)
1>sfml-audio-s-d.lib(SoundSource.cpp.obj) : error LNK2019: unresolved external symbol __imp_alDeleteSources referenced in function "public: virtual __cdecl sf::SoundSource::~SoundSource(void)" (??1SoundSource@sf@@UEAA@XZ)
1>sfml-audio-s-d.lib(SoundSource.cpp.obj) : error LNK2019: unresolved external symbol __imp_alSourcef referenced in function "public: void __cdecl sf::SoundSource::setPitch(float)" (?setPitch@SoundSource@sf@@QEAAXM@Z)
1>sfml-audio-s-d.lib(SoundSource.cpp.obj) : error LNK2019: unresolved external symbol __imp_alSource3f referenced in function "public: void __cdecl sf::SoundSource::setPosition(float,float,float)" (?setPosition@SoundSource@sf@@QEAAXMMM@Z)
1>sfml-audio-s-d.lib(SoundSource.cpp.obj) : error LNK2019: unresolved external symbol __imp_alGetSource3f referenced in function "public: class sf::Vector3<float> __cdecl sf::SoundSource::getPosition(void)const " (?getPosition@SoundSource@sf@@QEBA?AV?$Vector3@M@2@XZ)
1>sfml-audio-s-d.lib(AudioDevice.cpp.obj) : error LNK2019: unresolved external symbol __imp_alIsExtensionPresent referenced in function "public: static bool __cdecl sf::priv::AudioDevice::isExtensionSupported(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?isExtensionSupported@AudioDevice@priv@sf@@SA_NAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
1>sfml-audio-s-d.lib(AudioDevice.cpp.obj) : error LNK2019: unresolved external symbol __imp_alGetEnumValue referenced in function "public: static int __cdecl sf::priv::AudioDevice::getFormatFromChannelCount(unsigned int)" (?getFormatFromChannelCount@AudioDevice@priv@sf@@SAHI@Z)
1>sfml-audio-s-d.lib(AudioDevice.cpp.obj) : error LNK2019: unresolved external symbol __imp_alListenerf referenced in function "public: __cdecl sf::priv::AudioDevice::AudioDevice(void)" (??0AudioDevice@priv@sf@@QEAA@XZ)
1>sfml-audio-s-d.lib(AudioDevice.cpp.obj) : error LNK2019: unresolved external symbol __imp_alListener3f referenced in function "public: __cdecl sf::priv::AudioDevice::AudioDevice(void)" (??0AudioDevice@priv@sf@@QEAA@XZ)
1>sfml-audio-s-d.lib(AudioDevice.cpp.obj) : error LNK2019: unresolved external symbol __imp_alListenerfv referenced in function "public: __cdecl sf::priv::AudioDevice::AudioDevice(void)" (??0AudioDevice@priv@sf@@QEAA@XZ)
1>sfml-audio-s-d.lib(AudioDevice.cpp.obj) : error LNK2019: unresolved external symbol __imp_alcCreateContext referenced in function "public: __cdecl sf::priv::AudioDevice::AudioDevice(void)" (??0AudioDevice@priv@sf@@QEAA@XZ)
1>sfml-audio-s-d.lib(AudioDevice.cpp.obj) : error LNK2019: unresolved external symbol __imp_alcMakeContextCurrent referenced in function "public: __cdecl sf::priv::AudioDevice::AudioDevice(void)" (??0AudioDevice@priv@sf@@QEAA@XZ)
1>sfml-audio-s-d.lib(AudioDevice.cpp.obj) : error LNK2019: unresolved external symbol __imp_alcDestroyContext referenced in function "public: __cdecl sf::priv::AudioDevice::~AudioDevice(void)" (??1AudioDevice@priv@sf@@QEAA@XZ)
1>sfml-audio-s-d.lib(AudioDevice.cpp.obj) : error LNK2019: unresolved external symbol __imp_alcOpenDevice referenced in function "public: __cdecl sf::priv::AudioDevice::AudioDevice(void)" (??0AudioDevice@priv@sf@@QEAA@XZ)
1>sfml-audio-s-d.lib(AudioDevice.cpp.obj) : error LNK2019: unresolved external symbol __imp_alcCloseDevice referenced in function "public: __cdecl sf::priv::AudioDevice::~AudioDevice(void)" (??1AudioDevice@priv@sf@@QEAA@XZ)
1>sfml-audio-s-d.lib(AudioDevice.cpp.obj) : error LNK2019: unresolved external symbol __imp_alcIsExtensionPresent referenced in function "public: static bool __cdecl sf::priv::AudioDevice::isExtensionSupported(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?isExtensionSupported@AudioDevice@priv@sf@@SA_NAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
1>sfml-audio-s-d.lib(ALCheck.cpp.obj) : error LNK2019: unresolved external symbol __imp_alGetError referenced in function "void __cdecl sf::priv::alCheckError(char const *,unsigned int,char const *)" (?alCheckError@priv@sf@@YAXPEBDI0@Z)
1>..\bin\Debug\bake_snird.exe : fatal error LNK1120: 79 unresolved externals
1>Done building project "bake_snird.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10820
    • View Profile
    • development blog
    • Email
Re: Unable to statically link library using SMFL_STATIC - premake
« Reply #1 on: November 11, 2020, 01:41:45 pm »
You forgot to link OpenAL ;)

Also please use [code=none][/code] tags when posting code or logs
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

mohragk

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Unable to statically link library using SMFL_STATIC - premake
« Reply #2 on: November 11, 2020, 04:48:17 pm »
Ah that's it!

Might be useful to add a premake guide to the getting started section as it is very trivial to setup and works nicely with these types of projects.

 

anything