Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ubuntu 20.04 compile error for GLEWContextStruct #159

Open
jesscel opened this issue Mar 9, 2022 · 2 comments
Open

Ubuntu 20.04 compile error for GLEWContextStruct #159

jesscel opened this issue Mar 9, 2022 · 2 comments

Comments

@jesscel
Copy link

jesscel commented Mar 9, 2022

I was trying to compile mitsuba 0.6.0 on Ubuntu 20.04 machine. I have changed the compiler to -std=gnu++11 for this version of Ubuntu. Previously, I have successfully compiled mitsuba on Ubuntu 16.04 with the compiler set to -std=c++11.

However, on Ubuntu 20.04, I got the following error:

In file included from include/mitsuba/mitsuba.h:52,
                 from src/libhw/glrenderer.cpp:19:
src/libhw/glrenderer.cpp: In member function ‘virtual void mitsuba::GLRenderer::init(mitsuba::Device*, mitsuba::Renderer*)’:
src/libhw/glrenderer.cpp:148:39: warning: ?: using integer constants in boolean context [-Wint-in-bool-context]
  148 |         Log((m_warnLogLevel == EWarn) ? EInfo : m_warnLogLevel,
include/mitsuba/core/logger.h:40:31: note: in definition of macro ‘Log’
   40 |         if (logger != NULL && level >= logger->getLogLevel()) \
      |                               ^~~~~
src/libhw/glrenderer.cpp:197:39: warning: ?: using integer constants in boolean context [-Wint-in-bool-context]
  197 |         Log((m_warnLogLevel == EWarn) ? EInfo : m_warnLogLevel,
include/mitsuba/core/logger.h:40:31: note: in definition of macro ‘Log’
   40 |         if (logger != NULL && level >= logger->getLogLevel()) \
      |                               ^~~~~
In file included from include/mitsuba/mitsuba.h:51,
                 from src/libhw/glrenderer.cpp:19:
include/mitsuba/core/tls.h: In instantiation of ‘static void* mitsuba::PrimitiveThreadLocal<ValueType>::construct() [with ValueType = GLEWContextStruct]’:
include/mitsuba/core/tls.h:118:60:   required from ‘mitsuba::PrimitiveThreadLocal<ValueType>::PrimitiveThreadLocal() [with ValueType = GLEWContextStruct]’
src/libhw/glrenderer.cpp:33:57:   required from here
include/mitsuba/core/tls.h:140:16: error: invalid use of incomplete type ‘struct GLEWContextStruct’
  140 |         return new ValueType();
      |                ^~~~~~~~~~~~~~~
In file included from src/libhw/glrenderer.cpp:25:
include/mitsuba/hw/glrenderer.h:25:8: note: forward declaration of ‘struct GLEWContextStruct’
   25 | struct GLEWContextStruct;
      |        ^~~~~~~~~~~~~~~~~
In file included from include/mitsuba/mitsuba.h:51,
                 from src/libhw/glrenderer.cpp:19:
include/mitsuba/core/tls.h: In instantiation of ‘static void mitsuba::PrimitiveThreadLocal<ValueType>::destruct(void*) [with ValueType = GLEWContextStruct]’:
include/mitsuba/core/tls.h:119:32:   required from ‘mitsuba::PrimitiveThreadLocal<ValueType>::PrimitiveThreadLocal() [with ValueType = GLEWContextStruct]’
src/libhw/glrenderer.cpp:33:57:   required from here
include/mitsuba/core/tls.h:145:13: warning: possible problem detected in invocation of delete operator: [-Wdelete-incomplete]
  145 |             delete static_cast<ValueType *>(data);
      |             ^~~~~~
include/mitsuba/core/tls.h:145:45: warning: invalid use of incomplete type ‘struct GLEWContextStruct’
  145 |             delete static_cast<ValueType *>(data);
      |                                             ^~~~
In file included from src/libhw/glrenderer.cpp:25:
include/mitsuba/hw/glrenderer.h:25:8: note: forward declaration of ‘struct GLEWContextStruct’
   25 | struct GLEWContextStruct;
      |        ^~~~~~~~~~~~~~~~~
In file included from include/mitsuba/mitsuba.h:51,
                 from src/libhw/glrenderer.cpp:19:
include/mitsuba/core/tls.h:145:13: note: neither the destructor nor the class-specific operator delete will be called, even if they are declared when the class is defined
  145 |             delete static_cast<ValueType *>(data);
      |             ^~~~~~
scons: *** [build/release/libhw/glrenderer.os] Error 1
scons: building terminated because of errors.

Any idea how to fix that problem in Ubuntu 20.04?

@LZleejean
Copy link

Just try this command:
sudo apt-get install glew-utils libglewmx-dev

I fixed this error by using these dependencies.

@indevn
Copy link

indevn commented Jun 24, 2022

Just try this command: sudo apt-get install glew-utils libglewmx-dev

I fixed this error by using these dependencies.

I've also no idea for this problem for a long time until I saw the issue.
That's work. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants