Skip to content

Commenting out viewer.launch() causes linker errors with imgui/glad (no imgui/glad functions called) #33

@olkido

Description

@olkido

I tried to build a libigil-based project by extending this example. The first thing I tried to do is add an imgui window pane/ menu. I noticed that simply adding the relevant includes and declaring a menu causes the project to not build unless there is an "active" call to viewer.launch() present in the main.cpp code. If the viewer is not launched (for example by commenting the viewer.launch() line out or adding a return() before it -- see the attached main.cpp), I get linker errors due to (it seems) glad.c not having been included among the source files.
I found this very odd (why would simply commenting out viewer.launch() cause linker errors without any functions from imgui/glad being called) so I thought I would share. Is this a known phenomenon?
I am using Xcode 13 (example project built via cmake 3.20.1) . Attaching pictures of my main.cpp and the build log.
Screenshot 2021-10-19 at 17 49 13
Screenshot 2021-10-19 at 17 51 33

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions