Imgui: unresolved external symbol

Created on 20 Aug 2016  路  4Comments  路  Source: ocornut/imgui

I'm tying to create an SDL2/OpenGL3 app with this library but whenever I compile my program i get these errors

1>IM_BINDING.obj : error LNK2019: unresolved external symbol "public: void __thiscall ImDrawData::ScaleClipRects(struct ImVec2 const &)" (?ScaleClipRects@ImDrawData@@QAEXABUImVec2@@@Z) referenced in function "void __cdecl ImGui_ImplSdlGL3_RenderDrawLists(struct ImDrawData *)" (?ImGui_ImplSdlGL3_RenderDrawLists@@YAXPAUImDrawData@@@Z) 1>IM_BINDING.obj : error LNK2019: unresolved external symbol "public: void __thiscall ImFontAtlas::GetTexDataAsRGBA32(unsigned char * *,int *,int *,int *)" (?GetTexDataAsRGBA32@ImFontAtlas@@QAEXPAPAEPAH11@Z) referenced in function "void __cdecl ImGui_ImplSdlGL3_CreateFontsTexture(void)" (?ImGui_ImplSdlGL3_CreateFontsTexture@@YAXXZ) 1>main.obj : error LNK2019: unresolved external symbol "public: void __thiscall ImDrawList::PushClipRect(struct ImVec2,struct ImVec2,bool)" (?PushClipRect@ImDrawList@@QAEXUImVec2@@0_N@Z) referenced in function "void __cdecl ImGui::PushClipRect(struct ImVec2 const &,struct ImVec2 const &,bool)" (?PushClipRect@ImGui@@YAXABUImVec2@@0_N@Z) 1>main.obj : error LNK2019: unresolved external symbol "public: void __thiscall ImDrawList::PushClipRectFullScreen(void)" (?PushClipRectFullScreen@ImDrawList@@QAEXXZ) referenced in function "void __cdecl ImGui::NewFrame(void)" (?NewFrame@ImGui@@YAXXZ) 1>main.obj : error LNK2019: unresolved external symbol "public: void __thiscall ImDrawList::PopClipRect(void)" (?PopClipRect@ImDrawList@@QAEXXZ) referenced in function "public: static void __cdeclvoid __cdecl ImGui::ShowMetricsWindow(bool _)'::5'::Funcs::NodeDrawList(struct ImDrawList *,char const *)" (?NodeDrawList@Funcs@?4??ShowMetricsWindow@ImGui@@YAXPA_N@Z@SAXPAUImDrawList@@PBD@Z) 1>main.obj : error LNK2019: unresolved external symbol "public: void __thiscall ImDrawList::PushTextureID(void \* const &)" (?PushTextureID@ImDrawList@@QAEXABQAX@Z) referenced in function "bool __cdecl ImGui::Begin(char const *,bool *,struct ImVec2 const &,float,int)" (?Begin@ImGui@@YA_NPBDPA_NABUImVec2@@MH@Z) 1>main.obj : error LNK2019: unresolved external symbol "public: void __thiscall ImDrawList::PopTextureID(void)" (?PopTextureID@ImDrawList@@QAEXXZ) referenced in function "void __cdecl ImGui::PopFont(void)" (?PopFont@ImGui@@YAXXZ) 1>main.obj : error LNK2019: unresolved external symbol "public: void __thiscall ImDrawList::AddLine(struct ImVec2 const &,struct ImVec2 const &,unsigned int,float)" (?AddLine@ImDrawList@@QAEXABUImVec2@@0IM@Z) referenced in function "bool __cdecl ImGui::Begin(char const *,bool *,struct ImVec2 const &,float,int)" (?Begin@ImGui@@YA_NPBDPA_NABUImVec2@@MH@Z) 1>main.obj : error LNK2019: unresolved external symbol "public: void __thiscall ImDrawList::AddRect(struct ImVec2 const &,struct ImVec2 const &,unsigned int,float,int,float)" (?AddRect@ImDrawList@@QAEXABUImVec2@@0IMHM@Z) referenced in function "bool __cdecl ImGui::Begin(char const *,bool *,struct ImVec2 const &,float,int)" (?Begin@ImGui@@YA_NPBDPA_NABUImVec2@@MH@Z) 1>main.obj : error LNK2019: unresolved external symbol "public: void __thiscall ImDrawList::AddRectFilled(struct ImVec2 const &,struct ImVec2 const &,unsigned int,float,int)" (?AddRectFilled@ImDrawList@@QAEXABUImVec2@@0IMH@Z) referenced in function "bool __cdecl ImGui::Begin(char const *,bool *,struct ImVec2 const &,float,int)" (?Begin@ImGui@@YA_NPBDPA_NABUImVec2@@MH@Z) 1>main.obj : error LNK2019: unresolved external symbol "public: void __thiscall ImDrawList::AddTriangleFilled(struct ImVec2 const &,struct ImVec2 const &,struct ImVec2 const &,unsigned int)" (?AddTriangleFilled@ImDrawList@@QAEXABUImVec2@@00I@Z) referenced in function "void __cdecl ImGui::RenderCollapseTriangle(struct ImVec2,bool,float,bool)" (?RenderCollapseTriangle@ImGui@@YAXUImVec2@@_NM1@Z) 1>main.obj : error LNK2019: unresolved external symbol "public: void __thiscall ImDrawList::AddCircle(struct ImVec2 const &,float,unsigned int,int,float)" (?AddCircle@ImDrawList@@QAEXABUImVec2@@MIHM@Z) referenced in function "bool __cdecl ImGui::RadioButton(char const *,bool)" (?RadioButton@ImGui@@YA_NPBD_N@Z) 1>main.obj : error LNK2019: unresolved external symbol "public: void __thiscall ImDrawList::AddCircleFilled(struct ImVec2 const &,float,unsigned int,int)" (?AddCircleFilled@ImDrawList@@QAEXABUImVec2@@MIH@Z) referenced in function "bool __cdecl ImGui::CloseButton(unsigned int,struct ImVec2 const &,float)" (?CloseButton@ImGui@@YA_NIABUImVec2@@M@Z) 1>main.obj : error LNK2019: unresolved external symbol "public: void __thiscall ImDrawList::AddText(struct ImFont const *,float,struct ImVec2 const &,unsigned int,char const *,char const *,float,struct ImVec4 const *)" (?AddText@ImDrawList@@QAEXPBUImFont@@MABUImVec2@@IPBD2MPBUImVec4@@@Z) referenced in function "bool __cdecl ImGui::InputTextEx(char const *,char *,int,struct ImVec2 const &,int,int (__cdecl_)(struct ImGuiTextEditCallbackData _),void *)" (?InputTextEx@ImGui@@YA_NPBDPADHABUImVec2@@HP6AHPAUImGuiTextEditCallbackData@@@ZPAX@Z) 1>main.obj : error LNK2019: unresolved external symbol "public: void __thiscall ImDrawList::AddImage(void *,struct ImVec2 const &,struct ImVec2 const &,struct ImVec2 const &,struct ImVec2 const &,unsigned int)" (?AddImage@ImDrawList@@QAEXPAXABUImVec2@@111I@Z) referenced in function "void __cdecl ImGui::Image(void *,struct ImVec2 const &,struct ImVec2 const &,struct ImVec2 const &,struct ImVec4 const &,struct ImVec4 const &)" (?Image@ImGui@@YAXPAXABUImVec2@@11ABUImVec4@@2@Z) 1>main.obj : error LNK2019: unresolved external symbol "public: void __thiscall ImDrawList::AddPolyline(struct ImVec2 const *,int,unsigned int,bool,float,bool)" (?AddPolyline@ImDrawList@@QAEXPBUImVec2@@HI_NM1@Z) referenced in function "public: static void __cdeclvoid __cdecl ImGui::ShowMetricsWindow(bool *)'::5'::Funcs::NodeDrawList(struct ImDrawList *,char const *)" (?NodeDrawList@Funcs@?4??ShowMetricsWindow@ImGui@@YAXPA_N@Z@SAXPAUImDrawList@@PBD@Z) 1>main.obj : error LNK2019: unresolved external symbol "public: void __thiscall ImDrawList::AddConvexPolyFilled(struct ImVec2 const *,int,unsigned int,bool)" (?AddConvexPolyFilled@ImDrawList@@QAEXPBUImVec2@@HI_N@Z) referenced in function "public: void __thiscall ImDrawList::PathFill(unsigned int)" (?PathFill@ImDrawList@@QAEXI@Z) 1>main.obj : error LNK2019: unresolved external symbol "public: void __thiscall ImDrawList::PathArcToFast(struct ImVec2 const &,float,int,int)" (?PathArcToFast@ImDrawList@@QAEXABUImVec2@@MHH@Z) referenced in function "bool __cdecl ImGui::Begin(char const *,bool *,struct ImVec2 const &,float,int)" (?Begin@ImGui@@YA_NPBDPA_NABUImVec2@@MH@Z) 1>main.obj : error LNK2019: unresolved external symbol "public: void __thiscall ImDrawList::ChannelsSplit(int)" (?ChannelsSplit@ImDrawList@@QAEXH@Z) referenced in function "void __cdecl ImGui::Columns(int,char const *,bool)" (?Columns@ImGui@@YAXHPBD_N@Z) 1>main.obj : error LNK2019: unresolved external symbol "public: void __thiscall ImDrawList::ChannelsMerge(void)" (?ChannelsMerge@ImDrawList@@QAEXXZ) referenced in function "void __cdecl ImGui::Columns(int,char const *,bool)" (?Columns@ImGui@@YAXHPBD_N@Z) 1>main.obj : error LNK2019: unresolved external symbol "public: void __thiscall ImDrawList::ChannelsSetCurrent(int)" (?ChannelsSetCurrent@ImDrawList@@QAEXH@Z) referenced in function "void __cdecl ImGui::NextColumn(void)" (?NextColumn@ImGui@@YAXXZ) 1>main.obj : error LNK2019: unresolved external symbol "public: void __thiscall ImDrawList::Clear(void)" (?Clear@ImDrawList@@QAEXXZ) referenced in function "public: __thiscall ImDrawList::ImDrawList(void)" (??0ImDrawList@@QAE@XZ) 1>main.obj : error LNK2019: unresolved external symbol "public: void __thiscall ImDrawList::ClearFreeMemory(void)" (?ClearFreeMemory@ImDrawList@@QAEXXZ) referenced in function "public: __thiscall ImDrawList::~ImDrawList(void)" (??1ImDrawList@@QAE@XZ) 1>main.obj : error LNK2019: unresolved external symbol "public: __thiscall ImFontAtlas::ImFontAtlas(void)" (??0ImFontAtlas@@QAE@XZ) referenced in function "void __cdecldynamic initializer for 'GImDefaultFontAtlas''(void)" (??__EGImDefaultFontAtlas@@YAXXZ)
1>main.obj : error LNK2019: unresolved external symbol "public: __thiscall ImFontAtlas::~ImFontAtlas(void)" (??1ImFontAtlas@@QAE@XZ) referenced in function "void __cdecldynamic atexit destructor for 'GImDefaultFontAtlas''(void)" (??__FGImDefaultFontAtlas@@YAXXZ) 1>main.obj : error LNK2019: unresolved external symbol "public: void __thiscall ImFontAtlas::Clear(void)" (?Clear@ImFontAtlas@@QAEXXZ) referenced in function "void __cdecl ImGui::Shutdown(void)" (?Shutdown@ImGui@@YAXXZ) 1>main.obj : error LNK2019: unresolved external symbol "public: __thiscall ImFont::ImFont(void)" (??0ImFont@@QAE@XZ) referenced in function "public: __thiscall ImGuiContext::ImGuiContext(void)" (??0ImGuiContext@@QAE@XZ) 1>main.obj : error LNK2019: unresolved external symbol "public: __thiscall ImFont::~ImFont(void)" (??1ImFont@@QAE@XZ) referenced in function __unwindfunclet$??0ImGuiContext@@QAE@XZ$12 1>main.obj : error LNK2019: unresolved external symbol "public: struct ImFont::Glyph const \* __thiscall ImFont::FindGlyph(unsigned short)const " (?FindGlyph@ImFont@@QBEPBUGlyph@1@G@Z) referenced in function "bool __cdecl ImGui::InputTextEx(char const *,char *,int,struct ImVec2 const &,int,int (__cdecl_)(struct ImGuiTextEditCallbackData *),void *)" (?InputTextEx@ImGui@@YA_NPBDPADHABUImVec2@@HP6AHPAUImGuiTextEditCallbackData@@@ZPAX@Z) 1>main.obj : error LNK2019: unresolved external symbol "public: struct ImVec2 __thiscall ImFont::CalcTextSizeA(float,float,float,char const *,char const *,char const \* *)const " (?CalcTextSizeA@ImFont@@QBE?AUImVec2@@MMMPBD0PAPBD@Z) referenced in function "struct ImVec2 __cdecl ImGui::CalcTextSize(char const *,char const *,bool,float)" (?CalcTextSize@ImGui@@YA?AUImVec2@@PBD0_NM@Z) 1>gl3w.lib(gl3w.obj) : error LNK2019: unresolved external symbol __imp__wglGetProcAddress@4 referenced in function _get_proc

I've included "imgui.h" in my main.cpp and i used the implemation from the SDL2 Opengl3 example.

All 4 comments

Fixed it sorry about that.

How did you fixed it?? I have the same problem!

I don't remember exactly how I fixed it but I think it was because I tried linking it as an external project rather than including them directly in my project.

fixed it :D
missed a cpp that contains the definitions, imgui_draw.cpp more precisely

Was this page helpful?
0 / 5 - 0 ratings