tangrams / tangram-es

2D and 3D map renderer using OpenGL ES
MIT License
821 stars 238 forks source link

Compilation error when trying to build it for Windows platform #2337

Open vilinet opened 1 year ago

vilinet commented 1 year ago

TO REPRODUCE THE ISSUE, FOLLOW THESE STEPS:

RESULT: Compilation starts, all good until it tries to link the demo app where it has glfw related linking errors.

First error:

C:\REPOS\tangram-es\platforms\common\glfwApp.cpp(702,24): error C2664: 'bool ImGui::InputFloat2(const char *,float [],const char * ,ImGuiInputTextFlags)': cannot convert argument 3 from 'int' to 'const char *' [C:\REPOS\tangram-es\build\tangram.vcxproj]'

Once i comment out the usages of the InputFloat2, i see the following errors: glfwApp.obj : error LNK2019: unresolved external symbol "bool __cdecl ImGui::SliderAngle(char const *,float *,float,float,char con st *,int)" (?SliderAngle@ImGui@@YA_NPEBDPEAMMM0H@Z) referenced in function "void __cdecl Tangram::GlfwApp::showViewportGUI(void)" (?showViewportGUI@GlfwApp@Tangram@@YAXXZ) [C:\REPOS\tangram-es\build\tangram.vcxproj] glfwApp.obj : error LNK2019: unresolved external symbol "bool __cdecl ImGui::DebugCheckVersionAndDataLayout(char const *,unsigned __int64,unsigned __int64,unsigned __int64,unsigned __int64,unsigned __int64,unsigned __int64)" (?DebugCheckVersionAndDataLayout@Im Gui@@YA_NPEBD_K11111@Z) referenced in function "void __cdecl Tangram::GlfwApp::create(class std::unique_ptr<class Tangram::Platfor m,struct std::default_delete<class Tangram::Platform> >,int,int)" (?create@GlfwApp@Tangram@@YAXV?$unique_ptr@VPlatform@Tangram@@U? $default_delete@VPlatform@Tangram@@@std@@@std@@HH@Z) [C:\REPOS\tangram-es\build\tangram.vcxproj] imgui_impl_glfw.obj : error LNK2019: unresolved external symbol "public: void __cdecl ImGuiIO::AddInputCharacter(unsigned int)" (? AddInputCharacter@ImGuiIO@@QEAAXI@Z) referenced in function "void __cdecl ImGui_ImplGlfw_CharCallback(struct GLFWwindow *,unsigned int)" (?ImGui_ImplGlfw_CharCallback@@YAXPEAUGLFWwindow@@I@Z) [C:\REPOS\tangram-es\build\tangram.vcxproj] C:\REPOS\tangram-es\build\Debug\tangram.exe : fatal error LNK1120: 3 unresolved externals [C:\REPOS\tangram-es\build\tangram.vcxpr oj]

ENVIRONMENT:

Windows 10 22H2, VS 2019

OTHER:

It seems glfw( and other libs ) got updated and broke the windows demo?

RomanKapl commented 1 year ago

Any luck with that? @vilinet

Rasmus-123 commented 10 months ago

I have the same issue on Linux (Ubuntu 22.04).

tangram-es/platforms/common/glfwApp.cpp: In function ‘void Tangram::GlfwApp::showMarkerGUI()’:
tangram-es/platforms/common/glfwApp.cpp:702:79: error: invalid conversion from ‘int’ to ‘const char*’ [-fpermissive]
  702 |                 ImGui::InputFloat2("Last Marker Screen", screenPositionFloat, 5, ImGuiInputTextFlags_ReadOnly);
      |                                                                               ^
      |                                                                               |
      |                                                                               int
In file included from tangram-es/platforms/common/glfwApp.cpp:2:
tangram-es/build/linux/vcpkg_installed/x64-linux/lib/pkgconfig/../../include/imgui.h:592:84: note:   initializing argument 3 of ‘bool ImGui::InputFloat2(const char*, float*, const char*, ImGuiInputTextFlags)’
  592 |     IMGUI_API bool          InputFloat2(const char* label, float v[2], const char* format = "%.3f", ImGuiInputTextFlags flags = 0);
      |                                                                        ~~~~~~~~~~~~^~~~~~~~~~~~~~~
tangram-es/platforms/common/glfwApp.cpp:706:79: error: invalid conversion from ‘int’ to ‘const char*’ [-fpermissive]
  706 |                 ImGui::InputFloat2("Last Marker Clipped", screenClippedFloat, 5, ImGuiInputTextFlags_ReadOnly);
      |                                                                               ^
      |                                                                               |
      |                                                                               int
tangram-es/platforms/common/glfwApp.cpp:2:
tangram-es/build/linux/vcpkg_installed/x64-linux/lib/pkgconfig/../../include/imgui.h:592:84: note:   initializing argument 3 of ‘bool ImGui::InputFloat2(const char*, float*, const char*, ImGuiInputTextFlags)’
  592 |     IMGUI_API bool          InputFloat2(const char* label, float v[2], const char* format = "%.3f", ImGuiInputTextFlags flags = 0);
      |
JackeyLea commented 8 months ago

vcpkg.json里面的imgui版本高于源码中的版本,把vcpkg.json里面的删除就可以了。