First time here? Check out the FAQ!

Ask Your Question
0

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

asked Jun 3 '13

asqz gravatar image

updated Jun 3 '13

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 ?

Preview: (hide)

1 answer

Sort by » oldest newest most voted
0

answered Jun 5 '13

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/

Preview: (hide)

Question Tools

Stats

Asked: Jun 3 '13

Seen: 27,481 times

Last updated: Jun 05 '13