Ask Your Question
0

undefined reference to cv::Mat::deallocate()

asked 2013-06-03 08:23:30 -0600

asqz gravatar image

updated 2013-06-03 08:27:03 -0600

Hi, I am trying to compile my program, using this makefile :


CXXFLAGS += pkg-config opencv --cflags

LDFLAGS += pkg-config opencv --libs

TARGET = test

$(TARGET): $(OBJS) $(CXX) -o $(TARGET) $(LDFLAGS) $(OBJS)

%.o: %.cpp $(CXX) -o $@ -c $< $(CXXFLAGS) $(LIBS)

all: $(TARGET)


The source code is test.cpp :


#include <cv.h> #include <highgui.h>

int main(void) { cv::Mat image; }


It trigger the following error message :


g++ -o test.o -c test.cpp -O2 -g -Wall -fmessage-length=0 pkg-config opencv --cflags g++ -o test pkg-config opencv --libs test.o test.o: In function cv::Mat::release()': /usr/include/opencv2/core/mat.hpp:382: undefined reference tocv::Mat::deallocate()' test.o: In function ~Mat': /usr/include/opencv2/core/mat.hpp:297: undefined reference tocv::fastFree(void)' collect2: ld returned 1 exit status make: ** [test] Error 1


Can you help me solve this problem please ?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2013-06-05 08:46:43 -0600

asqz gravatar image

The problem is that the makefile I am using is incorrect. You can find a correct makefile at this address : http://answers.opencv.org/question/14611/example-of-makefile/

edit flag offensive delete link more

Question Tools

Stats

Asked: 2013-06-03 08:23:30 -0600

Seen: 27,279 times

Last updated: Jun 05 '13