Skip to content

Commit

Permalink
imgui link error
Browse files Browse the repository at this point in the history
  • Loading branch information
Katzeee committed Mar 25, 2024
1 parent aa9d7f3 commit 48411d9
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions _posts/C-Cpp/2024-03-25-imgui-link-error-on-windows.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
= Imgui Link Error On Windows
:revdate: 2024-03-25
:page-category: C-Cpp
:page-tags: [cpp, windows]

When compiling nanoR, I got an error on Windows: *unresolved external symbol "bool __cdecl ImGui_ImplGlfw_InitForOpenGL(class GLFWwindow *,bool)*

```text
[build] context.cpp.obj : error LNK2019: unresolved external symbol "public: void __cdecl xac::ImguiLayer::Init(struct GLFWwindow *)" (?Init@ImguiLayer@xac@@QEAAXPEAUGLFWwindow@@@Z) referenced in function "public: void __cdecl xac::GlobalContext::Init(void)" (?Init@GlobalContext@xac@@QEAAXXZ)
[build] imgui_layer.cpp.obj : error LNK2019: unresolved external symbol "bool __cdecl ImGui_ImplGlfw_InitForOpenGL(class GLFWwindow *,bool)" (?ImGui_ImplGlfw_InitForOpenGL@@YA_NPEAVGLFWwindow@@_N@Z) referenced in function "public: void __cdecl xac::ImguiLayer::Init(class GLFWwindow *)" (?Init@ImguiLayer@xac@@QEAAXPEAVGLFWwindow@@@Z)
[build] Hint on symbols that are defined and could potentially match:
[build] "bool __cdecl ImGui_ImplGlfw_InitForOpenGL(struct GLFWwindow *,bool)" (?ImGui_ImplGlfw_InitForOpenGL@@YA_NPEAUGLFWwindow@@_N@Z)
```
It occurs because I declared `GLFWwindow` as `class` not `struct` in header file.

0 comments on commit 48411d9

Please sign in to comment.