OpenCv 3.1.0 undefined reference to imread
<p>This is what my code looks like, I got the undefined reference to <code>imread</code> and so on:</p>

<pre><code>#include &lt;iostream&gt;
#include &lt;opencv2/opencv.hpp&gt;

using namespace std;

using namespace cv;

int main( int argc, const char** argv )
{
    Mat img = imread("MyPicture.jpg", CV_LOAD_IMAGE_UNCHANGED); //read the image  data in the file "MyPic.JPG" and store it in 'img'

    if (img.empty()) //check whether the image is loaded or not
    {
        cout &lt;&lt; "Error : Image cannot be loaded..!!" &lt;&lt; endl;
        //system("pause"); //wait for a key press
        return -1;
    }

    namedWindow("MyWindow", CV_WINDOW_AUTOSIZE); //create a window with the name "MyWindow"
    imshow("MyWindow", img); //display the image which is stored in the 'img' in the "MyWindow" window

    waitKey(0); //wait infinite time for a keypress

    destroyWindow("MyWindow"); //destroy the window with the name, "MyWindow"

    return 0;
}
</code></pre>

<p>I am using Codeblocks and the g++ compiler. Also I have linked the <code>opencv_world310d.lib</code> to <code>debug</code> and <code>opencv_world310.lib</code> to <code>release</code>.
Plus I have given the path in searchdirectory compiler and linker.
Any hints?</p>