Ask Your Question
1

opencv3.3.0 undefined reference to cv::String::deallocate() (in cvstd.hpp)

asked 2017-09-07 15:33:01 -0600

Loyd gravatar image

I am using Visual Studio 2017 Community edition (Linux development with C++ workload) to develop openCV3.3.0 C++ code for the Raspberry Pi 3. I get the following output when I try to compile:

1>------ Rebuild All started: Project: PiCarHello, Configuration: Debug ARM ------ 1>Cleaning remote project directory 1>Validating architecture 1>Validating sources 1>Copying sources remotely to '192.168.1.81' 1>Starting remote build 1>Compiling sources: 1>PiCarHello.cpp 1>Linking objects 1>/home/pi/projects/PiCarHello/obj/ARM/Debug/PiCarHello.o: In function cv::String::~String()': 1>/usr/local/include/opencv2/core/cvstd.hpp:647: undefined reference tocv::String::deallocate()' 1>/home/pi/projects/PiCarHello/obj/ARM/Debug/PiCarHello.o: In function cv::String::operator=(cv::String const&)': 1>/usr/local/include/opencv2/core/cvstd.hpp:655: undefined reference tocv::String::deallocate()' 1>collect2: error: ld returned 1 exit status 1>D:\Users\Loyd\Documents\Software\PiCar-old\PiCarHello\obj\ARM\Debug\PiCarHello.o: In function cv::String: : error : 1>/usr/local/include/opencv2/core/cvstd.hpp:647: undefined reference tocv::String : error : deallocate()' 1>D:\Users\Loyd\Documents\Software\PiCar-old\PiCarHello\obj\ARM\Debug\PiCarHello.o: In function cv::String::operator=(cv: : error : 1>/usr/local/include/opencv2/core/cvstd.hpp:655: undefined reference tocv::String : error : deallocate()' 1>collect2 : error : ld returned 1 exit status 1>Done building project "PiCarHello.vcxproj" -- FAILED. ========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

I have no idea why this is happening or what to do about it. Sure would appreciate any help that you might be able to supply. Thanks so much.

edit retag flag offensive close merge delete

Comments

Incidentally this is the code that is being compiled:

include <cstdio>

include <opencv2 opencv.hpp="">

using namespace cv;

int main() { printf("hello from PiCarHello!\n"); return 0; }

If I compile the code on the Raspberry Pi 3 using the following command:

g++ $(pkg-config --libs --cflags opencv) -o PiCarHello PiCarHello.cpp

(as recommended on http://pklab.net/index.php?lang=EN&id... ), IT WORKS.

Loyd gravatar imageLoyd ( 2017-09-07 15:48:03 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2017-09-15 13:10:19 -0600

Loyd gravatar image

Well, I left this problem to stew for a while and worked on other things with the Raspberry Pi. I did a lot of trial and error with setting the properties for the Visual Studio project and finally got it to work! Looks like it was just a matter of selecting the right properties and setting them with the correct values. For the record, here are the properties that need to be changed and the values to be added to track a ball:

C/C++ Additional Include Directories: /usr/local/include/opencv;/usr/local/include;...

Linker Additional Library Directories: /usr/local/lib;...

Linker Library Dependencies: opencv_core;opencv_highgui;opencv_videoio;opencv_imgproc;...

edit flag offensive delete link more

Comments

COUld you put command line please , i have the same issut

zakaziko gravatar imagezakaziko ( 2020-01-13 07:42:09 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2017-09-07 15:33:01 -0600

Seen: 16,316 times

Last updated: Sep 15 '17