puzzlepaint / surfelmeshing

Real-time surfel-based mesh reconstruction from RGB-D video.
BSD 3-Clause "New" or "Revised" License
420 stars 83 forks source link

vs2015 'vis::channel_count_helper<T>': no appropriate default constructor available #9

Closed initialneil closed 4 years ago

initialneil commented 4 years ago

When compiled in vs2015 on Windows10. I encounter this error:

error C2512: 'vis::channel_count_helper<T>': no appropriate default constructor available (compiling source file D:\Playground\codes\surfelmeshing\libvis\src\libvis\image_display_qt_widget.cc)

This is because in libvis/image.h the channel_count_helper has no constructor. My fix was to change the channel_count function to static.

Details:


step 1 change the definition of channel_count() to static: from

constexpr inline u32 channel_count() const {

to

static constexpr inline u32 channel_count() {

in line 67 and 74 of libvis/image.h.


step 2 change the caller of channel_count() to static: from

channel_count_helper<T>().channel_count()

to

channel_count_helper<T>::channel_count()

in line 868, 876, 877, and 1625 of libvis/image.h.

puzzlepaint commented 4 years ago

Thank you very much for reporting this! I committed your fix in 424333d1fef9f88444c4460c9ec7237f2fe968a7.

zhuisa commented 2 years ago

@initialneil Hi! I want to run this project on windows10. Can you give me some help how to build an run. Thanks!

initialneil commented 2 years ago

@zhuisa It's been a while now. I think I used CMake GUI to generate vs2015 projects. Most libraries were prebuilt version like boost and qt.

zhuisa commented 2 years ago

@initialneil Thanks! I use cmake GUI CMake GUI to generate vs2015 projects in win32. But I encounter a problem like #14 (ASSERT failure in QCoreApplication::sendEvent: "Cannot send events to objects owned by a different thread. Current thread 0x0x174b485e370. Receiver '' (of type 'QOffscreenSurface') was created in thread 0x0x174b4899af0"). Can you give me some help!