mitsuba-renderer / mitsuba

Mitsuba renderer main repository
GNU General Public License v3.0
1.05k stars 321 forks source link

Building error of GLEWContextStruct in arch linux #141

Open crekIron opened 3 years ago

crekIron commented 3 years ago

I properly followed the documentation for building mitsuba. I am currently getting an error below.

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 ‘operator delete’ [-Wdelete-incomplete]
  145 |             delete static_cast<ValueType *>(data);
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/mitsuba/core/tls.h:145:20: 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.
jesscel commented 2 years ago

I also got the same error. I wonder if you solved the problem? Thanks!

LZleejean commented 2 years ago

see #159

kririae commented 2 years ago

Refer to the homepage of glew, "MX discontinued" since GLEW 2.0.0. You can refer to my notes on compiling Mitsuba on Arch Linux or directly use the dependencies_arch although further modification in config.py is required.