dearimgui / dear_bindings

C header (and language binding metadata) generator for Dear ImGui
MIT License
221 stars 12 forks source link

Full workflow #70

Open crystalthoughts opened 1 month ago

crystalthoughts commented 1 month ago

Hi - I'm repeatedly running into 'undefined symbol' errors and I'm not sure where I'm going wrong. I've dropped all of the source files into one of the example folders and run the equivalent of : zig cc main.c cimgui.cpp imgui*.cpp but it doesn't seem to work. I tried clang too.

Am I doing something dumb?

I think a slightly more comprehensive step-by-step would be really useful in the readme. This is one step between me creating an up to date binding in Nim, but its throwing the same error!

ShironekoBen commented 1 month ago

Hm... that depends on what backend you're trying, for starters - if it's anything except the null one then you'll likely need to include appropriate libraries for the graphics API/etc involved.

Does it work if you use the .vcproj file or Makefile in the appropriate example directory? Those have been tested on Windows/OSX/Ubuntu so on any of those it should "just work" (and I'd imagine most other Linux variants too, as they really don't do anything particularly unusual).

Aside from that, it's hard to say anything without some additional information:

1) What OS/machine are you using? 2) Which example directory are you using? 3) Which files did you copy in there? (or, well, what does the folder look like at the point you're trying to compile?) 4) What is the exact error message you get?

crystalthoughts commented 1 month ago

Hi thank for getting back - I managed to get things built using msbuild on Windows, by making sure imgui was a the sibling directory. I'm not sure what I was doing wrong the first time but I guess it was just a missing dep / link path as you say. I'll look at how the vs project is set up.

Once cimgui is built as a lib (or .dll once I get that working), I can compile a custom backend separately and call cimgui from that right?

ShironekoBen commented 1 month ago

Yes, you should be able to just link the ImGuiLib file that the VS project generates in your project and then do whatever you want to in terms of backend/user code - that's the approach the various examples all use.