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

Author Topic: SFML ImGUI unresolved external symbols errors  (Read 3778 times)

0 Members and 1 Guest are viewing this topic.

nicklowkc

  • Newbie
  • *
  • Posts: 2
    • View Profile
SFML ImGUI unresolved external symbols errors
« on: December 05, 2019, 06:46:02 am »
Hi, I am trying to implement ImGUI into my SFML project. However, I get 49 errors about unresolved external symbol. I have followed this link and have been searching for the solutions. At first, I thought that the problem would be not linking opengl32.lib. After linking with opengl32.lib I still get these errors. I am not sure which part I did wrong. Please help!!

I am using japanese version of visual studio 2017, the errors are the following:

重大度レベル      コード       説明  プロジェクト      ファイル    行     抑制状態
エラー       LNK2019 未解決の外部シンボル "__declspec(dllimport) public: float __cdecl sf::Time::asSeconds(void)const " (__imp_?asSeconds@Time@sf@@QEBAMXZ) が関数 "void __cdecl ImGui::SFML::Update(class sf::Vector2<int> const &,class sf::Vector2<float> const &,class sf::Time)" (?Update@SFML@ImGui@@YAXAEBV?$Vector2@H@sf@@AEBV?$Vector2@M@4@VTime@4@@Z) で参照されました。     Game    C:\Users\student\Desktop\SFML-2.5.1\projects\Game\Game\imgui-SFML.obj   1      
エラー       LNK2019 未解決の外部シンボル "__declspec(dllimport) public: __cdecl sf::String::String(void)" (__imp_??0String@sf@@QEAA@XZ) が関数 "public: static class sf::String __cdecl sf::String::fromUtf8<char const *>(char const *,char const *)" (??$fromUtf8@PEBD@String@sf@@SA?AV01@PEBD0@Z) で参照されました。       Game    C:\Users\student\Desktop\SFML-2.5.1\projects\Game\Game\imgui-SFML.obj   1      
エラー       LNK2019 未解決の外部シンボル "__declspec(dllimport) public: __cdecl sf::String::String(class sf::String const &)" (__imp_??0String@sf@@QEAA@AEBV01@@Z) が関数 "public: static class sf::String __cdecl sf::String::fromUtf8<char const *>(char const *,char const *)" (??$fromUtf8@PEBD@String@sf@@SA?AV01@PEBD0@Z) で参照されました。    Game    C:\Users\student\Desktop\SFML-2.5.1\projects\Game\Game\imgui-SFML.obj   1      
エラー       LNK2019 未解決の外部シンボル "__declspec(dllimport) public: class std::basic_string<unsigned char,struct std::char_traits<unsigned char>,class std::allocator<unsigned char> > __cdecl sf::String::toUtf8(void)const " (__imp_?toUtf8@String@sf@@QEBA?AV?$basic_string@EU?$char_traits@E@std@@V?$allocator@E@2@@std@@XZ) が関数 "char const * __cdecl `anonymous namespace'::getClipboadText(void *)" (?getClipboadText@?A0x3739eb0b@@YAPEBDPEAX@Z) で参照されました。    Game    C:\Users\student\Desktop\SFML-2.5.1\projects\Game\Game\imgui-SFML.obj   1      
エラー       LNK2019 未解決の外部シンボル "__declspec(dllimport) public: __cdecl sf::String::~String(void)" (__imp_??1String@sf@@QEAA@XZ) が関数 "public: static class sf::String __cdecl sf::String::fromUtf8<char const *>(char const *,char const *)" (??$fromUtf8@PEBD@String@sf@@SA?AV01@PEBD0@Z) で参照されました。      Game    C:\Users\student\Desktop\SFML-2.5.1\projects\Game\Game\imgui-SFML.obj   1      
エラー       LNK2001 外部シンボル ""__declspec(dllimport) public: __cdecl sf::String::~String(void)" (__imp_??1String@sf@@QEAA@XZ)" は未解決です。      Game    C:\Users\student\Desktop\SFML-2.5.1\projects\Game\Game\main.obj 1      
エラー       LNK2019 未解決の外部シンボル "__declspec(dllimport) public: static bool __cdecl sf::Joystick::isConnected(unsigned int)" (__imp_?isConnected@Joystick@sf@@SA_NI@Z) が関数 "unsigned int __cdecl `anonymous namespace'::getConnectedJoystickId(void)" (?getConnectedJoystickId@?A0x3739eb0b@@YAIXZ) で参照されました。     Game    C:\Users\student\Desktop\SFML-2.5.1\projects\Game\Game\imgui-SFML.obj   1      
エラー       LNK2019 未解決の外部シンボル "__declspec(dllimport) public: static bool __cdecl sf::Joystick::isButtonPressed(unsigned int,unsigned int)" (__imp_?isButtonPressed@Joystick@sf@@SA_NII@Z) が関数 "void __cdecl `anonymous namespace'::updateJoystickActionState(struct ImGuiIO &,enum ImGuiNavInput_)" (?updateJoystickActionState@?A0x3739eb0b@@YAXAEAUImGuiIO@@W4ImGuiNavInput_@@@Z) で参照されました。  Game    C:\Users\student\Desktop\SFML-2.5.1\projects\Game\Game\imgui-SFML.obj   1      
エラー       LNK2019 未解決の外部シンボル "__declspec(dllimport) public: static float __cdecl sf::Joystick::getAxisPosition(unsigned int,enum sf::Joystick::Axis)" (__imp_?getAxisPosition@Joystick@sf@@SAMIW4Axis@12@@Z) が関数 "void __cdecl `anonymous namespace'::updateJoystickDPadState(struct ImGuiIO &)" (?updateJoystickDPadState@?A0x3739eb0b@@YAXAEAUImGuiIO@@@Z) で参照されました。        Game    C:\Users\student\Desktop\SFML-2.5.1\projects\Game\Game\imgui-SFML.obj   1      
エラー       LNK2019 未解決の外部シンボル "__declspec(dllimport) public: void __cdecl sf::RenderTarget::resetGLStates(void)" (__imp_?resetGLStates@RenderTarget@sf@@QEAAXXZ) が関数 "void __cdecl ImGui::SFML::Render(class sf::RenderTarget &)" (?Render@SFML@ImGui@@YAXAEAVRenderTarget@sf@@@Z) で参照されました。   Game    C:\Users\student\Desktop\SFML-2.5.1\projects\Game\Game\imgui-SFML.obj   1      
エラー       LNK2019 未解決の外部シンボル "__declspec(dllimport) public: __cdecl sf::Cursor::Cursor(void)" (__imp_??0Cursor@sf@@QEAA@XZ) が関数 "void __cdecl `anonymous namespace'::loadMouseCursor(int,enum sf::Cursor::Type)" (?loadMouseCursor@?A0x3739eb0b@@YAXHW4Type@Cursor@sf@@@Z) で参照されました。  Game    C:\Users\student\Desktop\SFML-2.5.1\projects\Game\Game\imgui-SFML.obj   1      
エラー       LNK2019 未解決の外部シンボル "__declspec(dllimport) public: __cdecl sf::Cursor::~Cursor(void)" (__imp_??1Cursor@sf@@QEAA@XZ) が関数 "public: void * __cdecl sf::Cursor::`scalar deleting destructor'(unsigned int)" (??_GCursor@sf@@QEAAPEAXI@Z) で参照されました。       Game    C:\Users\student\Desktop\SFML-2.5.1\projects\Game\Game\imgui-SFML.obj   1      
エラー       LNK2019 未解決の外部シンボル "__declspec(dllimport) public: bool __cdecl sf::Cursor::loadFromSystem(enum sf::Cursor::Type)" (__imp_?loadFromSystem@Cursor@sf@@QEAA_NW4Type@12@@Z) が関数 "void __cdecl `anonymous namespace'::loadMouseCursor(int,enum sf::Cursor::Type)" (?loadMouseCursor@?A0x3739eb0b@@YAXHW4Type@Cursor@sf@@@Z) で参照されました。    Game    C:\Users\student\Desktop\SFML-2.5.1\projects\Game\Game\imgui-SFML.obj   1      
エラー       LNK2019 未解決の外部シンボル "__declspec(dllimport) public: void __cdecl sf::Window::setMouseCursorVisible(bool)" (__imp_?setMouseCursorVisible@Window@sf@@QEAAX_N@Z) が関数 "void __cdecl ImGui::SFML::Update(class sf::Window &,class sf::RenderTarget &,class sf::Time)" (?Update@SFML@ImGui@@YAXAEAVWindow@sf@@AEAVRenderTarget@4@VTime@4@@Z) で参照されました。      Game    C:\Users\student\Desktop\SFML-2.5.1\projects\Game\Game\imgui-SFML.obj   1      
エラー       LNK2019 未解決の外部シンボル "__declspec(dllimport) public: void __cdecl sf::Window::setMouseCursor(class sf::Cursor const &)" (__imp_?setMouseCursor@Window@sf@@QEAAXAEBVCursor@2@@Z) が関数 "void __cdecl `anonymous namespace'::updateMouseCursor(class sf::Window &)" (?updateMouseCursor@?A0x3739eb0b@@YAXAEAVWindow@sf@@@Z) で参照されました。      Game    C:\Users\student\Desktop\SFML-2.5.1\projects\Game\Game\imgui-SFML.obj   1      
エラー       LNK2019 未解決の外部シンボル "__declspec(dllimport) public: bool __cdecl sf::Window::hasFocus(void)const " (__imp_?hasFocus@Window@sf@@QEBA_NXZ) が関数 "void __cdecl ImGui::SFML::Init(class sf::Window &,class sf::Vector2<float> const &,bool)" (?Init@SFML@ImGui@@YAXAEAVWindow@sf@@AEBV?$Vector2@M@4@_N@Z) で参照されました。        Game    C:\Users\student\Desktop\SFML-2.5.1\projects\Game\Game\imgui-SFML.obj   1      
エラー       LNK2019 未解決の外部シンボル "__declspec(dllimport) public: class sf::Texture const * __cdecl sf::Sprite::getTexture(void)const " (__imp_?getTexture@Sprite@sf@@QEBAPEBVTexture@2@XZ) が関数 "void __cdecl ImGui::Image(class sf::Sprite const &,class sf::Vector2<float> const &,class sf::Color const &,class sf::Color const &)" (?Image@ImGui@@YAXAEBVSprite@sf@@AEBV?$Vector2@M@3@AEBVColor@3@2@Z) で参照されました。        Game    C:\Users\student\Desktop\SFML-2.5.1\projects\Game\Game\imgui-SFML.obj   1      
エラー       LNK2019 未解決の外部シンボル "__declspec(dllimport) public: class sf::Rect<int> const & __cdecl sf::Sprite::getTextureRect(void)const " (__imp_?getTextureRect@Sprite@sf@@QEBAAEBV?$Rect@H@2@XZ) が関数 "void __cdecl ImGui::Image(class sf::Sprite const &,class sf::Vector2<float> const &,class sf::Color const &,class sf::Color const &)" (?Image@ImGui@@YAXAEBVSprite@sf@@AEBV?$Vector2@M@3@AEBVColor@3@2@Z) で参照されました。     Game    C:\Users\student\Desktop\SFML-2.5.1\projects\Game\Game\imgui-SFML.obj   1      
エラー       LNK2019 未解決の外部シンボル "__declspec(dllimport) public: class sf::Rect<float> __cdecl sf::Sprite::getGlobalBounds(void)const " (__imp_?getGlobalBounds@Sprite@sf@@QEBA?AV?$Rect@M@2@XZ) が関数 "void __cdecl ImGui::Image(class sf::Sprite const &,class sf::Color const &,class sf::Color const &)" (?Image@ImGui@@YAXAEBVSprite@sf@@AEBVColor@3@1@Z) で参照されました。     Game    C:\Users\student\Desktop\SFML-2.5.1\projects\Game\Game\imgui-SFML.obj   1      
エラー       LNK2019 未解決の外部シンボル "__declspec(dllimport) public: __cdecl sf::Texture::Texture(void)" (__imp_??0Texture@sf@@QEAA@XZ) が関数 "void __cdecl ImGui::SFML::Init(class sf::Window &,class sf::Vector2<float> const &,bool)" (?Init@SFML@ImGui@@YAXAEAVWindow@sf@@AEBV?$Vector2@M@4@_N@Z) で参照されました。  Game    C:\Users\student\Desktop\SFML-2.5.1\projects\Game\Game\imgui-SFML.obj   1      
エラー       LNK2019 未解決の外部シンボル "__declspec(dllimport) public: __cdecl sf::Texture::~Texture(void)" (__imp_??1Texture@sf@@QEAA@XZ) が関数 "public: void * __cdecl sf::Texture::`scalar deleting destructor'(unsigned int)" (??_GTexture@sf@@QEAAPEAXI@Z) で参照されました。  Game    C:\Users\student\Desktop\SFML-2.5.1\projects\Game\Game\imgui-SFML.obj   1      
エラー       LNK2019 未解決の外部シンボル "__declspec(dllimport) public: bool __cdecl sf::Texture::create(unsigned int,unsigned int)" (__imp_?create@Texture@sf@@QEAA_NII@Z) が関数 "void __cdecl ImGui::SFML::UpdateFontTexture(void)" (?UpdateFontTexture@SFML@ImGui@@YAXXZ) で参照されました。      Game    C:\Users\student\Desktop\SFML-2.5.1\projects\Game\Game\imgui-SFML.obj   1      
エラー       LNK2019 未解決の外部シンボル "__declspec(dllimport) public: class sf::Vector2<unsigned int> __cdecl sf::Texture::getSize(void)const " (__imp_?getSize@Texture@sf@@QEBA?AV?$Vector2@I@2@XZ) が関数 "void __cdecl ImGui::Image(class sf::Texture const &,class sf::Vector2<float> const &,class sf::Rect<float> const &,class sf::Color const &,class sf::Color const &)" (?Image@ImGui@@YAXAEBVTexture@sf@@AEBV?$Vector2@M@3@AEBV?$Rect@M@3@AEBVColor@3@3@Z) で参照されました。    Game    C:\Users\student\Desktop\SFML-2.5.1\projects\Game\Game\imgui-SFML.obj   1      
エラー       LNK2019 未解決の外部シンボル "__declspec(dllimport) public: void __cdecl sf::Texture::update(unsigned char const *)" (__imp_?update@Texture@sf@@QEAAXPEBE@Z) が関数 "void __cdecl ImGui::SFML::UpdateFontTexture(void)" (?UpdateFontTexture@SFML@ImGui@@YAXXZ) で参照されました。 Game    C:\Users\student\Desktop\SFML-2.5.1\projects\Game\Game\imgui-SFML.obj   1      
エラー       LNK2019 未解決の外部シンボル "__declspec(dllimport) public: unsigned int __cdecl sf::Texture::getNativeHandle(void)const " (__imp_?getNativeHandle@Texture@sf@@QEBAIXZ) が関数 "void __cdecl ImGui::Image(class sf::Texture const &,class sf::Vector2<float> const &,class sf::Rect<float> const &,class sf::Color const &,class sf::Color const &)" (?Image@ImGui@@YAXAEBVTexture@sf@@AEBV?$Vector2@M@3@AEBV?$Rect@M@3@AEBVColor@3@3@Z) で参照されました。       Game    C:\Users\student\Desktop\SFML-2.5.1\projects\Game\Game\imgui-SFML.obj   1      
エラー       LNK2019 未解決の外部シンボル "__declspec(dllimport) public: static class sf::String __cdecl sf::Clipboard::getString(void)" (__imp_?getString@Clipboard@sf@@SA?AVString@2@XZ) が関数 "char const * __cdecl `anonymous namespace'::getClipboadText(void *)" (?getClipboadText@?A0x3739eb0b@@YAPEBDPEAX@Z) で参照されました。       Game    C:\Users\student\Desktop\SFML-2.5.1\projects\Game\Game\imgui-SFML.obj   1      
エラー       LNK2019 未解決の外部シンボル "__declspec(dllimport) public: static void __cdecl sf::Clipboard::setString(class sf::String const &)" (__imp_?setString@Clipboard@sf@@SAXAEBVString@2@@Z) が関数 "void __cdecl `anonymous namespace'::setClipboardText(void *,char const *)" (?setClipboardText@?A0x3739eb0b@@YAXPEAXPEBD@Z) で参照されました。     Game    C:\Users\student\Desktop\SFML-2.5.1\projects\Game\Game\imgui-SFML.obj   1      
エラー       LNK2019 未解決の外部シンボル "__declspec(dllimport) public: static bool __cdecl sf::Mouse::isButtonPressed(enum sf::Mouse::Button)" (__imp_?isButtonPressed@Mouse@sf@@SA_NW4Button@12@@Z) が関数 "void __cdecl ImGui::SFML::Update(class sf::Vector2<int> const &,class sf::Vector2<float> const &,class sf::Time)" (?Update@SFML@ImGui@@YAXAEBV?$Vector2@H@sf@@AEBV?$Vector2@M@4@VTime@4@@Z) で参照されました。  Game    C:\Users\student\Desktop\SFML-2.5.1\projects\Game\Game\imgui-SFML.obj   1      
エラー       LNK2019 未解決の外部シンボル "__declspec(dllimport) public: static class sf::Vector2<int> __cdecl sf::Mouse::getPosition(class sf::Window const &)" (__imp_?getPosition@Mouse@sf@@SA?AV?$Vector2@H@2@AEBVWindow@2@@Z) が関数 "void __cdecl ImGui::SFML::Update(class sf::Window &,class sf::RenderTarget &,class sf::Time)" (?Update@SFML@ImGui@@YAXAEAVWindow@sf@@AEAVRenderTarget@4@VTime@4@@Z) で参照されました。      Game    C:\Users\student\Desktop\SFML-2.5.1\projects\Game\Game\imgui-SFML.obj   1      
エラー       LNK2019 未解決の外部シンボル "__declspec(dllimport) public: static void __cdecl sf::Mouse::setPosition(class sf::Vector2<int> const &)" (__imp_?setPosition@Mouse@sf@@SAXAEBV?$Vector2@H@2@@Z) が関数 "void __cdecl ImGui::SFML::Update(class sf::Vector2<int> const &,class sf::Vector2<float> const &,class sf::Time)" (?Update@SFML@ImGui@@YAXAEBV?$Vector2@H@sf@@AEBV?$Vector2@M@4@VTime@4@@Z) で参照されました。     Game    C:\Users\student\Desktop\SFML-2.5.1\projects\Game\Game\imgui-SFML.obj   1      
エラー       LNK2019 未解決の外部シンボル "__declspec(dllimport) public: static bool __cdecl sf::Touch::isDown(unsigned int)" (__imp_?isDown@Touch@sf@@SA_NI@Z) が関数 "void __cdecl ImGui::SFML::Update(class sf::Window &,class sf::RenderTarget &,class sf::Time)" (?Update@SFML@ImGui@@YAXAEAVWindow@sf@@AEAVRenderTarget@4@VTime@4@@Z) で参照されました。 Game    C:\Users\student\Desktop\SFML-2.5.1\projects\Game\Game\imgui-SFML.obj   1      
エラー       LNK2019 未解決の外部シンボル "__declspec(dllimport) public: static class sf::Vector2<int> __cdecl sf::Touch::getPosition(unsigned int,class sf::Window const &)" (__imp_?getPosition@Touch@sf@@SA?AV?$Vector2@H@2@IAEBVWindow@2@@Z) が関数 "void __cdecl ImGui::SFML::Update(class sf::Window &,class sf::RenderTarget &,class sf::Time)" (?Update@SFML@ImGui@@YAXAEAVWindow@sf@@AEAVRenderTarget@4@VTime@4@@Z) で参照されました。        Game    C:\Users\student\Desktop\SFML-2.5.1\projects\Game\Game\imgui-SFML.obj   1      
エラー       LNK2019 未解決の外部シンボル "__declspec(dllimport) public: __cdecl sf::String::String(char const *,class std::locale const &)" (__imp_??0String@sf@@QEAA@PEBDAEBVlocale@std@@@Z) が関数 main で参照されました。  Game    C:\Users\student\Desktop\SFML-2.5.1\projects\Game\Game\main.obj 1      
エラー       LNK2019 未解決の外部シンボル "__declspec(dllimport) public: __cdecl sf::VideoMode::VideoMode(unsigned int,unsigned int,unsigned int)" (__imp_??0VideoMode@sf@@QEAA@III@Z) が関数 main で参照されました。  Game    C:\Users\student\Desktop\SFML-2.5.1\projects\Game\Game\main.obj 1      
エラー       LNK2019 未解決の外部シンボル "__declspec(dllimport) public: void __cdecl sf::Window::close(void)" (__imp_?close@Window@sf@@QEAAXXZ) が関数 main で参照されました。        Game    C:\Users\student\Desktop\SFML-2.5.1\projects\Game\Game\main.obj 1      
エラー       LNK2019 未解決の外部シンボル "__declspec(dllimport) public: bool __cdecl sf::Window::isOpen(void)const " (__imp_?isOpen@Window@sf@@QEBA_NXZ) が関数 main で参照されました。       Game    C:\Users\student\Desktop\SFML-2.5.1\projects\Game\Game\main.obj 1      
エラー       LNK2019 未解決の外部シンボル "__declspec(dllimport) public: bool __cdecl sf::Window::pollEvent(class sf::Event &)" (__imp_?pollEvent@Window@sf@@QEAA_NAEAVEvent@2@@Z) が関数 main で参照されました。      Game    C:\Users\student\Desktop\SFML-2.5.1\projects\Game\Game\main.obj 1      
エラー       LNK2019 未解決の外部シンボル "__declspec(dllimport) public: void __cdecl sf::Window::display(void)" (__imp_?display@Window@sf@@QEAAXXZ) が関数 main で参照されました。    Game    C:\Users\student\Desktop\SFML-2.5.1\projects\Game\Game\main.obj 1      
 

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10815
    • View Profile
    • development blog
    • Email
Re: SFML ImGUI unresolved external symbols errors
« Reply #1 on: December 05, 2019, 09:59:40 am »
You aren't linking SFML itself.

Are you trying to link statically and haven't defined SFML_STATIC?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

nicklowkc

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: SFML ImGUI unresolved external symbols errors
« Reply #2 on: December 06, 2019, 12:00:23 pm »
You aren't linking SFML itself.

Are you trying to link statically and haven't defined SFML_STATIC?

Hi eXpl0it3r, thank you for your reply.
No, i didn't define SFML_STATIC and i am not planning to use static library. Instead, i used dlls.
However, i got it running today and I don't know why. Is that I should link opengl32.lib after those sfml libs? Because in previous version I link opengl32.lib before those sfml libs.

 

anything