{"id":7287,"date":"2014-06-03T23:35:25","date_gmt":"2014-06-03T23:35:25","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/06\/03\/not-able-to-install-ruby-opencv-gem-collection-of-common-programming-errors\/"},"modified":"2014-06-03T23:35:25","modified_gmt":"2014-06-03T23:35:25","slug":"not-able-to-install-ruby-opencv-gem-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/06\/03\/not-able-to-install-ruby-opencv-gem-collection-of-common-programming-errors\/","title":{"rendered":"not able to install ruby-opencv gem-Collection of common programming errors"},"content":{"rendered":"<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/6a0ef4178507d535d52892534da53c10?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nGagan<\/p>\n<p>I am unable to install ruby-opencv gem.<\/p>\n<p>Here&#8217;s what I have done so far.<\/p>\n<p>Installed openCV with<\/p>\n<pre><code>sudo apt-get install libopencv-dev\n<\/code><\/pre>\n<p>Then tried installing ruby-opencv gem with<\/p>\n<pre><code>gem install ruby-opencv\n<\/code><\/pre>\n<p>But I got the following error<\/p>\n<pre><code>?  test  gem install ruby-opencv\nBuilding native extensions.  This could take a while...\nERROR:  Error installing ruby-opencv:\n    ERROR: Failed to build gem native extension.\n\n    \/home\/ckgagan\/.rvm\/rubies\/ruby-1.9.3-p484\/bin\/ruby extconf.rb\n&gt;&gt; Check the required libraries...\nchecking for main() in -lopencv_calib3d... yes\nchecking for main() in -lopencv_contrib... yes\nchecking for main() in -lopencv_core... yes\nchecking for main() in -lopencv_features2d... yes\nchecking for main() in -lopencv_flann... yes\nchecking for main() in -lopencv_gpu... no\n*** extconf.rb failed ***\nCould not create Makefile due to some reason, probably lack of\nnecessary libraries and\/or headers.  Check the mkmf.log file for more\ndetails.  You may need configuration options.\n\nProvided configuration options:\n    --with-opt-dir\n    --without-opt-dir\n    --with-opt-include\n    --without-opt-include=${opt-dir}\/include\n    --with-opt-lib\n    --without-opt-lib=${opt-dir}\/lib\n    --with-make-prog\n    --without-make-prog\n    --srcdir=.\n    --curdir\n    --ruby=\/home\/ckgagan\/.rvm\/rubies\/ruby-1.9.3-p484\/bin\/ruby\n    --with-opencv-dir\n    --without-opencv-dir\n    --with-opencv-include\n    --without-opencv-include=${opencv-dir}\/include\n    --with-opencv-lib\n    --without-opencv-lib=${opencv-dir}\/lib\n    --with-libxml2-dir\n    --without-libxml2-dir\n    --with-libxml2-include\n    --without-libxml2-include=${libxml2-dir}\/include\n    --with-libxml2-lib\n    --without-libxml2-lib=${libxml2-dir}\/lib\n    --with-opencv_calib3dlib\n    --without-opencv_calib3dlib\n    --with-opencv_contriblib\n    --without-opencv_contriblib\n    --with-opencv_corelib\n    --without-opencv_corelib\n    --with-opencv_features2dlib\n    --without-opencv_features2dlib\n    --with-opencv_flannlib\n    --without-opencv_flannlib\n    --with-opencv_gpulib\n    --without-opencv_gpulib\nextconf.rb:53:in `block in ': libopencv_gpu not found. (RuntimeError)\n    from extconf.rb:52:in `each'\n    from extconf.rb:52:in `'\n<\/code><\/pre>\n<p>It seems there is no libopencv-gpu dependency installed.<\/p>\n<p>I tried to install it with apt-get but couldn&#8217;t succeed as no repository was found.<\/p>\n<p>Can any one help me how to install ruby-opencv gem?<\/p>\n<p>UPDATE added mkmf.log content<\/p>\n<pre><code>?  test  cat \/home\/ckgagan\/.rvm\/gems\/ruby-1.9.3-p484\/gems\/ruby-opencv-0.0.11\/ext\/opencv\/mkmf.log\nhave_library: checking for main() in -lopencv_calib3d... -------------------- yes\n\n\"gcc -o conftest -I\/home\/ckgagan\/.rvm\/rubies\/ruby-1.9.3-p484\/include\/ruby-1.9.1\/x86_64-linux -I\/home\/ckgagan\/.rvm\/rubies\/ruby-1.9.3-p484\/include\/ruby-1.9.1\/ruby\/backward -I\/home\/ckgagan\/.rvm\/rubies\/ruby-1.9.3-p484\/include\/ruby-1.9.1 -I. -I\/usr\/include -I\/usr\/local\/include     -O3 -ggdb -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration  -fPIC conftest.c  -L. -L\/home\/ckgagan\/.rvm\/rubies\/ruby-1.9.3-p484\/lib -Wl,-R\/home\/ckgagan\/.rvm\/rubies\/ruby-1.9.3-p484\/lib -L\/usr\/lib -Wl,-R\/usr\/lib -L\/usr\/local\/lib -Wl,-R\/usr\/local\/lib -L.  -rdynamic -Wl,-export-dynamic     '-Wl,-rpath,\/..\/lib' -Wl,-R -Wl,\/home\/ckgagan\/.rvm\/rubies\/ruby-1.9.3-p484\/lib -L\/home\/ckgagan\/.rvm\/rubies\/ruby-1.9.3-p484\/lib -lruby  -lpthread -lrt -ldl -lcrypt -lm   -lc\"\nchecked program was:\n\/* begin *\/\n1: #include \"ruby.h\"\n2: \n3: int main(int argc, char **argv)\n4: {\n5:   return 0;\n6: }\n\/* end *\/\n\n\"gcc -o conftest -I\/home\/ckgagan\/.rvm\/rubies\/ruby-1.9.3-p484\/include\/ruby-1.9.1\/x86_64-linux -I\/home\/ckgagan\/.rvm\/rubies\/ruby-1.9.3-p484\/include\/ruby-1.9.1\/ruby\/backward -I\/home\/ckgagan\/.rvm\/rubies\/ruby-1.9.3-p484\/include\/ruby-1.9.1 -I. -I\/usr\/include -I\/usr\/local\/include     -O3 -ggdb -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration  -fPIC conftest.c  -L. -L\/home\/ckgagan\/.rvm\/rubies\/ruby-1.9.3-p484\/lib -Wl,-R\/home\/ckgagan\/.rvm\/rubies\/ruby-1.9.3-p484\/lib -L\/usr\/lib -Wl,-R\/usr\/lib -L\/usr\/local\/lib -Wl,-R\/usr\/local\/lib -L.  -rdynamic -Wl,-export-dynamic     '-Wl,-rpath,\/..\/lib' -Wl,-R -Wl,\/home\/ckgagan\/.rvm\/rubies\/ruby-1.9.3-p484\/lib -L\/home\/ckgagan\/.rvm\/rubies\/ruby-1.9.3-p484\/lib -lruby -lopencv_calib3d  -lpthread -lrt -ldl -lcrypt -lm   -lc\"\nconftest.c: In function \u2018t\u2019:\nconftest.c:4:53: error: \u2018main\u2019 undeclared (first use in this function)\nconftest.c:4:53: note: each undeclared identifier is reported only once for each function it appears in\nconftest.c:4:28: warning: variable \u2018p\u2019 set but not used [-Wunused-but-set-variable]\nchecked program was:\n\/* begin *\/\n 1: #include \"ruby.h\"\n 2: \n 3: \/*top*\/\n 4: int t() { void ((*volatile p)()); p = (void ((*)()))main; return 0; }\n 5: int main(int argc, char **argv)\n 6: {\n 7:   if (argc &gt; 1000000) {\n 8:     printf(\"%p\", &amp;t);\n 9:   }\n10: \n11:   return 0;\n12: }\n\/* end *\/\n\n\"gcc -o conftest -I\/home\/ckgagan\/.rvm\/rubies\/ruby-1.9.3-p484\/include\/ruby-1.9.1\/x86_64-linux -I\/home\/ckgagan\/.rvm\/rubies\/ruby-1.9.3-p484\/include\/ruby-1.9.1\/ruby\/backward -I\/home\/ckgagan\/.rvm\/rubies\/ruby-1.9.3-p484\/include\/ruby-1.9.1 -I. -I\/usr\/include -I\/usr\/local\/include     -O3 -ggdb -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration  -fPIC conftest.c  -L. -L\/home\/ckgagan\/.rvm\/rubies\/ruby-1.9.3-p484\/lib -Wl,-R\/home\/ckgagan\/.rvm\/rubies\/ruby-1.9.3-p484\/lib -L\/usr\/lib -Wl,-R\/usr\/lib -L\/usr\/local\/lib -Wl,-R\/usr\/local\/lib -L.  -rdynamic -Wl,-export-dynamic     '-Wl,-rpath,\/..\/lib' -Wl,-R -Wl,\/home\/ckgagan\/.rvm\/rubies\/ruby-1.9.3-p484\/lib -L\/home\/ckgagan\/.rvm\/rubies\/ruby-1.9.3-p484\/lib -lruby -lopencv_calib3d  -lpthread -lrt -ldl -lcrypt -lm   -lc\"\nconftest.c: In function \u2018t\u2019:\nconftest.c:4:1: warning: implicit declaration of function \u2018main\u2019 [-Wimplicit-function-declaration]\nchecked program was:\n\/* begin *\/\n 1: #include \"ruby.h\"\n 2: \n 3: \/*top*\/\n 4: int t() { main(); return 0; }\n 5: int main(int argc, char **argv)\n 6: {\n 7:   if (argc &gt; 1000000) {\n 8:     printf(\"%p\", &amp;t);\n 9:   }\n10: \n11:   return 0;\n12: }\n\/* end *\/\n\n--------------------\n\nhave_library: checking for main() in -lopencv_contrib... -------------------- yes\n\n\"gcc -o conftest -I\/home\/ckgagan\/.rvm\/rubies\/ruby-1.9.3-p484\/include\/ruby-1.9.1\/x86_64-linux -I\/home\/ckgagan\/.rvm\/rubies\/ruby-1.9.3-p484\/include\/ruby-1.9.1\/ruby\/backward -I\/home\/ckgagan\/.rvm\/rubies\/ruby-1.9.3-p484\/include\/ruby-1.9.1 -I. -I\/usr\/include -I\/usr\/local\/include     -O3 -ggdb -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration  -fPIC conftest.c  -L. -L\/home\/ckgagan\/.rvm\/rubies\/ruby-1.9.3-p484\/lib -Wl,-R\/home\/ckgagan\/.rvm\/rubies\/ruby-1.9.3-p484\/lib -L\/usr\/lib -Wl,-R\/usr\/lib -L\/usr\/local\/lib -Wl,-R\/usr\/local\/lib -L.  -rdynamic -Wl,-export-dynamic    -lopencv_calib3d  '-Wl,-rpath,\/..\/lib' -Wl,-R -Wl,\/home\/ckgagan\/.rvm\/rubies\/ruby-1.9.3-p484\/lib -L\/home\/ckgagan\/.rvm\/rubies\/ruby-1.9.3-p484\/lib -lruby -lopencv_contrib -lopencv_calib3d  -lpthread -lrt -ldl -lcrypt -lm   -lc\"\nconftest.c: In function \u2018t\u2019:\nconftest.c:4:53: error: \u2018main\u2019 undeclared (first use in this function)\nconftest.c:4:53: note: each undeclared identifier is reported only once for each function it appears in\nconftest.c:4:28: warning: variable \u2018p\u2019 set but not used [-Wunused-but-set-variable]\nchecked program was:\n\/* begin *\/\n 1: #include \"ruby.h\"\n 2: \n 3: \/*top*\/\n 4: int t() { void ((*volatile p)()); p = (void ((*)()))main; return 0; }\n 5: int main(int argc, char **argv)\n 6: {\n 7:   if (argc &gt; 1000000) {\n 8:     printf(\"%p\", &amp;t);\n 9:   }\n10: \n11:   return 0;\n12: }\n\/* end *\/\n\n\"gcc -o conftest -I\/home\/ckgagan\/.rvm\/rubies\/ruby-1.9.3-p484\/include\/ruby-1.9.1\/x86_64-linux -I\/home\/ckgagan\/.rvm\/rubies\/ruby-1.9.3-p484\/include\/ruby-1.9.1\/ruby\/backward -I\/home\/ckgagan\/.rvm\/rubies\/ruby-1.9.3-p484\/include\/ruby-1.9.1 -I. -I\/usr\/include -I\/usr\/local\/include     -O3 -ggdb -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration  -fPIC conftest.c  -L. -L\/home\/ckgagan\/.rvm\/rubies\/ruby-1.9.3-p484\/lib -Wl,-R\/home\/ckgagan\/.rvm\/rubies\/ruby-1.9.3-p484\/lib -L\/usr\/lib -Wl,-R\/usr\/lib -L\/usr\/local\/lib -Wl,-R\/usr\/local\/lib -L.  -rdynamic -Wl,-export-dynamic    -lopencv_calib3d  '-Wl,-rpath,\/..\/lib' -Wl,-R -Wl,\/home\/ckgagan\/.rvm\/rubies\/ruby-1.9.3-p484\/lib -L\/home\/ckgagan\/.rvm\/rubies\/ruby-1.9.3-p484\/lib -lruby -lopencv_contrib -lopencv_calib3d  -lpthread -lrt -ldl -lcrypt -lm   -lc\"\nconftest.c: In function \u2018t\u2019:\nconftest.c:4:1: warning: implicit declaration of function \u2018main\u2019 [-Wimplicit-function-declaration]\nchecked program was:\n\/* begin *\/\n 1: #include \"ruby.h\"\n 2: \n 3: \/*top*\/\n 4: int t() { main(); return 0; }\n 5: int main(int argc, char **argv)\n 6: {\n 7:   if (argc &gt; 1000000) {\n 8:     printf(\"%p\", &amp;t);\n 9:   }\n10: \n11:   return 0;\n12: }\n\/* end *\/\n\n--------------------\n\nhave_library: checking for main() in -lopencv_core... -------------------- yes\n\n\"gcc -o conftest -I\/home\/ckgagan\/.rvm\/rubies\/ruby-1.9.3-p484\/include\/ruby-1.9.1\/x86_64-linux -I\/home\/ckgagan\/.rvm\/rubies\/ruby-1.9.3-p484\/include\/ruby-1.9.1\/ruby\/backward -I\/home\/ckgagan\/.rvm\/rubies\/ruby-1.9.3-p484\/include\/ruby-1.9.1 -I. -I\/usr\/include -I\/usr\/local\/include     -O3 -ggdb -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration  -fPIC conftest.c  -L. -L\/home\/ckgagan\/.rvm\/rubies\/ruby-1.9.3-p484\/lib -Wl,-R\/home\/ckgagan\/.rvm\/rubies\/ruby-1.9.3-p484\/lib -L\/usr\/lib -Wl,-R\/usr\/lib -L\/usr\/local\/lib -Wl,-R\/usr\/local\/lib -L.  -rdynamic -Wl,-export-dynamic    -lopencv_contrib -lopencv_calib3d  '-Wl,-rpath,\/..\/lib' -Wl,-R -Wl,\/home\/ckgagan\/.rvm\/rubies\/ruby-1.9.3-p484\/lib -L\/home\/ckgagan\/.rvm\/rubies\/ruby-1.9.3-p484\/lib -lruby -lopencv_core -lopencv_contrib -lopencv_calib3d  -lpthread -lrt -ldl -lcrypt -lm   -lc\"\nconftest.c: In function \u2018t\u2019:\nconftest.c:4:53: error: \u2018main\u2019 undeclared (first use in this function)\nconftest.c:4:53: note: each undeclared identifier is reported only once for each function it appears in\nconftest.c:4:28: warning: variable \u2018p\u2019 set but not used [-Wunused-but-set-variable]\nchecked program was:\n\/* begin *\/\n 1: #include \"ruby.h\"\n 2: \n 3: \/*top*\/\n 4: int t() { void ((*volatile p)()); p = (void ((*)()))main; return 0; }\n 5: int main(int argc, char **argv)\n 6: {\n 7:   if (argc &gt; 1000000) {\n 8:     printf(\"%p\", &amp;t);\n 9:   }\n10: \n11:   return 0;\n12: }\n\/* end *\/\n\n\"gcc -o conftest -I\/home\/ckgagan\/.rvm\/rubies\/ruby-1.9.3-p484\/include\/ruby-1.9.1\/x86_64-linux -I\/home\/ckgagan\/.rvm\/rubies\/ruby-1.9.3-p484\/include\/ruby-1.9.1\/ruby\/backward -I\/home\/ckgagan\/.rvm\/rubies\/ruby-1.9.3-p484\/include\/ruby-1.9.1 -I. -I\/usr\/include -I\/usr\/local\/include     -O3 -ggdb -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration  -fPIC conftest.c  -L. -L\/home\/ckgagan\/.rvm\/rubies\/ruby-1.9.3-p484\/lib -Wl,-R\/home\/ckgagan\/.rvm\/rubies\/ruby-1.9.3-p484\/lib -L\/usr\/lib -Wl,-R\/usr\/lib -L\/usr\/local\/lib -Wl,-R\/usr\/local\/lib -L.  -rdynamic -Wl,-export-dynamic    -lopencv_contrib -lopencv_calib3d  '-Wl,-rpath,\/..\/lib' -Wl,-R -Wl,\/home\/ckgagan\/.rvm\/rubies\/ruby-1.9.3-p484\/lib -L\/home\/ckgagan\/.rvm\/rubies\/ruby-1.9.3-p484\/lib -lruby -lopencv_core -lopencv_contrib -lopencv_calib3d  -lpthread -lrt -ldl -lcrypt -lm   -lc\"\nconftest.c: In function \u2018t\u2019:\nconftest.c:4:1: warning: implicit declaration of function \u2018main\u2019 [-Wimplicit-function-declaration]\nchecked program was:\n\/* begin *\/\n 1: #include \"ruby.h\"\n 2: \n 3: \/*top*\/\n 4: int t() { main(); return 0; }\n 5: int main(int argc, char **argv)\n 6: {\n 7:   if (argc &gt; 1000000) {\n 8:     printf(\"%p\", &amp;t);\n 9:   }\n10: \n11:   return 0;\n12: }\n\/* end *\/\n\n--------------------\n\nhave_library: checking for main() in -lopencv_features2d... -------------------- yes\n\n\"gcc -o conftest -I\/home\/ckgagan\/.rvm\/rubies\/ruby-1.9.3-p484\/include\/ruby-1.9.1\/x86_64-linux -I\/home\/ckgagan\/.rvm\/rubies\/ruby-1.9.3-p484\/include\/ruby-1.9.1\/ruby\/backward -I\/home\/ckgagan\/.rvm\/rubies\/ruby-1.9.3-p484\/include\/ruby-1.9.1 -I. -I\/usr\/include -I\/usr\/local\/include     -O3 -ggdb -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration  -fPIC conftest.c  -L. -L\/home\/ckgagan\/.rvm\/rubies\/ruby-1.9.3-p484\/lib -Wl,-R\/home\/ckgagan\/.rvm\/rubies\/ruby-1.9.3-p484\/lib -L\/usr\/lib -Wl,-R\/usr\/lib -L\/usr\/local\/lib -Wl,-R\/usr\/local\/lib -L.  -rdynamic -Wl,-export-dynamic    -lopencv_core -lopencv_contrib -lopencv_calib3d  '-Wl,-rpath,\/..\/lib' -Wl,-R -Wl,\/home\/ckgagan\/.rvm\/rubies\/ruby-1.9.3-p484\/lib -L\/home\/ckgagan\/.rvm\/rubies\/ruby-1.9.3-p484\/lib -lruby -lopencv_features2d -lopencv_core -lopencv_contrib -lopencv_calib3d  -lpthread -lrt -ldl -lcrypt -lm   -lc\"\nconftest.c: In function \u2018t\u2019:\nconftest.c:4:53: error: \u2018main\u2019 undeclared (first use in this function)\nconftest.c:4:53: note: each undeclared identifier is reported only once for each function it appears in\nconftest.c:4:28: warning: variable \u2018p\u2019 set but not used [-Wunused-but-set-variable]\nchecked program was:\n\/* begin *\/\n 1: #include \"ruby.h\"\n 2: \n 3: \/*top*\/\n 4: int t() { void ((*volatile p)()); p = (void ((*)()))main; return 0; }\n 5: int main(int argc, char **argv)\n 6: {\n 7:   if (argc &gt; 1000000) {\n 8:     printf(\"%p\", &amp;t);\n 9:   }\n10: \n11:   return 0;\n12: }\n\/* end *\/\n\n\"gcc -o conftest -I\/home\/ckgagan\/.rvm\/rubies\/ruby-1.9.3-p484\/include\/ruby-1.9.1\/x86_64-linux -I\/home\/ckgagan\/.rvm\/rubies\/ruby-1.9.3-p484\/include\/ruby-1.9.1\/ruby\/backward -I\/home\/ckgagan\/.rvm\/rubies\/ruby-1.9.3-p484\/include\/ruby-1.9.1 -I. -I\/usr\/include -I\/usr\/local\/include     -O3 -ggdb -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration  -fPIC conftest.c  -L. -L\/home\/ckgagan\/.rvm\/rubies\/ruby-1.9.3-p484\/lib -Wl,-R\/home\/ckgagan\/.rvm\/rubies\/ruby-1.9.3-p484\/lib -L\/usr\/lib -Wl,-R\/usr\/lib -L\/usr\/local\/lib -Wl,-R\/usr\/local\/lib -L.  -rdynamic -Wl,-export-dynamic    -lopencv_core -lopencv_contrib -lopencv_calib3d  '-Wl,-rpath,\/..\/lib' -Wl,-R -Wl,\/home\/ckgagan\/.rvm\/rubies\/ruby-1.9.3-p484\/lib -L\/home\/ckgagan\/.rvm\/rubies\/ruby-1.9.3-p484\/lib -lruby -lopencv_features2d -lopencv_core -lopencv_contrib -lopencv_calib3d  -lpthread -lrt -ldl -lcrypt -lm   -lc\"\nconftest.c: In function \u2018t\u2019:\nconftest.c:4:1: warning: implicit declaration of function \u2018main\u2019 [-Wimplicit-function-declaration]\nchecked program was:\n\/* begin *\/\n 1: #include \"ruby.h\"\n 2: \n 3: \/*top*\/\n 4: int t() { main(); return 0; }\n 5: int main(int argc, char **argv)\n 6: {\n 7:   if (argc &gt; 1000000) {\n 8:     printf(\"%p\", &amp;t);\n 9:   }\n10: \n11:   return 0;\n12: }\n\/* end *\/\n\n--------------------\n\nhave_library: checking for main() in -lopencv_flann... -------------------- yes\n\n\"gcc -o conftest -I\/home\/ckgagan\/.rvm\/rubies\/ruby-1.9.3-p484\/include\/ruby-1.9.1\/x86_64-linux -I\/home\/ckgagan\/.rvm\/rubies\/ruby-1.9.3-p484\/include\/ruby-1.9.1\/ruby\/backward -I\/home\/ckgagan\/.rvm\/rubies\/ruby-1.9.3-p484\/include\/ruby-1.9.1 -I. -I\/usr\/include -I\/usr\/local\/include     -O3 -ggdb -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration  -fPIC conftest.c  -L. -L\/home\/ckgagan\/.rvm\/rubies\/ruby-1.9.3-p484\/lib -Wl,-R\/home\/ckgagan\/.rvm\/rubies\/ruby-1.9.3-p484\/lib -L\/usr\/lib -Wl,-R\/usr\/lib -L\/usr\/local\/lib -Wl,-R\/usr\/local\/lib -L.  -rdynamic -Wl,-export-dynamic    -lopencv_features2d -lopencv_core -lopencv_contrib -lopencv_calib3d  '-Wl,-rpath,\/..\/lib' -Wl,-R -Wl,\/home\/ckgagan\/.rvm\/rubies\/ruby-1.9.3-p484\/lib -L\/home\/ckgagan\/.rvm\/rubies\/ruby-1.9.3-p484\/lib -lruby -lopencv_flann -lopencv_features2d -lopencv_core -lopencv_contrib -lopencv_calib3d  -lpthread -lrt -ldl -lcrypt -lm   -lc\"\nconftest.c: In function \u2018t\u2019:\nconftest.c:4:53: error: \u2018main\u2019 undeclared (first use in this function)\nconftest.c:4:53: note: each undeclared identifier is reported only once for each function it appears in\nconftest.c:4:28: warning: variable \u2018p\u2019 set but not used [-Wunused-but-set-variable]\nchecked program was:\n\/* begin *\/\n 1: #include \"ruby.h\"\n 2: \n 3: \/*top*\/\n 4: int t() { void ((*volatile p)()); p = (void ((*)()))main; return 0; }\n 5: int main(int argc, char **argv)\n 6: {\n 7:   if (argc &gt; 1000000) {\n 8:     printf(\"%p\", &amp;t);\n 9:   }\n10: \n11:   return 0;\n12: }\n\/* end *\/\n\n\"gcc -o conftest -I\/home\/ckgagan\/.rvm\/rubies\/ruby-1.9.3-p484\/include\/ruby-1.9.1\/x86_64-linux -I\/home\/ckgagan\/.rvm\/rubies\/ruby-1.9.3-p484\/include\/ruby-1.9.1\/ruby\/backward -I\/home\/ckgagan\/.rvm\/rubies\/ruby-1.9.3-p484\/include\/ruby-1.9.1 -I. -I\/usr\/include -I\/usr\/local\/include     -O3 -ggdb -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration  -fPIC conftest.c  -L. -L\/home\/ckgagan\/.rvm\/rubies\/ruby-1.9.3-p484\/lib -Wl,-R\/home\/ckgagan\/.rvm\/rubies\/ruby-1.9.3-p484\/lib -L\/usr\/lib -Wl,-R\/usr\/lib -L\/usr\/local\/lib -Wl,-R\/usr\/local\/lib -L.  -rdynamic -Wl,-export-dynamic    -lopencv_features2d -lopencv_core -lopencv_contrib -lopencv_calib3d  '-Wl,-rpath,\/..\/lib' -Wl,-R -Wl,\/home\/ckgagan\/.rvm\/rubies\/ruby-1.9.3-p484\/lib -L\/home\/ckgagan\/.rvm\/rubies\/ruby-1.9.3-p484\/lib -lruby -lopencv_flann -lopencv_features2d -lopencv_core -lopencv_contrib -lopencv_calib3d  -lpthread -lrt -ldl -lcrypt -lm   -lc\"\nconftest.c: In function \u2018t\u2019:\nconftest.c:4:1: warning: implicit declaration of function \u2018main\u2019 [-Wimplicit-function-declaration]\nchecked program was:\n\/* begin *\/\n 1: #include \"ruby.h\"\n 2: \n 3: \/*top*\/\n 4: int t() { main(); return 0; }\n 5: int main(int argc, char **argv)\n 6: {\n 7:   if (argc &gt; 1000000) {\n 8:     printf(\"%p\", &amp;t);\n 9:   }\n10: \n11:   return 0;\n12: }\n\/* end *\/\n\n--------------------\n\nhave_library: checking for main() in -lopencv_gpu... -------------------- no\n\n\"gcc -o conftest -I\/home\/ckgagan\/.rvm\/rubies\/ruby-1.9.3-p484\/include\/ruby-1.9.1\/x86_64-linux -I\/home\/ckgagan\/.rvm\/rubies\/ruby-1.9.3-p484\/include\/ruby-1.9.1\/ruby\/backward -I\/home\/ckgagan\/.rvm\/rubies\/ruby-1.9.3-p484\/include\/ruby-1.9.1 -I. -I\/usr\/include -I\/usr\/local\/include     -O3 -ggdb -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration  -fPIC conftest.c  -L. -L\/home\/ckgagan\/.rvm\/rubies\/ruby-1.9.3-p484\/lib -Wl,-R\/home\/ckgagan\/.rvm\/rubies\/ruby-1.9.3-p484\/lib -L\/usr\/lib -Wl,-R\/usr\/lib -L\/usr\/local\/lib -Wl,-R\/usr\/local\/lib -L.  -rdynamic -Wl,-export-dynamic    -lopencv_flann -lopencv_features2d -lopencv_core -lopencv_contrib -lopencv_calib3d  '-Wl,-rpath,\/..\/lib' -Wl,-R -Wl,\/home\/ckgagan\/.rvm\/rubies\/ruby-1.9.3-p484\/lib -L\/home\/ckgagan\/.rvm\/rubies\/ruby-1.9.3-p484\/lib -lruby -lopencv_gpu -lopencv_flann -lopencv_features2d -lopencv_core -lopencv_contrib -lopencv_calib3d  -lpthread -lrt -ldl -lcrypt -lm   -lc\"\nconftest.c: In function \u2018t\u2019:\nconftest.c:4:53: error: \u2018main\u2019 undeclared (first use in this function)\nconftest.c:4:53: note: each undeclared identifier is reported only once for each function it appears in\nconftest.c:4:28: warning: variable \u2018p\u2019 set but not used [-Wunused-but-set-variable]\nchecked program was:\n\/* begin *\/\n 1: #include \"ruby.h\"\n 2: \n 3: \/*top*\/\n 4: int t() { void ((*volatile p)()); p = (void ((*)()))main; return 0; }\n 5: int main(int argc, char **argv)\n 6: {\n 7:   if (argc &gt; 1000000) {\n 8:     printf(\"%p\", &amp;t);\n 9:   }\n10: \n11:   return 0;\n12: }\n\/* end *\/\n\n\"gcc -o conftest -I\/home\/ckgagan\/.rvm\/rubies\/ruby-1.9.3-p484\/include\/ruby-1.9.1\/x86_64-linux -I\/home\/ckgagan\/.rvm\/rubies\/ruby-1.9.3-p484\/include\/ruby-1.9.1\/ruby\/backward -I\/home\/ckgagan\/.rvm\/rubies\/ruby-1.9.3-p484\/include\/ruby-1.9.1 -I. -I\/usr\/include -I\/usr\/local\/include     -O3 -ggdb -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration  -fPIC conftest.c  -L. -L\/home\/ckgagan\/.rvm\/rubies\/ruby-1.9.3-p484\/lib -Wl,-R\/home\/ckgagan\/.rvm\/rubies\/ruby-1.9.3-p484\/lib -L\/usr\/lib -Wl,-R\/usr\/lib -L\/usr\/local\/lib -Wl,-R\/usr\/local\/lib -L.  -rdynamic -Wl,-export-dynamic    -lopencv_flann -lopencv_features2d -lopencv_core -lopencv_contrib -lopencv_calib3d  '-Wl,-rpath,\/..\/lib' -Wl,-R -Wl,\/home\/ckgagan\/.rvm\/rubies\/ruby-1.9.3-p484\/lib -L\/home\/ckgagan\/.rvm\/rubies\/ruby-1.9.3-p484\/lib -lruby -lopencv_gpu -lopencv_flann -lopencv_features2d -lopencv_core -lopencv_contrib -lopencv_calib3d  -lpthread -lrt -ldl -lcrypt -lm   -lc\"\nconftest.c: In function \u2018t\u2019:\nconftest.c:4:1: warning: implicit declaration of function \u2018main\u2019 [-Wimplicit-function-declaration]\n\/usr\/bin\/ld: cannot find -lopencv_gpu\ncollect2: error: ld returned 1 exit status\nchecked program was:\n\/* begin *\/\n 1: #include \"ruby.h\"\n 2: \n 3: \/*top*\/\n 4: int t() { main(); return 0; }\n 5: int main(int argc, char **argv)\n 6: {\n 7:   if (argc &gt; 1000000) {\n 8:     printf(\"%p\", &amp;t);\n 9:   }\n10: \n11:   return 0;\n12: }\n\/* end *\/\n\n--------------------\n<\/code><\/pre>\n<p>Thanks<\/p>\n<\/li>\n","protected":false},"excerpt":{"rendered":"<p>Gagan I am unable to install ruby-opencv gem. Here&#8217;s what I have done so far. Installed openCV with sudo apt-get install libopencv-dev Then tried installing ruby-opencv gem with gem install ruby-opencv But I got the following error ? test gem install ruby-opencv Building native extensions. This could take a while&#8230; ERROR: Error installing ruby-opencv: ERROR: [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-7287","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/7287","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=7287"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/7287\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=7287"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=7287"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=7287"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}