mirror of
https://github.com/ocornut/imgui.git
synced 2026-11-16 19:11:13 +00:00
Help with compiler linkin #4328
Labels
No labels
accidentally closed
android
backends
bug
building
clipper
coloredit
color spaces
cplusplus
data types
demo
disabled
doc
docking
dpi
drag drop
drawing/drawlist
dropped
dx12
enhancement
focus
font/text
gallery
help wanted
idle/power saving
ime
in progress
inputs
inputtext
internals
label/id and id stack
language bindings
layout
linux/bsd
menus
multi-contexts
multi-threading
multi-viewports
nav
news/info
opengl
optimization
osx/ios
overlap
plot/graph
popups
question
scrolling
selection
settings
sliders/drags
style
tables/columns
tabs
test wanted
tools
tooltips
tree
tricks & tips
useful widgets
vulkan
web
window pos/depth
window sizing
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
ocornut/imgui#4328
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Version/Branch of Dear ImGui:
Version: 1.83
Branch: docking
Back-end/Renderer/Compiler/OS
Windows 10
Microsoft Visual Studio Community 2019
Windows SDK: 10.0.18362.0
Platform toolset: v142
C++ standard: C++17
C: C17
My Issue/Question:

I was using it before to display debug info with dx9 window overlaying game window. Now I decided to go fancy and use newer docking version.
But it doesn't seem to be linking properly. It looks like newer stuff isn't linked. I can click stuff and it takes me right to the imgui.cpp to the proper function. But compiler says not found.
TL;DR: Possible fixes are at the bottom of this comment.
In your case, you're getting a lot of LNK2001 errors. This is the linker telling you, "You've used this function, but I can't find its definition".
I'm going to clear up a misconception here:
That's a header file in your screenshot, not a source file as you thought.
A header file, which has the extension
.hor (less commonly).hpp, contains the function name, return type, and parameters. This is known as its signature. After the signature, there's just a semicolon. This is what we're seeing in your screenshot.A source file, which has the extension
.cpp, reiterates the function signature, but it also adds the function body, enclosed in{and}. This is the function's definition.For example, take this sample header file:
What would you say if I were to ask you, "What would happen if we were to call
int x = myFunction();? What wouldxbe?"Of course, you wouldn't be able to answer properly because you don't know what's inside of the function, you only know that it exists and returns some unspecified int. By defining it in another source file, it becomes clear what the function does:
This is what's happening when you get LNK2001 or LNK2019. In your screenshot, we're asking MSVC "What would happen if we called
ImGui::EndColumns()?" but we didn't provide the source file that it's defined in; we only provided the header file shown in your screenshot. This causes the linker to fail.There are several possible fixes to this issue:
.cppfiles are listed..vsdirectory (it's hidden), and also the build outputs:Debug,Release, andx64if any of them exist.Given your three visible errors, the problematic files are
imgui_tables.cppandimgui_widgets.cppwhere those unresolved functions are defined. There may be more, however, since there's 56 other errors.I found out 2 things, first I forgot to add "mgui_tables.cpp and imgui_widgets.cpp"..... All solved