Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6985045
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T18:37:44+00:00 2026-05-27T18:37:44+00:00

I’m trying to use Rob Hess’s SIFT library in my C++ project. I’ve looked

  • 0

I’m trying to use Rob Hess’s SIFT library in my C++ project. I’ve looked through (the code of) other SIFT implementations, but this one seemed most phase-divided like the original Lowe’s paper and also uses OpenCV which I am familiar with, so I chose this one.

Unfortunately, I’ve had only trouble since I’ve tried using it in C++. The library is originally written in C with OpenCV.

I have tried compiling my code both with and without surrounding the C library include-s with extern, but neither works. I think I have diagnosed what the problems are in both cases, but I don’t know how to solve them and I would very much appreciate any help.

Problems (or at least, what I think the problems are):

  • withouth extern: doesn’t work because of C++ name-mangling (I’ve checked, and of course all the function names are decorated)

  • with extern : doesn’t work because OpenCV can detect weather it’s compiled for C or C++. There are no linkage problems with any of the SIFT library functions, but now OpenCV includes C++ headers, and since in the main program it’s ultimately included in the extern block, I get (literally hundereds) of errors like these:

    /usr/local/include/opencv2/core/mat.hpp:2361: error: template with C linkage

I have been trying to make this work for the last couple of days, so if anyone has tried to work with the same SIFT library in C++ or has experienced similar problems with a different library, help would be most appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T18:37:45+00:00Added an answer on May 27, 2026 at 6:37 pm

    Looks like I’ve managed to find quite a nice solutions. Two ways, easy and elegant:

    Easy:

    Just include all the OpenCV headers used in the library (and any other OpenCV headers needed) before the extern "C" section including all the SIFT library headers.

    Elegant

    In all the library headers, add the sections extern "C" around all the code except the OpenCV includes, like so:

    // OpenCV includes:
    #include "cxcore.h"
    #include ....
    
    #if __cplusplus
    extern "C" {
    #endif
    
    ...
    function definitions in the header file
    ...
    
    #if __cplusplus
    }
    #endif
    

    Now all the library includes can be #included directly in the C++ code without the extern "C". The OpenCV libraries compile correctly for C/C++ (depending on the compiler), and the relative order of the additional OpenCV includes and the SIFT library includes doesn’t matter.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have this code to decode numeric html entities to the UTF8 equivalent character.
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I am trying to loop through a bunch of documents I have to put
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.