HomeOfVapourSynthEvolution / VapourSynth-BM3D

BM3D denoising filter for VapourSynth
MIT License
113 stars 30 forks source link

Doesn't compile with Clang++ #7

Closed darealshinji closed 9 years ago

darealshinji commented 9 years ago

I can build with g++ but with clang it fails.

clang++-3.6 -O2 -ffast-math -std=c++11 -Wall -Wno-unused-local-typedefs -I. -I./include -I.. -msse2  -fPIC -mfpmath=sse -c source/BM3D_Base.cpp -o source/BM3D_Base.o
In file included from source/BM3D_Base.cpp:20:
In file included from ./include/BM3D_Base.h:24:
In file included from ./include/BM3D.h:26:
./include/Block.h:62:20: error: chosen constructor is explicit in copy-initialization
    PosType pos_ = { 0, 0 };
                   ^~~~~~~~
./include/Type.h:195:14: note: constructor declared here
    explicit Pos(PCType _y = 0, PCType _x = 0)
             ^
In file included from source/BM3D_Base.cpp:20:
In file included from ./include/BM3D_Base.h:24:
In file included from ./include/BM3D.h:26:
./include/Block.h:117:11: error: no matching constructor for initialization of 'Block<float, float>'
        : Block(_Height, _Width, pos, false)
          ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~
source/BM3D_Base.cpp:455:16: note: in instantiation of function template specialization 'Block<float, float>::Block<float>' requested here
    block_type refBlock(ref, ref_stride[0], d.para.BlockSize, d.para.BlockSize, PosType(j, i));
               ^
./include/Block.h:116:5: note: candidate constructor template not viable: requires 5 arguments, but 4 were provided
    Block(const _St1 *src, PCType src_stride, PCType _Height, PCType _Width, const PosType &pos)
    ^
./include/Block.h:123:5: note: candidate constructor not viable: requires at most 3 arguments, but 4 were provided
    Block(const _Myt &src, bool Init, value_type Value = 0)
    ^
./include/Block.h:128:5: note: candidate constructor not viable: requires single argument 'src', but 4 arguments were provided
    Block(const _Myt &src)
    ^
./include/Block.h:104:5: note: candidate constructor not viable: requires 0 arguments, but 4 were provided
    Block() {}
    ^
2 errors generated.
clang++-3.5 -O2 -ffast-math -std=c++11 -Wall -Wno-unused-local-typedefs -I. -I./include -I.. -msse2  -fPIC -mfpmath=sse -c source/BM3D_Base.cpp -o source/BM3D_Base.o
warning: unknown warning option '-Wno-unused-local-typedefs' [-Wunknown-warning-option]
In file included from source/BM3D_Base.cpp:20:
In file included from ./include/BM3D_Base.h:24:
In file included from ./include/BM3D.h:26:
./include/Block.h:62:20: error: chosen constructor is explicit in copy-initialization
    PosType pos_ = { 0, 0 };
                   ^~~~~~~~
./include/Type.h:195:14: note: constructor declared here
    explicit Pos(PCType _y = 0, PCType _x = 0)
             ^
In file included from source/BM3D_Base.cpp:20:
In file included from ./include/BM3D_Base.h:24:
In file included from ./include/BM3D.h:26:
./include/Block.h:117:11: error: no matching constructor for initialization of 'Block<float, float>'
        : Block(_Height, _Width, pos, false)
          ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~
source/BM3D_Base.cpp:455:16: note: in instantiation of function template specialization 'Block<float, float>::Block<float>' requested here
    block_type refBlock(ref, ref_stride[0], d.para.BlockSize, d.para.BlockSize, PosType(j, i));
               ^
./include/Block.h:116:5: note: candidate constructor template not viable: requires 5 arguments, but 4 were provided
    Block(const _St1 *src, PCType src_stride, PCType _Height, PCType _Width, const PosType &pos)
    ^
./include/Block.h:123:5: note: candidate constructor not viable: requires at most 3 arguments, but 4 were provided
    Block(const _Myt &src, bool Init, value_type Value = 0)
    ^
./include/Block.h:128:5: note: candidate constructor not viable: requires single argument 'src', but 4 arguments were provided
    Block(const _Myt &src)
    ^
./include/Block.h:104:5: note: candidate constructor not viable: requires 0 arguments, but 4 were provided
    Block() {}
    ^
1 warning and 2 errors generated.
mawen1250 commented 9 years ago

Thanks for the report, please check this commit to see if it's solved https://github.com/HomeOfVapourSynthEvolution/VapourSynth-BM3D/commit/c421734c32f7a243ca5f32cde760221a7d773808 The first error should be fixed, but I'm not sure what's the problem with the second one.

darealshinji commented 9 years ago

Yes, now it builds with clang 3.6.

By the way, it issues the following warnings which I don't get when I use g++:

./include/VBM3D_Base.h:273:18: warning: 'NewFormat' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
    virtual void NewFormat()
                 ^
./include/Helper.h:655:18: note: overridden virtual function is here
    virtual void NewFormat()
                 ^
1 warning generated.

Just wanted to let you know.

mawen1250 commented 9 years ago

Thanks, fixed now https://github.com/HomeOfVapourSynthEvolution/VapourSynth-BM3D/commit/ecb86ac3075e842f9852b84d003858e68f95f5dc