Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
vilinet opened this issue Dec 29, 2022 · 3 comments
Open

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

vilinet opened this issue Dec 29, 2022 · 3 comments

Comments

@vilinet
Copy link

vilinet commented Dec 29, 2022

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
Copy link

Any luck with that? @vilinet

@Rasmus-123
Copy link

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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants