{"action":"opened","issue":{"url":"https://api.github.com/repos/mshabunin/test/issues/440","labels_url":"https://api.github.com/repos/mshabunin/test/issues/440/labels{/name}","comments_url":"https://api.github.com/repos/mshabunin/test/issues/440/comments","events_url":"https://api.github.com/repos/mshabunin/test/issues/440/events","html_url":"https://github.com/mshabunin/test/issues/440","id":91232889,"number":440,"title":"Cannot build OpenCV static with V4L","user":{"login":"mshabunin","id":3304494,"avatar_url":"https://avatars.githubusercontent.com/u/3304494?v=3","gravatar_id":"","url":"https://api.github.com/users/mshabunin","html_url":"https://github.com/mshabunin","followers_url":"https://api.github.com/users/mshabunin/followers","following_url":"https://api.github.com/users/mshabunin/following{/other_user}","gists_url":"https://api.github.com/users/mshabunin/gists{/gist_id}","starred_url":"https://api.github.com/users/mshabunin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mshabunin/subscriptions","organizations_url":"https://api.github.com/users/mshabunin/orgs","repos_url":"https://api.github.com/users/mshabunin/repos","events_url":"https://api.github.com/users/mshabunin/events{/privacy}","received_events_url":"https://api.github.com/users/mshabunin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-06-26T11:56:05Z","updated_at":"2015-06-26T11:56:05Z","closed_at":null,"body":"Converted from http://code.opencv.org/issues/3726\r\n```\n|| by Radek Svoboda on 2014-05-29 17:25:00\n|| Status: New\n|| Priority: Normal\n|| Affected: 2.4.9 (latest release)\n|| Target: -\n|| Category: build/install\n\nCannot build OpenCV static with V4L\n===========\nWhen building opencv with V4L on Kubuntu 14.04, error pops up during\ntests:\n\nLinking CXX executable ../../bin/opencv_test_highgui  \n/usr/bin/ld: ../../lib/libopencv_highgui.a(cap_libv4l.cpp.o): undefined\nreference to symbol 'v4l2_munmap'  \n//usr/lib/x86_64-linux-gnu/libv4l2.so.0: error adding symbols: DSO\nmissing from command line  \ncollect2: error: ld returned 1 exit status  \nmake2: * [bin/opencv_test_highgui] Error 1  \nmake1: [modules/highgui/CMakeFiles/opencv_test_highgui.dir/all] Error\n2  \nmake: ** [all] Error 2\n\nThe issue is solved by adding -lv4l2 to\nBUILDDIR/modules/highgui/CMakeFiles/opencv_test_highgui.dir/link.txt,\nhowever, I cannot find the place where the files is generated from, so\nplease someone who knows add the dependency.\n\n\nHistory\n=======\n|| by Radek Svoboda on 2014-05-29 17:28:00\n-   Also applies to\n    BUILDDIR/modules/superres/CMakeFiles/opencv_test_superres.dir/link.txt\n\n\n|| by Dmitry Retinskiy on 2014-05-30 11:49:00\nHi Radek,\n\nI believe you could set it in cmake options.  \nEither add corresponding flag to cmake command line or just check it on\nin the tools like cmake-gui or ccmake.  \nI think setting WITH_V4L flag to ON should solve the problem.\n-   Assignee set to Radek Svoboda\n-   Category set to build/install\n\n\n|| by Isaac Nickaein on 2014-08-26 18:14:00\nCould this error be because of the extra slash in the following line?\n\n    //usr/lib/x86_64-linux-gnu/libv4l2.so.0: error adding symbols: DSO missing from command line\n\nHow should I add this to CMAKE?\n\nDmitry Retinskiy wrote:\n\n  Hi Radek,\n\n  I believe you could set it in cmake options.  \n  Either add corresponding flag to cmake command line or just check it\n  on in the tools like cmake-gui or ccmake.  \n  I think setting WITH_V4L flag to ON should solve the problem.\n\n\n|| by Mani Malek on 2014-09-18 03:51:00\nGot that error a few other times, eg\n\nLinking CXX executable ../../bin/opencv_perf_ocl  \n...  \nand   \nLinking CXX executable ../../bin/opencv_perf_gpu  \n...  \nLinking CXX executable ../../bin/opencv_test_ocl  \n....\n\nthe hack worked for all of them, just if an error shows up   \n../../bin/ANYTHING  \nfind ANYTHING.dir/link.txt and add -lv4l2\n\n\n|| by Michael Thiessen on 2014-10-10 19:42:00\nFinding and replacing on -lv4l1 works (much better than going through\nall 50+ files that have this problem).\n\nex:  \ngrep -rl -- -lv4l1 samples/* modules/* | xargs sed -i 's/-lv4l1/-lv4l1 -lv4l2/g'\n```"}}