NAG Logo
Numerical Algorithms Group


Using Nag C Mark 6 from the MSVC++ IDE

Q: O.K., so I stuck the CD in the drive and let the Install Shield do its bit.
How do I use this thing from the Microsoft Visual C++ v5/6 IDE?

A: There are two Project Settings you must set.

1. CC++ must be told where it can find the NAG header files. In a standard installation, the installer places these files in C:\cldll064z\include (for the DLL version of the NAG C Library) or C:\clw3206da\include (for the static version of the library.)

Select Settings from the Project menu. Select the C/C++ tab, category: preprocessor. In the text box for additional include directories, add the appropriate path (either C:\cldll064z\include or C:\clw3206da\include.)

2. The previous step will allow you to compile. But we also need to link. VC++ must be told where the NAG C library resides, and to link to the library.

Under the Link tab, select the input category.

For the DLL version of the NAG C library (shown below):

  1. In the text box for Object/library modules, add “nagc.lib”, the NAG C DLL import library and “user32.lib” (if it is not already present.)
  2. In the text box for Additional library path, add “C:\cldll064z\dll”. Note that this directory must also be added to your PATH environment variable so that the dynamic linker can find the library when your program executes.

For the static version of the NAG C library:

  1. In the text box for Object/library modules, add “nagcsmt.lib”, the static C library, and “user32.lib” (if it is not already present.) Note: for the license-managed version of the static C library, you must also link to the libraries netapi32.lib advapi32.lib gdi32.lib comdlg32.lib and comctl32.lib.
  2. In the text box for Additional library path, add “C:\clw3206da\lib”.
© 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.co.uk/nagnews/nagping/np008a2.asp