Only have one copy of GLEW in the repo

Create issue
Issue #3 resolved
Matt Williams created an issue

Currently building GLEW four times for each fresh build slows things down unnecessarily. We should be able to have one copy in example/common/GLEW or something which just gets built once.

Comments (11)

  1. David Williams

    Yep, agreed. Eventually we might want to rework the examples anyway (there is other common code that can be pulled out) but this is a good start.

  2. David Williams

    The Windows version appears to b broken, maybe you can check it?

    Error 28 error LNK2001: unresolved external symbol imp__glewBufferData C:\code\polyvox\build\examples\Paging\OpenGLWidget.obj

    And some others.

  3. David Williams

    It looks like it's because you removed the 'ADD_DEFINITIONS(-DGLEW_STATIC)' from the various CMakeLists.txt. I realise you added it when building the library but it's not present when building the demos. This define probably affects the way the headers are handled by the preprocessor, which means the headers are then different when building the library compared to when building the .exes. Try looking at the docs for GLEW_STATIC to find out more.

    Not sure why it worked in Linux... any chance you still have GLEW installed locally and that linking against 'glew' from CMake actually links against the system version rather than the version you just built?

  4. Matt Williams reporter

    According to the GLEW docs, GLEW_STATIC is only needed on Windows. I will try to fix this tonight when I get home.

  5. David Williams

    Ok, but do check whether your also linking against the system GLEW (if you have one) in Linux.

  6. Matt Williams reporter

    I've checked and it is definitely not linking against the system GLEW. Firstly system GLEw is libGLEW but ours is libglew and secondly we're explicitly linking against '../common/libglew.a'.

    I think this can safely be closed now.

  7. Log in to comment