Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

cvstd.hpp:622: undefined reference to `cv::String::allocate(unsigned long long)

Hi, i've recently installed opencv 3.4, built it and added the includes to eclipse, library path and linked the libraries as well.

I am getting a build error and i'm not sure what to do next, i cant find any solutions online that can help me. It's possible i have maybe setup something wrong?

Error from eclipse:

13:23:32 * Incremental Build of configuration Debug for project Vision * Info: Internal Builder is used for build g++ "-LC:\cygwin64\lib" -o Vision.exe main.o -lopencv_video -lopencv_videoio -lopencv_imgproc -lopencv_highgui -lopencv_core main.o: In function cv::String::String(char const*)': C:/Users/*****/Documents/opencv/build/include/opencv2/core/cvstd.hpp:622: undefined reference tocv::String::allocate(unsigned long long)' collect2.exe: error: ld returned 1 exit status 13:23:32 Build Finished (took 316ms)

Code is take from opencv exmple:

#include "opencv2/opencv.hpp"
#include "opencv2/core/cvstd.hpp"
using namespace cv;

int main(int, char**)
{
    VideoCapture cap(0); // open the default camera
    if(!cap.isOpened())  // check if we succeeded
        return -1;

    namedWindow("Video",1);
    while(1)
    {
        Mat frame;
        cap >> frame;         // get a new frame from camera
        imshow("Video", frame);

        // Press 'c' to escape
        if(waitKey(30) == 'c') break;
    }
    return 0;
}

If i remove imshow("Video", frame); it removes the error.

Any help or a point in the right direction would really very much be appreciated.

Thank you very much