Ask Your Question

Revision history [back]

Undefined symbols for architecture x86_64 [MACOS with Terminal]

Hello developers, I want to compile my C++ code in the terminal. But I have some errors looks like that:

Undefined symbols for architecture x86_64: "cv::Mat::deallocate()", referenced from: cv::Mat::release() in main-9ae616.o "cv::imread(std::__1::basic_string<char, std::__1::char_traits,="" std::__1::allocator="" &gt;="" const&amp;,="" int)",="" referenced="" from:="" _main="" in="" main-9ae616.o="" "cv::imshow(std::__1::basic_string<char,="" std::__1::char_traits,="" std::__1::allocator="" &gt;="" const&amp;,="" cv::_inputarray="" const&amp;)",="" referenced="" from:="" _main="" in="" main-9ae616.o="" "cv::waitkey(int)",="" referenced="" from:="" _main="" in="" main-9ae616.o="" "cv::fastfree(void*)",="" referenced="" from:="" cv::mat::~mat()="" in="" main-9ae616.o="" ld:="" symbol(s)="" not="" found="" for="" architecture="" x86_64="" clang:="" error:="" linker="" command="" failed="" with="" exit="" code="" 1="" (use="" -v="" to="" see="" invocation)<="" p="">

My command:

g++ -std=c++11 -o out main.cpp

How to solve this issue? help me, please?

click to hide/show revision 2
retagged

updated 2019-10-01 03:37:08 -0600

berak gravatar image

Undefined symbols for architecture x86_64 [MACOS with Terminal]

Hello developers, I want to compile my C++ code in the terminal. But I have some errors looks like that:

Undefined symbols for architecture x86_64: "cv::Mat::deallocate()", referenced from: cv::Mat::release() in main-9ae616.o "cv::imread(std::__1::basic_string<char, std::__1::char_traits,="" std::__1::allocator="" &gt;="" const&amp;,="" int)",="" referenced="" from:="" _main="" in="" main-9ae616.o="" "cv::imshow(std::__1::basic_string<char,="" std::__1::char_traits,="" std::__1::allocator="" &gt;="" const&amp;,="" cv::_inputarray="" const&amp;)",="" referenced="" from:="" _main="" in="" main-9ae616.o="" "cv::waitkey(int)",="" referenced="" from:="" _main="" in="" main-9ae616.o="" "cv::fastfree(void*)",="" referenced="" from:="" cv::mat::~mat()="" in="" main-9ae616.o="" ld:="" symbol(s)="" not="" found="" for="" architecture="" x86_64="" clang:="" error:="" linker="" command="" failed="" with="" exit="" code="" 1="" (use="" -v="" to="" see="" invocation)<="" p="">

My command:

g++ -std=c++11 -o out main.cpp

How to solve this issue? help me, please?