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

  • Home
  • SEARCH
  • 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 6245465
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T12:30:42+00:00 2026-05-24T12:30:42+00:00

I am trying to access various functions from the ‘Approximate nearest neighbor’ ( ANN

  • 0

I am trying to access various functions from the ‘Approximate nearest neighbor’ (ANN) library from within Delphi (actually, it is Lazarus/FreePascal, but that shouldn’t matter much).

Here is the deceleration in C++:

#include <cstdlib>                      // C standard lib defs
#include <ANN/ANNx.h>                   // all ANN includes
#include <ANN/ANNperf.h>                // ANN performance 

using namespace std;                    // make std:: accessible
....
....
void annMaxPtsVisit(            // set limit on max. pts to visit in search
    int                 maxPts)         // the limit
{
    ANNmaxPtsVisited = maxPts;
}

And here is my attempt to access the annMaxPtsVisit function from within Lazarus (pretend its delphi if you don’t know what Lazarus is):

unit unit1;

{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls;
type

  { TForm1 }

  TForm1 = class(TForm)
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
    procedure annMaxPtsVisit(input:Integer); stdcall;
  private

    { private declarations }
  public
    { public declarations }

  end;

var
  Form1: TForm1;

implementation

{$R *.lfm}
{ TForm1 }
procedure TForm1.annMaxPtsVisit(input: Integer); stdcall; external 'ANN.dll' name 'annMaxPtsVisit';

procedure TForm1.Button1Click(Sender: TObject);
begin
           annMaxPtsVisit(10);
end;

end.

The program compiles, but when I attempt to execute it I get an error message:

“The procedure entry point annMaxPtsVisit could not be located in the dynamic link library ANN.dll”

If anyone could help me out with this I would really appreciate it.

Here are the exports from the DLL:

class ANNsampStat ann_average_err   
class ANNsampStat ann_rank_err  
const ANNbd_tree::`vftable' 
const ANNbruteForce::`vftable'  
const ANNkd_tree::`vftable' 
const ANNpointSet::`vftable'    
double * * __cdecl annAllocPts(int,int) 
double * __cdecl annAllocPt(int,double) 
double * __cdecl annCopyPt(int,double *)    
double __cdecl annDist(int,double *,double *)   
protected: void __thiscall ANNkd_tree::SkeletonTree(int,int,int,double * *,int *)   
public: __thiscall ANNbd_tree::ANNbd_tree(class ANNbd_tree const &) 
public: __thiscall ANNbd_tree::ANNbd_tree(class std::basic_istream<char,struct std::char_traits<char> > &)  
public: __thiscall ANNbd_tree::ANNbd_tree(double * *,int,int,int,enum ANNsplitRule,enum ANNshrinkRule)  
public: __thiscall ANNbd_tree::ANNbd_tree(int,int,int)  
public: __thiscall ANNbruteForce::ANNbruteForce(class ANNbruteForce const &)    
public: __thiscall ANNbruteForce::ANNbruteForce(double * *,int,int) 
public: __thiscall ANNkd_tree::ANNkd_tree(class ANNkd_tree const &) 
public: __thiscall ANNkd_tree::ANNkd_tree(class std::basic_istream<char,struct std::char_traits<char> > &)  
public: __thiscall ANNkd_tree::ANNkd_tree(double * *,int,int,int,enum ANNsplitRule) 
public: __thiscall ANNkd_tree::ANNkd_tree(int,int,int)  
public: __thiscall ANNpointSet::ANNpointSet(class ANNpointSet const &)  
public: __thiscall ANNpointSet::ANNpointSet(void)   
public: __thiscall ANNsampStat::ANNsampStat(void)   
public: class ANNbd_tree & __thiscall ANNbd_tree::operator=(class ANNbd_tree const &)   
public: class ANNbruteForce & __thiscall ANNbruteForce::operator=(class ANNbruteForce const &)  
public: class ANNkd_tree & __thiscall ANNkd_tree::operator=(class ANNkd_tree const &)   
public: class ANNpointSet & __thiscall ANNpointSet::operator=(class ANNpointSet const &)    
public: class ANNsampStat & __thiscall ANNsampStat::operator=(class ANNsampStat const &)    
public: double __thiscall ANNsampStat::max(void)    
public: double __thiscall ANNsampStat::mean(void)   
public: double __thiscall ANNsampStat::min(void)    
public: double __thiscall ANNsampStat::stdDev(void) 
public: int __thiscall ANNsampStat::samples(void)   
public: virtual __thiscall ANNbd_tree::~ANNbd_tree(void)    
public: virtual __thiscall ANNbruteForce::~ANNbruteForce(void)  
public: virtual __thiscall ANNkd_tree::~ANNkd_tree(void)    
public: virtual __thiscall ANNpointSet::~ANNpointSet(void)  
public: virtual double * * __thiscall ANNbruteForce::thePoints(void)    
public: virtual double * * __thiscall ANNkd_tree::thePoints(void)   
public: virtual int __thiscall ANNbruteForce::annkFRSearch(double *,double,int,int *,double *,double)   
public: virtual int __thiscall ANNbruteForce::nPoints(void) 
public: virtual int __thiscall ANNbruteForce::theDim(void)  
public: virtual int __thiscall ANNkd_tree::annkFRSearch(double *,double,int,int *,double *,double)  
public: virtual int __thiscall ANNkd_tree::nPoints(void)    
public: virtual int __thiscall ANNkd_tree::theDim(void) 
public: virtual void __thiscall ANNbruteForce::annkSearch(double *,int,int *,double *,double)   
public: virtual void __thiscall ANNkd_tree::annkSearch(double *,int,int *,double *,double)  
public: virtual void __thiscall ANNkd_tree::Dump(enum ANNbool,class std::basic_ostream<char,struct std::char_traits<char> > &)  
public: virtual void __thiscall ANNkd_tree::getStats(class ANNkdStats &)    
public: virtual void __thiscall ANNkd_tree::Print(enum ANNbool,class std::basic_ostream<char,struct std::char_traits<char> > &) 
public: void __thiscall ANNkd_tree::`default constructor closure'(void) 
public: void __thiscall ANNkd_tree::annkPriSearch(double *,int,int *,double *,double)   
public: void __thiscall ANNsampStat::operator+=(double) 
public: void __thiscall ANNsampStat::reset(void)    
void __cdecl annClose(void) 
void __cdecl annDeallocPt(double * &)   
void __cdecl annDeallocPts(double * * &)    
void __cdecl annMaxPtsVisit(int)    
void __cdecl annPrintStats(enum ANNbool)    
void __cdecl annResetCounts(void)   
void __cdecl annResetStats(int) 
void __cdecl annUpdateStats(void)   
  • 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-24T12:30:43+00:00Added an answer on May 24, 2026 at 12:30 pm

    Maybe importing by index works:

    procedure annMaxPtsVisit(input: Integer); stdcall; external 'ANN.dll' index 39;
    

    (That’s the index gotten via Dependecy Walker)

    And you might have to change to cdecl calling convention, depending on how the DLL was built:

    procedure annMaxPtsVisit(input: Integer); cdecl; external 'ANN.dll' index 39; // could work
    

    Edit: Looks like cdecl is the right thing to do, looking at your added exports.

    Edit2: Dependency walker shows also the decorated names, as @user786653 suspected. This also seems to work:

    procedure annMaxPtsVisit(input: Integer); cdecl; external 'ANN.dll' Name '?annMaxPtsVisit@@YAXH@Z';
    

    Looks ugly, though.

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

Sidebar

Related Questions

Im trying to access a web service from a remote computer. I managed to
I am trying to access Outlook 2007 from C#. I have installed the PIA
I am trying to access a view inside a splitter from my mainframe. At
trying to access various properties of my video tag. started looking at the HTML5
I'm trying to access out-of-network profiles using the LinkedIn API, following the instructions from
I'm trying to access various parts of a nested class structure using a arbitrary
Im trying to access the Magento customer session in another part of my website.
Im trying to access a Sql CE 2005 database on a windows mobile device
I'm trying to access the Facebook API Admin.getMetrics method via jQuery. I'm correctly composing
I'm trying to access the Reporting Services via Web Services in my Visual Studio

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.