Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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

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)

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 ?

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

Hi,

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


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

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

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*)' cv::fastFree(void)' collect2: ld returned 1 exit status

status make: * * [test] Error 1


Can you help me solve this problem please ?