cheind / image-align

Variants of the classic Lucas-Kanade image alignment algorithm

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

build fails on ubuntu 16.04

alexandervakhitov opened this issue · comments

Thank you for the library, it looks fine.

Build with gcc fails on Ubuntu 16.04. Namely, this is the error:

/home/alexander/soft/image-align/image-align/tests/algorithms.cpp:217:12: error: specialization of ‘template<int W, class Scalar> struct imagealign::WarpTraits’ in different namespace [-fpermissive]
struct ia::WarpTraits<WARP_TRANSLATION_DYAMIC, Scalar> : ia::WarpTraitsForRunTimeKnownParameterCount<WARP_TRANSLATION_DYAMIC, Scalar> {};
^
In file included from /home/alexander/soft/image-align/image-align/inc/imagealign/align_base.h:23:0,
from /home/alexander/soft/image-align/image-align/inc/imagealign/forward_additive.h:23,
from /home/alexander/soft/image-align/image-align/tests/algorithms.cpp:22:
/home/alexander/soft/image-align/image-align/inc/imagealign/warp.h:74:12: error: from definition of ‘template<int W, class Scalar> struct imagealign::WarpTraits’ [-fpermissive]
struct WarpTraits {
^
/home/alexander/soft/image-align/image-align/tests/algorithms.cpp:220:11: error: specialization of ‘template<int WarpMode, class Scalar> class imagealign::Warp’ in different namespace [-fpermissive]
class ia::Warp<WARP_TRANSLATION_DYAMIC, Scalar> {
^
In file included from /home/alexander/soft/image-align/image-align/inc/imagealign/align_base.h:23:0,
from /home/alexander/soft/image-align/image-align/inc/imagealign/forward_additive.h:23,
from /home/alexander/soft/image-align/image-align/tests/algorithms.cpp:22:
/home/alexander/soft/image-align/image-align/inc/imagealign/warp.h:232:11: error: from definition of ‘template<int WarpMode, class Scalar> class imagealign::Warp’ [-fpermissive]
class Warp {
^
CMakeFiles/tests.dir/build.make:110: recipe for target 'CMakeFiles/tests.dir/tests/algorithms.cpp.o' failed
make[2]: *** [CMakeFiles/tests.dir/tests/algorithms.cpp.o] Error 1
CMakeFiles/Makefile2:104: recipe for target 'CMakeFiles/tests.dir/all' failed
make[1]: *** [CMakeFiles/tests.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

Inclusion of the lines 214-357 of algorithms.cpp into namespace imagealign solves the issue.

Hi,

I couldn't reproduce the problem on Windows, but made changes similar to what you suggested. Could you try again, as I don't have access to Ubuntu right now.