I have installed opencv using the following commands: git clone https://github.com/jayrambhia/Install-OpenCV.git
cd Install-OpenCV/
./dependencies.sh
./opencv_latest.sh
this gave me the following message:
Package ffmpeg is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
Deciding that this may or may not matter I went on into codeblock and created a default opencv template project.
#include <opencv2/core/core.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/highgui/highgui.hpp>
using namespace cv;
int main(int argc, char *argv[])
{
Mat img = imread("lena.jpg", CV_LOAD_IMAGE_COLOR);
if(img.empty())
return -1;
namedWindow( "lena", CV_WINDOW_AUTOSIZE );
imshow("lena", img);
waitKey(0);
return 0;
}
This showed no errors but on compile gave me the following errors:
AR: 9 undfined reference to 'cv::imread(std::string const&,int)'
AR: 12 undfined reference to 'cv::na(std::string const&,int)'
AR: 13 undfined reference to 'cv::InputArray::_InputArray(cv::Mat const&)'
AR: 13 undfined reference to 'cv::imshow(std::string const&, cv::InputArray(const&)'
AR: 14 undfined reference to 'cv::waitKey(int)'
usr/include/opencv... 278 undfined reference to 'cv::fastFree(void*)'
usr/include/opencv... 367 undfined reference to 'cv::Mat::deallocate()'
running the getlatest under sudo instead gave me the following exchange:
sudo ./opencv_latest.sh
... some normal looking stuff...
./opencv_latest.sh: 7: ./opencv_install.sh: [[: not found
./opencv_latest.sh: 11: ./opencv_install.sh: [[: not found
./opencv_latest.sh: 15: ./opencv_install.sh: [[: not found
--- Installing OpenCV 2.4.9
--- Installing Dependencies
./opencv_latest.sh: 27: ./opencv_install.sh: source: not found
Attempting to do what they did here: http://docs.opencv.org/doc/tutorials/introduction/linux_install/linux_install.html#linux-installation gave me the following result:
Prg1@KILLBOX:/usr/include/opencv2/release$ cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/include/opencv2
CMake Error: The source directory "/usr/include/opencv2/release/CMAKE_INSTALL_PREFIX=/usr/include/opencv2" does not exist.
Specify --help for usage, or press the help button on the CMake GUI.
Here are picks of my linker and compiler settings:
So anybody know what I'm doing wrong this is on ubuntu 14.04 LTS and codeblocks
edit: using ldconfig -p | grep opencv gave me a mountain of opencv files that should mean it's installed right, right? So it the problem with the linker and compiler? Note that linker settings in the compiler settings (not the search directories) show the opencv libs as being empty so which one is it? By the way clicking on the error messages in codeblocks (the once inside the opencv lib) does in fact bring up pieces of the opencv lib which look like the proper lines of code to be at that position (as in they contain functions that the log shows as missing)