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

unresolved external symbol #4237

Closed
androbytes opened this issue Jun 17, 2021 · 14 comments
Closed

unresolved external symbol #4237

androbytes opened this issue Jun 17, 2021 · 14 comments
Labels

Comments

@androbytes
Copy link

androbytes commented Jun 17, 2021

I keep getting this error I simply cannot fix!

imgui.obj : error LNK2019: unresolved external symbol "void __cdecl ImGui::ShowFontAtlas(struct ImFontAtlas *)" (?ShowFontAtlas@ImGui@@YAXPAUImFontAtlas@@@z) referenced in function "void __cdecl ImGui::ShowMetricsWindow(bool *)" (?ShowMetricsWindow@ImGui@@YAXPA_N@Z)

`
#include "GL/glew.h"
#include
//#include "ImGUI/imgui.h"
//#include "ImGUI/imgui_impl_glfw.h"
//#include "ImGUI/imgui_impl_opengl3.h"
#include "GLFW/glfw3.h"

using namespace std;

int main() {
GLFWwindow* window;

int h, w;

if (!glfwInit()) cout << "Error with initializing" << endl;

window = glfwCreateWindow(600, 500, "Acorn Engine", nullptr, nullptr);

glfwMakeContextCurrent(window);

GLenum err = glewInit();
if (GLEW_OK != err)
	fprintf(stderr, "Error %s\n", glewGetErrorString(err));

/*ImGui::CreateContext();
ImGui_ImplGlfw_InitForOpenGL(window, true);
ImGui_ImplOpenGL3_Init();
ImGui::StyleColorsDark();*/


while (!glfwWindowShouldClose(window)) {
	glfwGetWindowSize(window, &w, &h);
	//ImGui_ImplOpenGL3_NewFrame();

	/*Rendering*/
	glClear(GL_COLOR_BUFFER_BIT);

	//ImGui Rendering

	//ImGui::Text("Hello");

	//ImGui::Render();
	//ImGui_ImplOpenGL3_RenderDrawData(ImGui::GetDrawData());

	/*End of rendering*/

	glfwSwapBuffers(window);

	glfwPollEvents();
}

//ImGui Shutdown

//ImGui_ImplGlfw_Shutdown();
//ImGui_ImplOpenGL3_Shutdown();
//ImGui::DestroyContext();

//Glfw Shutdown
glfwDestroyWindow(window);
glfwTerminate();

}
`

I have also compiled everything.

Files

@PathogenDavid
Copy link
Contributor

PathogenDavid commented Jun 17, 2021

It looks like you're hitting #4171. The easiest solution is to add your beloved friend imgui_demo.cpp to your project.


As an aside, you can't use a single ` for blocks of code which span multiple lines, you have to use three of them like this:

```cpp
// ^__ It's technically optional, but putting a language name here will add syntax highlighting as well.
// Say hello:
printf("Hello, world!\n");
```

@androbytes
Copy link
Author

It worked! Thanks

@androbytes
Copy link
Author

Now it shows:

Exception thrown: write access violation.
g.CurrentWindow was nullptr.

@PathogenDavid
Copy link
Contributor

Compare against the examples and make sure your main loop has all the appropriate function calls. The code you showed above is missing quite a few things.

@androbytes
Copy link
Author

It works! Thanks

@androbytes
Copy link
Author

Is there any good dockable panel tutorial I could use?

@PathogenDavid
Copy link
Contributor

Do you mean just having dockable panels in general? Check out the experimental docking branch.

If you meant something else you'll have to clarify exactly what you're wanting to do.

@androbytes
Copy link
Author

How do you get the docking to work? I would like some example code and if I need any extra files i'd like a link to the download

@PathogenDavid
Copy link
Contributor

The official examples show off most of the core features.

For the most part, docking just works. If you're having trouble getting it to work in general, make sure you have it enabled. (And make sure it's enabled before you initialize the backends.)

There's an article about docking on the wiki.

You can browse docking-related issues using this GitHub issue filter. (This link is filtered to closed issues, but open issues might have interesting information as well.)

Otherwise I'm not really aware of any resources beyond the comments in the header files.

In general it's a lot easier to learn (and a lot easier for us to help you) if you have a specific goal in mind.

@PathogenDavid
Copy link
Contributor

Ah you just beat me.

How do you get the docking to work? I would like some example code and if I need any extra files i'd like a link to the download

Make sure you're using the docking branch. You can identify whether or not you have the docking code by looking for IMGUI_HAS_DOCK in imgui.h:

imgui/imgui.h

Line 69 in cce307a

#define IMGUI_HAS_DOCK // Docking WIP branch

From there, the only thing you really need to do is enable it as mentioned earlier.

@androbytes
Copy link
Author

Okay thanks.

@PathogenDavid
Copy link
Contributor

No problem, good luck!

@ocornut
Copy link
Owner

ocornut commented Jun 17, 2021

Hello, this is not a chat room and you are behaving like a help vampire.
Please be mindful to not abuse of the generous help David is providing by doing some researches on your side.
https://www.google.com/search?&q=help+vamprire

@androbytes
Copy link
Author

androbytes commented Jun 17, 2021

Sorry. My apologies

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

No branches or pull requests

3 participants