NAG Logo
Numerical Algorithms Group

NAG DLLs and Borland C++

NAG has carried out selected tests calling the Fortran DLLs from Borland C++, version 5.0. From these it has been concluded that the DLLs may be used in conjunction with the Borland C++ compiler. The discussion on the 'Microsoft C' pages applies equally to Borland. Borland import libraries are not supplied, but may easily be constructed from the DLLs as follows:

  impdef name.def name.dll
  implib name.lib name.def 

Where name denotes the name of the NAG DLL, e.g. NAGAC. The first statement constructs a module definitions file, name.def, and the second takes this module definition file and constructs an import library, name.lib. Do not be alarmed by warning messages from IMPDEF. These arise from the number of alternative symbols exported from the DLL in order to provide convenient alternatives for different users.

Compiling the C program with the -ps flag will ensure that the requisite STDCALL calling convention is used.

The C Library can also be called from Borland C/C++. Functions in the NAG C DLL can be called from C/C++ code compiled with the Borland C++ compiler, version 5.2. The following conditions must be met:

  1. nagcd_bc.lib must be specified as the import library
  2. The function which calls the NAG C DLL must be compiled with _stdcall calling convention
  3. The linker option allowing call by ordinal number must be set
  4. The non-incremental linker must be used

© The Numerical Algorithms Group 2008
Privacy Policy | Trademarks

© Numerical Algorithms Group

Visit NAG on the web at:

www.nag.co.uk (Europe and ROW)
www.nag.com (North America)
www.nag-j.co.jp (Japan)

http://www.nag.com/numeric/BorlandC++.asp