how imgui_impl_OpenGL3.cpp can introduce gl3w.h #3860

Closed
opened 2021-03-02 07:21:45 +00:00 by Corezcy · 5 comments
Corezcy commented 2021-03-02 07:21:45 +00:00 (Migrated from github.com)

Version/Branch of Dear ImGui:

Version: 1.81
Branch: master

Back-end/Renderer/Compiler/OS

Back-ends: imgui_impl_OpenGL3.cpp + imgui_impl_glfw.cpp _
Compiler: bazel VScode
Operating System: Ubuntu 18.04.5 LTS

My Issue/Question:

Someting like #3507, when I try to use imgui_impl_OpenGL3.cpp to introduce gl3w.h and gl3w.c, imgui_impl_OpenGL3.cpp always link to GL/glew, how to fix it ?
Code
here is code I package imgui

load("@rules_cc//cc:defs.bzl", "cc_library")

package(default_visibility = ["//visibility:public"])

cc_library(
    name = "imgui",
    srcs = [
        "GL/gl3w.c",
        "imgui.cpp",
        "imgui_demo.cpp",
        "imgui_draw.cpp",
        "imgui_impl_glfw.cpp",
        "imgui_impl_opengl3.cpp",
        "imgui_stdlib.cpp",
        "imgui_tables.cpp",
        "imgui_widgets.cpp",
    ],
    hdrs = [
        "GL/gl3w.h",
        "GL/glcorearb.h",
        "imconfig.h",
        "imgui.h",
        "imgui_impl_glfw.h",
        "imgui_impl_opengl3.h",
        "imgui_internal.h",
        "imgui_stdlib.h",
        "imstb_rectpack.h",
        "imstb_textedit.h",
        "imstb_truetype.h",
    ],
    includes = [
        ".",
        "GL/",
    ],
    linkopts = [
        "-ldl",
        "-lm",
        "-lGL",
        "-lGLEW",
        "-lGLU",
        "-lX11",
        "-lXi",
        "-lXrandr",
        "-lXxf86vm",
        "-lXinerama",
        "-lXcursor",
    ],
    deps = ["@glfw"],
)

here is the structure of my code, which imgui belongs

.
├── BUILD
├── CMakeLists.txt
├── GL
│   ├── CMakeLists.txt
│   ├── gl3w.c
│   ├── gl3w.h
│   └── glcorearb.h
├── imconfig.h
├── imgui.cpp
├── imgui_demo.cpp
├── imgui_draw.cpp
├── imgui.h
├── imgui_impl_glfw.cpp
├── imgui_impl_glfw.h
├── imgui_impl_opengl3.cpp
├── imgui_impl_opengl3.h
├── imgui_internal.h
├── imgui_stdlib.cpp
├── imgui_stdlib.h
├── imgui_tables.cpp
├── imgui_widgets.cpp
├── imstb_rectpack.h
├── imstb_textedit.h
└── imstb_truetype.h

error report

bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_SetupRenderState(ImDrawData*, int, int, unsigned int): error: undefined reference to '__glewBlendEquation'
bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_SetupRenderState(ImDrawData*, int, int, unsigned int): error: undefined reference to '__glewUseProgram'
bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_SetupRenderState(ImDrawData*, int, int, unsigned int): error: undefined reference to '__glewUniform1i'
bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_SetupRenderState(ImDrawData*, int, int, unsigned int): error: undefined reference to '__glewUniformMatrix4fv'
bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_SetupRenderState(ImDrawData*, int, int, unsigned int): error: undefined reference to '__glewBindSampler'
bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_SetupRenderState(ImDrawData*, int, int, unsigned int): error: undefined reference to '__glewBindVertexArray'
bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_SetupRenderState(ImDrawData*, int, int, unsigned int): error: undefined reference to '__glewBindBuffer'
bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_SetupRenderState(ImDrawData*, int, int, unsigned int): error: undefined reference to '__glewBindBuffer'
bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_SetupRenderState(ImDrawData*, int, int, unsigned int): error: undefined reference to '__glewEnableVertexAttribArray'
bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_SetupRenderState(ImDrawData*, int, int, unsigned int): error: undefined reference to '__glewEnableVertexAttribArray'
bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_SetupRenderState(ImDrawData*, int, int, unsigned int): error: undefined reference to '__glewEnableVertexAttribArray'
bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_SetupRenderState(ImDrawData*, int, int, unsigned int): error: undefined reference to '__glewVertexAttribPointer'
bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_SetupRenderState(ImDrawData*, int, int, unsigned int): error: undefined reference to '__glewVertexAttribPointer'
bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_SetupRenderState(ImDrawData*, int, int, unsigned int): error: undefined reference to '__glewVertexAttribPointer'
bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function CheckShader(unsigned int, char const*): error: undefined reference to '__glewGetShaderiv'
bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function CheckShader(unsigned int, char const*): error: undefined reference to '__glewGetShaderiv'
bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function CheckShader(unsigned int, char const*): error: undefined reference to '__glewGetShaderInfoLog'
bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_RenderDrawData(ImDrawData*): error: undefined reference to '__glewActiveTexture'
bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_RenderDrawData(ImDrawData*): error: undefined reference to '__glewGenVertexArrays'
bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_RenderDrawData(ImDrawData*): error: undefined reference to '__glewBufferData'
bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_RenderDrawData(ImDrawData*): error: undefined reference to '__glewBufferData'
bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_RenderDrawData(ImDrawData*): error: undefined reference to '__glewDrawElementsBaseVertex'
bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_RenderDrawData(ImDrawData*): error: undefined reference to '__glewDeleteVertexArrays'
bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_RenderDrawData(ImDrawData*): error: undefined reference to '__glewUseProgram'
bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_RenderDrawData(ImDrawData*): error: undefined reference to '__glewBindSampler'
bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_RenderDrawData(ImDrawData*): error: undefined reference to '__glewActiveTexture'
bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_RenderDrawData(ImDrawData*): error: undefined reference to '__glewBindVertexArray'
bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_RenderDrawData(ImDrawData*): error: undefined reference to '__glewBindBuffer'
bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_RenderDrawData(ImDrawData*): error: undefined reference to '__glewBlendEquationSeparate'
bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_RenderDrawData(ImDrawData*): error: undefined reference to '__glewBlendFuncSeparate'
bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_CreateDeviceObjects(): error: undefined reference to '__glewCreateShader'
bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_CreateDeviceObjects(): error: undefined reference to '__glewShaderSource'
bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_CreateDeviceObjects(): error: undefined reference to '__glewCompileShader'
bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_CreateDeviceObjects(): error: undefined reference to '__glewCreateShader'
bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_CreateDeviceObjects(): error: undefined reference to '__glewShaderSource'
bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_CreateDeviceObjects(): error: undefined reference to '__glewCompileShader'
bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_CreateDeviceObjects(): error: undefined reference to '__glewCreateProgram'
bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_CreateDeviceObjects(): error: undefined reference to '__glewAttachShader'
bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_CreateDeviceObjects(): error: undefined reference to '__glewAttachShader'
bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_CreateDeviceObjects(): error: undefined reference to '__glewLinkProgram'
bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_CreateDeviceObjects(): error: undefined reference to '__glewGetProgramiv'
bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_CreateDeviceObjects(): error: undefined reference to '__glewGetProgramiv'
bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_CreateDeviceObjects(): error: undefined reference to '__glewGetUniformLocation'
bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_CreateDeviceObjects(): error: undefined reference to '__glewGetUniformLocation'
bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_CreateDeviceObjects(): error: undefined reference to '__glewGetAttribLocation'
bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_CreateDeviceObjects(): error: undefined reference to '__glewGetAttribLocation'
bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_CreateDeviceObjects(): error: undefined reference to '__glewGetAttribLocation'
bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_CreateDeviceObjects(): error: undefined reference to '__glewGenBuffers'
bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_CreateDeviceObjects(): error: undefined reference to '__glewGenBuffers'
bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_CreateDeviceObjects(): error: undefined reference to '__glewBindBuffer'
bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_CreateDeviceObjects(): error: undefined reference to '__glewBindVertexArray'
bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_CreateDeviceObjects(): error: undefined reference to '__glewGetProgramInfoLog'
bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_DestroyDeviceObjects(): error: undefined reference to '__glewDeleteBuffers'
bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_DestroyDeviceObjects(): error: undefined reference to '__glewDeleteBuffers'
bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_DestroyDeviceObjects(): error: undefined reference to '__glewDetachShader'
bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_DestroyDeviceObjects(): error: undefined reference to '__glewDetachShader'
bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_DestroyDeviceObjects(): error: undefined reference to '__glewDeleteShader'
bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_DestroyDeviceObjects(): error: undefined reference to '__glewDeleteShader'
bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_DestroyDeviceObjects(): error: undefined reference to '__glewDeleteProgram'
**Version/Branch of Dear ImGui:** Version: 1.81 Branch: master **Back-end/Renderer/Compiler/OS** Back-ends: imgui_impl_OpenGL3.cpp + imgui_impl_glfw.cpp _ Compiler: bazel VScode Operating System: Ubuntu 18.04.5 LTS **My Issue/Question:** Someting like #3507, when I try to use `imgui_impl_OpenGL3.cpp` to introduce `gl3w.h` and `gl3w.c`, `imgui_impl_OpenGL3.cpp` always link to `GL/glew`, how to fix it ? **Code** here is code I package imgui ```starlark load("@rules_cc//cc:defs.bzl", "cc_library") package(default_visibility = ["//visibility:public"]) cc_library( name = "imgui", srcs = [ "GL/gl3w.c", "imgui.cpp", "imgui_demo.cpp", "imgui_draw.cpp", "imgui_impl_glfw.cpp", "imgui_impl_opengl3.cpp", "imgui_stdlib.cpp", "imgui_tables.cpp", "imgui_widgets.cpp", ], hdrs = [ "GL/gl3w.h", "GL/glcorearb.h", "imconfig.h", "imgui.h", "imgui_impl_glfw.h", "imgui_impl_opengl3.h", "imgui_internal.h", "imgui_stdlib.h", "imstb_rectpack.h", "imstb_textedit.h", "imstb_truetype.h", ], includes = [ ".", "GL/", ], linkopts = [ "-ldl", "-lm", "-lGL", "-lGLEW", "-lGLU", "-lX11", "-lXi", "-lXrandr", "-lXxf86vm", "-lXinerama", "-lXcursor", ], deps = ["@glfw"], ) ``` here is the structure of my code, which imgui belongs ```shell . ├── BUILD ├── CMakeLists.txt ├── GL │   ├── CMakeLists.txt │   ├── gl3w.c │   ├── gl3w.h │   └── glcorearb.h ├── imconfig.h ├── imgui.cpp ├── imgui_demo.cpp ├── imgui_draw.cpp ├── imgui.h ├── imgui_impl_glfw.cpp ├── imgui_impl_glfw.h ├── imgui_impl_opengl3.cpp ├── imgui_impl_opengl3.h ├── imgui_internal.h ├── imgui_stdlib.cpp ├── imgui_stdlib.h ├── imgui_tables.cpp ├── imgui_widgets.cpp ├── imstb_rectpack.h ├── imstb_textedit.h └── imstb_truetype.h ``` error report ``` bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_SetupRenderState(ImDrawData*, int, int, unsigned int): error: undefined reference to '__glewBlendEquation' bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_SetupRenderState(ImDrawData*, int, int, unsigned int): error: undefined reference to '__glewUseProgram' bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_SetupRenderState(ImDrawData*, int, int, unsigned int): error: undefined reference to '__glewUniform1i' bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_SetupRenderState(ImDrawData*, int, int, unsigned int): error: undefined reference to '__glewUniformMatrix4fv' bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_SetupRenderState(ImDrawData*, int, int, unsigned int): error: undefined reference to '__glewBindSampler' bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_SetupRenderState(ImDrawData*, int, int, unsigned int): error: undefined reference to '__glewBindVertexArray' bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_SetupRenderState(ImDrawData*, int, int, unsigned int): error: undefined reference to '__glewBindBuffer' bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_SetupRenderState(ImDrawData*, int, int, unsigned int): error: undefined reference to '__glewBindBuffer' bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_SetupRenderState(ImDrawData*, int, int, unsigned int): error: undefined reference to '__glewEnableVertexAttribArray' bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_SetupRenderState(ImDrawData*, int, int, unsigned int): error: undefined reference to '__glewEnableVertexAttribArray' bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_SetupRenderState(ImDrawData*, int, int, unsigned int): error: undefined reference to '__glewEnableVertexAttribArray' bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_SetupRenderState(ImDrawData*, int, int, unsigned int): error: undefined reference to '__glewVertexAttribPointer' bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_SetupRenderState(ImDrawData*, int, int, unsigned int): error: undefined reference to '__glewVertexAttribPointer' bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_SetupRenderState(ImDrawData*, int, int, unsigned int): error: undefined reference to '__glewVertexAttribPointer' bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function CheckShader(unsigned int, char const*): error: undefined reference to '__glewGetShaderiv' bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function CheckShader(unsigned int, char const*): error: undefined reference to '__glewGetShaderiv' bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function CheckShader(unsigned int, char const*): error: undefined reference to '__glewGetShaderInfoLog' bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_RenderDrawData(ImDrawData*): error: undefined reference to '__glewActiveTexture' bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_RenderDrawData(ImDrawData*): error: undefined reference to '__glewGenVertexArrays' bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_RenderDrawData(ImDrawData*): error: undefined reference to '__glewBufferData' bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_RenderDrawData(ImDrawData*): error: undefined reference to '__glewBufferData' bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_RenderDrawData(ImDrawData*): error: undefined reference to '__glewDrawElementsBaseVertex' bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_RenderDrawData(ImDrawData*): error: undefined reference to '__glewDeleteVertexArrays' bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_RenderDrawData(ImDrawData*): error: undefined reference to '__glewUseProgram' bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_RenderDrawData(ImDrawData*): error: undefined reference to '__glewBindSampler' bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_RenderDrawData(ImDrawData*): error: undefined reference to '__glewActiveTexture' bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_RenderDrawData(ImDrawData*): error: undefined reference to '__glewBindVertexArray' bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_RenderDrawData(ImDrawData*): error: undefined reference to '__glewBindBuffer' bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_RenderDrawData(ImDrawData*): error: undefined reference to '__glewBlendEquationSeparate' bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_RenderDrawData(ImDrawData*): error: undefined reference to '__glewBlendFuncSeparate' bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_CreateDeviceObjects(): error: undefined reference to '__glewCreateShader' bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_CreateDeviceObjects(): error: undefined reference to '__glewShaderSource' bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_CreateDeviceObjects(): error: undefined reference to '__glewCompileShader' bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_CreateDeviceObjects(): error: undefined reference to '__glewCreateShader' bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_CreateDeviceObjects(): error: undefined reference to '__glewShaderSource' bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_CreateDeviceObjects(): error: undefined reference to '__glewCompileShader' bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_CreateDeviceObjects(): error: undefined reference to '__glewCreateProgram' bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_CreateDeviceObjects(): error: undefined reference to '__glewAttachShader' bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_CreateDeviceObjects(): error: undefined reference to '__glewAttachShader' bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_CreateDeviceObjects(): error: undefined reference to '__glewLinkProgram' bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_CreateDeviceObjects(): error: undefined reference to '__glewGetProgramiv' bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_CreateDeviceObjects(): error: undefined reference to '__glewGetProgramiv' bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_CreateDeviceObjects(): error: undefined reference to '__glewGetUniformLocation' bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_CreateDeviceObjects(): error: undefined reference to '__glewGetUniformLocation' bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_CreateDeviceObjects(): error: undefined reference to '__glewGetAttribLocation' bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_CreateDeviceObjects(): error: undefined reference to '__glewGetAttribLocation' bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_CreateDeviceObjects(): error: undefined reference to '__glewGetAttribLocation' bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_CreateDeviceObjects(): error: undefined reference to '__glewGenBuffers' bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_CreateDeviceObjects(): error: undefined reference to '__glewGenBuffers' bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_CreateDeviceObjects(): error: undefined reference to '__glewBindBuffer' bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_CreateDeviceObjects(): error: undefined reference to '__glewBindVertexArray' bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_CreateDeviceObjects(): error: undefined reference to '__glewGetProgramInfoLog' bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_DestroyDeviceObjects(): error: undefined reference to '__glewDeleteBuffers' bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_DestroyDeviceObjects(): error: undefined reference to '__glewDeleteBuffers' bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_DestroyDeviceObjects(): error: undefined reference to '__glewDetachShader' bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_DestroyDeviceObjects(): error: undefined reference to '__glewDetachShader' bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_DestroyDeviceObjects(): error: undefined reference to '__glewDeleteShader' bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_DestroyDeviceObjects(): error: undefined reference to '__glewDeleteShader' bazel-out/k8-opt/bin/third_party/imgui/_objs/imgui/imgui_impl_opengl3.o:imgui_impl_opengl3.cpp:function ImGui_ImplOpenGL3_DestroyDeviceObjects(): error: undefined reference to '__glewDeleteProgram' ```
Corezcy commented 2021-03-02 07:24:12 +00:00 (Migrated from github.com)

In version 1.73, it's okay ! I think it's something unchecked with header loader.

In version 1.73, it's okay ! I think it's something unchecked with header loader.
playingoDEERUX commented 2021-03-02 14:02:25 +00:00 (Migrated from github.com)

I have the same issue!! Someone has to fix it please...

I have the same issue!! Someone has to fix it please...
ocornut commented 2021-03-02 14:24:27 +00:00 (Migrated from github.com)

If you read the any of the comments nearby that OpenGL loader mess you would find that:

  • we added autodetection of the OpenGL loader based on available includes
  • you can override it using defines e.g. in your imconfig file: #define IMGUI_IMPL_OPENGL_LOADER_GL3W to force GL3W.
If you read the any of the comments nearby that OpenGL loader mess you would find that: - we added autodetection of the OpenGL loader based on available includes - you can override it using defines e.g. in your imconfig file: `#define IMGUI_IMPL_OPENGL_LOADER_GL3W` to force GL3W.
Corezcy commented 2021-03-02 16:06:55 +00:00 (Migrated from github.com)

If you read the any of the comments nearby that OpenGL loader mess you would find that:

  • we added autodetection of the OpenGL loader based on available includes
  • you can override it using defines e.g. in your imconfig file: #define IMGUI_IMPL_OPENGL_LOADER_GL3W to force GL3W.

I have solve this problem by change the definition order bwteen glew and gl3w.
Thanks anyway ! Let me try your method !
ocornut/imgui@4537d98d46/backends/imgui_impl_opengl3.h (L68-L85)

> If you read the any of the comments nearby that OpenGL loader mess you would find that: > > * we added autodetection of the OpenGL loader based on available includes > * you can override it using defines e.g. in your imconfig file: `#define IMGUI_IMPL_OPENGL_LOADER_GL3W` to force GL3W. I have solve this problem by change the definition order bwteen `glew` and `gl3w`. Thanks anyway ! Let me try your method ! https://github.com/ocornut/imgui/blob/4537d98d46005cb68f7c00e00154cf1aaeaa68c6/backends/imgui_impl_opengl3.h#L68-L85
Corezcy commented 2021-03-02 16:09:25 +00:00 (Migrated from github.com)

I have the same issue!! Someone has to fix it please...

here is my solution, please check it . Glad if can help you.

> I have the same issue!! Someone has to fix it please... here is my solution, please check it . Glad if can help you.
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ocornut/imgui#3860
No description provided.