I am attempting to build ImGui for C using the DearBindings generator. My CMake is shown below.

# Create the CImGui library add_library(CImGui ${GENERATED_DIR}/cimgui.cpp ${imgui_SOURCE_DIR}/imgui.cpp ${imgui_SOURCE_DIR}/imgui_draw.cpp ${imgui_SOURCE_DIR}/imgui_tables.cpp ${imgui_SOURCE_DIR}/imgui_widgets.cpp ${imgui_SOURCE_DIR}/imgui_demo.cpp ) set_target_properties(CImGui PROPERTIES LINKER_LANGUAGE CXX) target_include_directories(CImGui PUBLIC ${GENERATED_DIR} ${imgui_SOURCE_DIR} ) # Create the vendor interface add_library(vendor INTERFACE) target_link_libraries(vendor INTERFACE SDL3::SDL3 CImGui )

This resulted the following error:

error: using typedef-name ‘ImDrawListSharedData’ after ‘struct’ note: ‘ImDrawListSharedData’ has a previous declaration here

I saw the previous declaration error and assumed I just needed to make the imgui sources private to avoid conflicts. I tried the following next.

target_include_directories(CImGui PUBLIC ${GENERATED_DIR} PRIVATE ${imgui_SOURCE_DIR} )

This resulted in the error imconfig.h: No such file or directory . What am I missing in this that allows my library to both see the ImGui sources and avoid re-declaring existing structs?

Tristan Moda's user avatar

New contributor

Tristan Moda is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

4

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.