SFML/imgui-sfml

unresolved external symbol "public: static char * ImGuiTextBuffer::EmptyString

RichardDally opened this issue · 1 comments

Hello,

I stumbled upon this link error, not sure if it comes from my configuration or code itself.

Environment:

  • Windows 10
  • Visual Studio 2019
  • x64
  • Release & Debug

So far I tried:

  • imgui: master, v1.77, v1.76
  • imgui-sfml: master, v2.1, v2.0.2
C:\Repositories\imgui-sfml>mkdir build && cd build

C:\Repositories\imgui-sfml\build>cmake .. -DIMGUI_DIR=C:\Repositories\imgui -DSFML_DIR=C:\Repositories\SFML\build -DBUILD_SHARED_LIBS=ON -DIMGUI_SFML_BUILD_EXAMPLES=ON -DCMAKE_INSTALL_PREFIX=C:\Repositories\imgui-sfml\install
-- Building for: Visual Studio 16 2019
-- The CXX compiler identification is MSVC 19.27.29111.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional/VC/Tools/MSVC/14.27.29110/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found SFML 2.5.1 in C:/Repositories/SFML/build
-- Found ImGui v1.76 in C:/Repositories/imgui
-- Found OpenGL: opengl32
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Repositories/imgui-sfml/build

C:\Repositories\imgui-sfml\build>cmake --build . --target install
Microsoft (R) Build Engine version 16.7.0+b89cb5fde for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

  Checking Build System
  Building Custom Rule C:/Repositories/imgui-sfml/CMakeLists.txt
  imgui-SFML.cpp
  imgui.cpp
  imgui_draw.cpp
  imgui_widgets.cpp
  imgui_stdlib.cpp
  Generating Code...
     Creating library C:/Repositories/imgui-sfml/build/Debug/ImGui-SFML.lib and object C:/Repositories/imgui-sfml/build
  /Debug/ImGui-SFML.exp
  ImGui-SFML.vcxproj -> C:\Repositories\imgui-sfml\build\Debug\ImGui-SFML.dll
  Building Custom Rule C:/Repositories/imgui-sfml/examples/CMakeLists.txt
  main.cpp
  imgui_demo.cpp
  Generating Code...
imgui_demo.obj : error LNK2001: unresolved external symbol "public: static char * ImGuiTextBuffer::EmptyString" (?Empty
String@ImGuiTextBuffer@@2PADA) [C:\Repositories\imgui-sfml\build\examples\imgui_sfml_example.vcxproj]
C:\Repositories\imgui-sfml\build\examples\Debug\imgui_sfml_example.exe : fatal error LNK1120: 1 unresolved externals [C
:\Repositories\imgui-sfml\build\examples\imgui_sfml_example.vcxproj]

C:\Repositories\imgui-sfml\build>

Any idea ?

Looks like this has been fixed here: ocornut/imgui@ea79992
So try using 1.78, it was ImGui's problem, not ImGui-SFML's problem.