OpenCV Undefined Reference: cv::xfeature2d::BriefDescriptorExtractor::create(int, bool)Unable to make OpenCVWhat is an undefined reference/unresolved external symbol error and how do I fix it?Connecting OpenCV with netbeans 7.3.1CMake Error while configuring CUDA with OpenCVOpenCV 3: List of available FeatureDetector::create() and DescriptorExtractor::create() options?Error at installing Caffe in Ubuntu 17.04 (libhdf5.so)Running multiple versions of OpenCV on the same computerOpenCV installationContinuous compile time I get error 90% after opencvde make command. More information is availableopencv-3.3.0 Stops compiling at 58%

Is the first derivative operation on a signal a causal system?

Is there any use case for the bottom type as a function parameter type?

1960s sci-fi novella with a character who is treated as invisible by being ignored

Riley Rebuses that Share a Common Theme

What are the benefits of cryosleep?

Why colon to denote that a value belongs to a type?

At what point in European history could a government build a printing press given a basic description?

Canon 70D often overexposing or underexposing shots

Employer asking for online access to bank account - Is this a scam?

Can a Beholder use rays in melee range?

Can't remember the name of this game

Which noble houses were destroyed during the Game of Thrones?

When did God say "let all the angels of God worship him" as stated in Hebrews 1:6?

I think I may have violated academic integrity last year - what should I do?

Can you heal a summoned creature?

Placing bypass capacitors after VCC reaches the IC

Were pen cap holes designed to prevent death by suffocation if swallowed?

Tabulated absorption spectra of greenhouse gases?

I unknowingly submitted plagiarised work

How can people dance around bonfires on Lag Lo'Omer - it's darchei emori?

When do characters level up?

Rotation period of a planet around a star (sun)

What is the 中 in ダウンロード中?

What are these (utility?) boxes at the side of the house?



OpenCV Undefined Reference: cv::xfeature2d::BriefDescriptorExtractor::create(int, bool)


Unable to make OpenCVWhat is an undefined reference/unresolved external symbol error and how do I fix it?Connecting OpenCV with netbeans 7.3.1CMake Error while configuring CUDA with OpenCVOpenCV 3: List of available FeatureDetector::create() and DescriptorExtractor::create() options?Error at installing Caffe in Ubuntu 17.04 (libhdf5.so)Running multiple versions of OpenCV on the same computerOpenCV installationContinuous compile time I get error 90% after opencvde make command. More information is availableopencv-3.3.0 Stops compiling at 58%






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















I intend to use Brief descriptor. But I am getting this undefined reference error. There is no problem with building the code. But the linker gives the error. Please let me know what have I missed. Thanks in advance.



Here's the code



#include <iostream>
#include <cmath>
#include "opencv2/opencv.hpp"
#include "opencv2/xfeatures2d.hpp"
#include "harris_corner.h"

using namespace std;

class KeypointDescriptor

public:

KeypointDescriptor();

virtual ~KeypointDescriptor()

void generate_keypoints(HarrisCorner&, cv::Mat&);
void compute_descriptor(HarrisCorner&, cv::Mat&);

cv::Ptr<cv::xfeatures2d::BriefDescriptorExtractor> desc_extr = cv::xfeatures2d::BriefDescriptorExtractor::create();
cv::Mat descriptors;
vector<cv::KeyPoint> kp;

;


The CMakeLists.txt is as below



cmake_minimum_required(VERSION 3.5)
project(Harris_Corner_Detector_fromScratch)

IF(NOT CMAKE_BUILD_TYPE)
SET(CMAKE_BUILD_TYPE Debug)
ENDIF()

set(CMAKE_MODULE_PATH $PROJECT_SOURCE_DIR/build/cmake)

find_package(OpenCV REQUIRED)

add_compile_options(-std=c++11)

include_directories(include
$PROJECT_SOURCE_DIR/
$PROJECT_SOURCE_DIR/include/
$OpenCV_INCLUDE_DIRS
)

add_library(HarrisCorner SHARED src/source_code/harris_corner.cpp)
add_library(KeypointDescriptor SHARED src/source_code/keypoint_descriptor.cpp)

add_executable(find_corner src/find_corner.cpp)
target_link_libraries(find_corner $OpenCV_LIBS
HarrisCorner)

add_executable(stitch_image src/stitch_image.cpp)
target_link_libraries(stitch_image $OpenCV_LIBS
HarrisCorner
KeypointDescriptor)


The output is as follows



-- Configuring done
-- Generating done
-- Build files have been written to: /home/tyagaraja/WPI/ARN/HW/Week10/Harris_Corner_Detector_fromScratch/build
[ 25%] Built target HarrisCorner
[ 50%] Built target KeypointDescriptor
[ 62%] Linking CXX executable stitch_image
libKeypointDescriptor.so: undefined reference to `cv::xfeatures2d::BriefDescriptorExtractor::create(int, bool)'
collect2: error: ld returned 1 exit status
CMakeFiles/stitch_image.dir/build.make:141: recipe for target 'stitch_image' failed
make[2]: *** [stitch_image] Error 1
CMakeFiles/Makefile2:105: recipe for target 'CMakeFiles/stitch_image.dir/all' failed
make[1]: *** [CMakeFiles/stitch_image.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2


I am using OpenCV that comes default with ROS Kinetic










share|improve this question






















  • Show results from message($OpenCV_LIBS) in your CMakeLists.txt. opencv_xfeatures2d is here?

    – Nuzhny
    Mar 24 at 21:13











  • Yes. opencv_xfeatures2d is there when I do message($OpenCV_LIBS). Sorry I couldn't post the result from the message, since the character limit was reached in comment.

    – Tyagaraja Ramaswamy
    Mar 25 at 0:28











  • Your libraries HarrisCorner and KeypointDescriptor are shared. It need to call target_link_libraries(HarrisCorner $OpenCV_LIBS) and target_link_libraries(KeypointDescriptor $OpenCV_LIBS). For static libraries it don't need to do.

    – Nuzhny
    Mar 25 at 8:22

















0















I intend to use Brief descriptor. But I am getting this undefined reference error. There is no problem with building the code. But the linker gives the error. Please let me know what have I missed. Thanks in advance.



Here's the code



#include <iostream>
#include <cmath>
#include "opencv2/opencv.hpp"
#include "opencv2/xfeatures2d.hpp"
#include "harris_corner.h"

using namespace std;

class KeypointDescriptor

public:

KeypointDescriptor();

virtual ~KeypointDescriptor()

void generate_keypoints(HarrisCorner&, cv::Mat&);
void compute_descriptor(HarrisCorner&, cv::Mat&);

cv::Ptr<cv::xfeatures2d::BriefDescriptorExtractor> desc_extr = cv::xfeatures2d::BriefDescriptorExtractor::create();
cv::Mat descriptors;
vector<cv::KeyPoint> kp;

;


The CMakeLists.txt is as below



cmake_minimum_required(VERSION 3.5)
project(Harris_Corner_Detector_fromScratch)

IF(NOT CMAKE_BUILD_TYPE)
SET(CMAKE_BUILD_TYPE Debug)
ENDIF()

set(CMAKE_MODULE_PATH $PROJECT_SOURCE_DIR/build/cmake)

find_package(OpenCV REQUIRED)

add_compile_options(-std=c++11)

include_directories(include
$PROJECT_SOURCE_DIR/
$PROJECT_SOURCE_DIR/include/
$OpenCV_INCLUDE_DIRS
)

add_library(HarrisCorner SHARED src/source_code/harris_corner.cpp)
add_library(KeypointDescriptor SHARED src/source_code/keypoint_descriptor.cpp)

add_executable(find_corner src/find_corner.cpp)
target_link_libraries(find_corner $OpenCV_LIBS
HarrisCorner)

add_executable(stitch_image src/stitch_image.cpp)
target_link_libraries(stitch_image $OpenCV_LIBS
HarrisCorner
KeypointDescriptor)


The output is as follows



-- Configuring done
-- Generating done
-- Build files have been written to: /home/tyagaraja/WPI/ARN/HW/Week10/Harris_Corner_Detector_fromScratch/build
[ 25%] Built target HarrisCorner
[ 50%] Built target KeypointDescriptor
[ 62%] Linking CXX executable stitch_image
libKeypointDescriptor.so: undefined reference to `cv::xfeatures2d::BriefDescriptorExtractor::create(int, bool)'
collect2: error: ld returned 1 exit status
CMakeFiles/stitch_image.dir/build.make:141: recipe for target 'stitch_image' failed
make[2]: *** [stitch_image] Error 1
CMakeFiles/Makefile2:105: recipe for target 'CMakeFiles/stitch_image.dir/all' failed
make[1]: *** [CMakeFiles/stitch_image.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2


I am using OpenCV that comes default with ROS Kinetic










share|improve this question






















  • Show results from message($OpenCV_LIBS) in your CMakeLists.txt. opencv_xfeatures2d is here?

    – Nuzhny
    Mar 24 at 21:13











  • Yes. opencv_xfeatures2d is there when I do message($OpenCV_LIBS). Sorry I couldn't post the result from the message, since the character limit was reached in comment.

    – Tyagaraja Ramaswamy
    Mar 25 at 0:28











  • Your libraries HarrisCorner and KeypointDescriptor are shared. It need to call target_link_libraries(HarrisCorner $OpenCV_LIBS) and target_link_libraries(KeypointDescriptor $OpenCV_LIBS). For static libraries it don't need to do.

    – Nuzhny
    Mar 25 at 8:22













0












0








0








I intend to use Brief descriptor. But I am getting this undefined reference error. There is no problem with building the code. But the linker gives the error. Please let me know what have I missed. Thanks in advance.



Here's the code



#include <iostream>
#include <cmath>
#include "opencv2/opencv.hpp"
#include "opencv2/xfeatures2d.hpp"
#include "harris_corner.h"

using namespace std;

class KeypointDescriptor

public:

KeypointDescriptor();

virtual ~KeypointDescriptor()

void generate_keypoints(HarrisCorner&, cv::Mat&);
void compute_descriptor(HarrisCorner&, cv::Mat&);

cv::Ptr<cv::xfeatures2d::BriefDescriptorExtractor> desc_extr = cv::xfeatures2d::BriefDescriptorExtractor::create();
cv::Mat descriptors;
vector<cv::KeyPoint> kp;

;


The CMakeLists.txt is as below



cmake_minimum_required(VERSION 3.5)
project(Harris_Corner_Detector_fromScratch)

IF(NOT CMAKE_BUILD_TYPE)
SET(CMAKE_BUILD_TYPE Debug)
ENDIF()

set(CMAKE_MODULE_PATH $PROJECT_SOURCE_DIR/build/cmake)

find_package(OpenCV REQUIRED)

add_compile_options(-std=c++11)

include_directories(include
$PROJECT_SOURCE_DIR/
$PROJECT_SOURCE_DIR/include/
$OpenCV_INCLUDE_DIRS
)

add_library(HarrisCorner SHARED src/source_code/harris_corner.cpp)
add_library(KeypointDescriptor SHARED src/source_code/keypoint_descriptor.cpp)

add_executable(find_corner src/find_corner.cpp)
target_link_libraries(find_corner $OpenCV_LIBS
HarrisCorner)

add_executable(stitch_image src/stitch_image.cpp)
target_link_libraries(stitch_image $OpenCV_LIBS
HarrisCorner
KeypointDescriptor)


The output is as follows



-- Configuring done
-- Generating done
-- Build files have been written to: /home/tyagaraja/WPI/ARN/HW/Week10/Harris_Corner_Detector_fromScratch/build
[ 25%] Built target HarrisCorner
[ 50%] Built target KeypointDescriptor
[ 62%] Linking CXX executable stitch_image
libKeypointDescriptor.so: undefined reference to `cv::xfeatures2d::BriefDescriptorExtractor::create(int, bool)'
collect2: error: ld returned 1 exit status
CMakeFiles/stitch_image.dir/build.make:141: recipe for target 'stitch_image' failed
make[2]: *** [stitch_image] Error 1
CMakeFiles/Makefile2:105: recipe for target 'CMakeFiles/stitch_image.dir/all' failed
make[1]: *** [CMakeFiles/stitch_image.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2


I am using OpenCV that comes default with ROS Kinetic










share|improve this question














I intend to use Brief descriptor. But I am getting this undefined reference error. There is no problem with building the code. But the linker gives the error. Please let me know what have I missed. Thanks in advance.



Here's the code



#include <iostream>
#include <cmath>
#include "opencv2/opencv.hpp"
#include "opencv2/xfeatures2d.hpp"
#include "harris_corner.h"

using namespace std;

class KeypointDescriptor

public:

KeypointDescriptor();

virtual ~KeypointDescriptor()

void generate_keypoints(HarrisCorner&, cv::Mat&);
void compute_descriptor(HarrisCorner&, cv::Mat&);

cv::Ptr<cv::xfeatures2d::BriefDescriptorExtractor> desc_extr = cv::xfeatures2d::BriefDescriptorExtractor::create();
cv::Mat descriptors;
vector<cv::KeyPoint> kp;

;


The CMakeLists.txt is as below



cmake_minimum_required(VERSION 3.5)
project(Harris_Corner_Detector_fromScratch)

IF(NOT CMAKE_BUILD_TYPE)
SET(CMAKE_BUILD_TYPE Debug)
ENDIF()

set(CMAKE_MODULE_PATH $PROJECT_SOURCE_DIR/build/cmake)

find_package(OpenCV REQUIRED)

add_compile_options(-std=c++11)

include_directories(include
$PROJECT_SOURCE_DIR/
$PROJECT_SOURCE_DIR/include/
$OpenCV_INCLUDE_DIRS
)

add_library(HarrisCorner SHARED src/source_code/harris_corner.cpp)
add_library(KeypointDescriptor SHARED src/source_code/keypoint_descriptor.cpp)

add_executable(find_corner src/find_corner.cpp)
target_link_libraries(find_corner $OpenCV_LIBS
HarrisCorner)

add_executable(stitch_image src/stitch_image.cpp)
target_link_libraries(stitch_image $OpenCV_LIBS
HarrisCorner
KeypointDescriptor)


The output is as follows



-- Configuring done
-- Generating done
-- Build files have been written to: /home/tyagaraja/WPI/ARN/HW/Week10/Harris_Corner_Detector_fromScratch/build
[ 25%] Built target HarrisCorner
[ 50%] Built target KeypointDescriptor
[ 62%] Linking CXX executable stitch_image
libKeypointDescriptor.so: undefined reference to `cv::xfeatures2d::BriefDescriptorExtractor::create(int, bool)'
collect2: error: ld returned 1 exit status
CMakeFiles/stitch_image.dir/build.make:141: recipe for target 'stitch_image' failed
make[2]: *** [stitch_image] Error 1
CMakeFiles/Makefile2:105: recipe for target 'CMakeFiles/stitch_image.dir/all' failed
make[1]: *** [CMakeFiles/stitch_image.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2


I am using OpenCV that comes default with ROS Kinetic







opencv c++11 linker computer-vision undefined-reference






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 24 at 7:07









Tyagaraja RamaswamyTyagaraja Ramaswamy

1




1












  • Show results from message($OpenCV_LIBS) in your CMakeLists.txt. opencv_xfeatures2d is here?

    – Nuzhny
    Mar 24 at 21:13











  • Yes. opencv_xfeatures2d is there when I do message($OpenCV_LIBS). Sorry I couldn't post the result from the message, since the character limit was reached in comment.

    – Tyagaraja Ramaswamy
    Mar 25 at 0:28











  • Your libraries HarrisCorner and KeypointDescriptor are shared. It need to call target_link_libraries(HarrisCorner $OpenCV_LIBS) and target_link_libraries(KeypointDescriptor $OpenCV_LIBS). For static libraries it don't need to do.

    – Nuzhny
    Mar 25 at 8:22

















  • Show results from message($OpenCV_LIBS) in your CMakeLists.txt. opencv_xfeatures2d is here?

    – Nuzhny
    Mar 24 at 21:13











  • Yes. opencv_xfeatures2d is there when I do message($OpenCV_LIBS). Sorry I couldn't post the result from the message, since the character limit was reached in comment.

    – Tyagaraja Ramaswamy
    Mar 25 at 0:28











  • Your libraries HarrisCorner and KeypointDescriptor are shared. It need to call target_link_libraries(HarrisCorner $OpenCV_LIBS) and target_link_libraries(KeypointDescriptor $OpenCV_LIBS). For static libraries it don't need to do.

    – Nuzhny
    Mar 25 at 8:22
















Show results from message($OpenCV_LIBS) in your CMakeLists.txt. opencv_xfeatures2d is here?

– Nuzhny
Mar 24 at 21:13





Show results from message($OpenCV_LIBS) in your CMakeLists.txt. opencv_xfeatures2d is here?

– Nuzhny
Mar 24 at 21:13













Yes. opencv_xfeatures2d is there when I do message($OpenCV_LIBS). Sorry I couldn't post the result from the message, since the character limit was reached in comment.

– Tyagaraja Ramaswamy
Mar 25 at 0:28





Yes. opencv_xfeatures2d is there when I do message($OpenCV_LIBS). Sorry I couldn't post the result from the message, since the character limit was reached in comment.

– Tyagaraja Ramaswamy
Mar 25 at 0:28













Your libraries HarrisCorner and KeypointDescriptor are shared. It need to call target_link_libraries(HarrisCorner $OpenCV_LIBS) and target_link_libraries(KeypointDescriptor $OpenCV_LIBS). For static libraries it don't need to do.

– Nuzhny
Mar 25 at 8:22





Your libraries HarrisCorner and KeypointDescriptor are shared. It need to call target_link_libraries(HarrisCorner $OpenCV_LIBS) and target_link_libraries(KeypointDescriptor $OpenCV_LIBS). For static libraries it don't need to do.

– Nuzhny
Mar 25 at 8:22












0






active

oldest

votes












Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55321476%2fopencv-undefined-reference-cvxfeature2dbriefdescriptorextractorcreateint%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55321476%2fopencv-undefined-reference-cvxfeature2dbriefdescriptorextractorcreateint%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript