Bug 362618 - marble (from git) doesn't build with opencv 3.1 (only with opencv2)
Summary: marble (from git) doesn't build with opencv 3.1 (only with opencv2)
Status: RESOLVED FIXED
Alias: None
Product: marble
Classification: Applications
Component: general (show other bugs)
Version: 2.0 (KDE Applications 16.08)
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: marble-bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-05-03 10:31 UTC by desaparecido
Modified: 2016-06-11 17:08 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description desaparecido 2016-05-03 10:31:20 UTC
from a while, I'd can't build marble, but I'd never taken the time to investigate why, and finally after some test:
try to build marble from git with opencv 3.1 (repo version in Archlinux) I have an error at the end of build process (see "actual results")
but downgrading opencv to 2 version (2.4.12.3 in my case) all builds fine

Reproducible: Always

Steps to Reproduce:
1.KF5 and plasma up to date to latest git commit
2.build marble from git with opencv3 > error
3.build marble from git with opencv2 > ok

Actual Results:  
[100%] Built target marbleQuick2
CMakeFiles/animation-video.dir/main.cpp.o: In function `animatedFlight(Marble::MarbleWidget*)':
main.cpp:(.text+0x23e): undefined reference to `cv::VideoWriter::VideoWriter(cv::String const&, int, double, cv::Size_<int>, bool)'
main.cpp:(.text+0x577): undefined reference to `cv::VideoWriter::write(cv::Mat const&)'
main.cpp:(.text+0x671): undefined reference to `cv::VideoWriter::write(cv::Mat const&)'
main.cpp:(.text+0x73a): undefined reference to `cv::VideoWriter::~VideoWriter()'
main.cpp:(.text+0x787): undefined reference to `cv::VideoWriter::~VideoWriter()'
collect2: error: ld returned 1 exit status
examples/cpp/animation-video/CMakeFiles/animation-video.dir/build.make:133: recipe for target 'examples/cpp/animation-video/animation-video' failed
make[2]: *** [examples/cpp/animation-video/animation-video] Error 1
CMakeFiles/Makefile2:10854: recipe for target 'examples/cpp/animation-video/CMakeFiles/animation-video.dir/all' failed
make[1]: *** [examples/cpp/animation-video/CMakeFiles/animation-video.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[100%] Built target marble-game
CMakeFiles/tour-preview.dir/tour-preview.cpp.o: In function `animatedFlight(Marble::MarbleWidget*, Marble::GeoDataTour*)':
tour-preview.cpp:(.text+0x555): undefined reference to `cv::VideoWriter::VideoWriter(cv::String const&, int, double, cv::Size_<int>, bool)'
tour-preview.cpp:(.text+0x85d): undefined reference to `cv::VideoWriter::write(cv::Mat const&)'
tour-preview.cpp:(.text+0x937): undefined reference to `cv::VideoWriter::write(cv::Mat const&)'
tour-preview.cpp:(.text+0xa00): undefined reference to `cv::VideoWriter::~VideoWriter()'
tour-preview.cpp:(.text+0xa88): undefined reference to `cv::VideoWriter::~VideoWriter()'
collect2: error: ld returned 1 exit status
examples/cpp/tour-preview/CMakeFiles/tour-preview.dir/build.make:133: recipe for target 'examples/cpp/tour-preview/tour-preview' failed
make[2]: *** [examples/cpp/tour-preview/tour-preview] Error 1
CMakeFiles/Makefile2:10943: recipe for target 'examples/cpp/tour-preview/CMakeFiles/tour-preview.dir/all' failed
make[1]: *** [examples/cpp/tour-preview/CMakeFiles/tour-preview.dir/all] Error 2
[100%] Built target marble_part
[100%] Built target marble
Makefile:160: recipe for target 'all' failed
make: *** [all] Error 2
==> ERROR: A failure occurred in build().
    Aborting...


Expected Results:  
build successfully marble with opencv3

Archlinux x86_64 (with [testing] repo enable)
KF5 5.22.0 (from git, latests commits)
Plasma 5.6.90 (from git, latest commits)
Qt 5.6.0
Comment 1 Rex Dieter 2016-05-05 11:47:18 UTC
There's probably a reason marble examples (the only thing in marble that uses opencv) are disabled by default:
option(BUILD_MARBLE_EXAMPLES "Build C++ examples showing how to use the Marble library" OFF)

So, workaround for now would be to skip setting -DBUILD_MARBLE_EXAMPLES=ON (or explicitly do -DBUILD_MARBLE_EXAMPLES=OFF)
Comment 2 desaparecido 2016-05-10 21:30:56 UTC
hi, thanks for the tip, with -DBUILD_MARBLE_EXAMPLES=OFF all builds fine (commit r11212.29743f3, builded recently today), BUT I have this conflict file when I try to install it (I use Archlinux, so to install it I use pacman):

error: failed to commit transaction (conflicting files)
/usr/share/mime/packages/geo.xml exists in both 'marble-data-git' and 'marble-git'
Errors occurred, no packages were upgraded.
Comment 3 Dennis Nienhüser 2016-06-11 15:23:03 UTC
Fixed in http://commits.kde.org/marble/b6f409c7c4f3c58cfe253a583e501171a57ffe51

Please reopen if that causes problems with older OpenCV versions, not sure how the OpenCV 2 cmake check reacts to videoio.
Comment 4 desaparecido 2016-06-11 17:08:41 UTC
yes, I built successfully some hours ago win OpenCV 3, thanks ;-)