Undefined reference to `_imp__glewInit@0'

前端 未结 3 1249
野性不改
野性不改 2020-12-10 14:48

I have built the glew lib so many times. My last build removed the undefined references to all the shader functions such as glCreateShader(). I think this build

相关标签:
3条回答
  • 2020-12-10 15:45

    Link glew32 after libs that use it.

    0 讨论(0)
  • 2020-12-10 15:50

    In Ubuntu 18.04 to work OpenGL the GLEW should be installed:

    apt-get install libglew-dev   
    

    And it works when add linker option: "-lGLEW" to linker call, like in the Makefile for the FLTK:

    ...
    # HOW TO LINK
    .o$(EXEEXT):
      @echo "*** Linking $@..."
      $(CXX) $< $(LINKFLTK_ALL) -lGLEW -o $@
    
    0 讨论(0)
  • 2020-12-10 15:54

    Save yourself a lot of trouble and just add the glew.c to your project directly. I do not understand why people fight so hard to link to it externally. The license is friendly, and it is only one source file. Just remember to #define GLEW_STATIC.

    0 讨论(0)
提交回复
热议问题