I'm quite new to programming in C++/CLI. I think I've got the idea of the basics, now I want to make use of some mathematical functions. I found the "alglib" library of functions (http://www.alglib.net/) which should provide me with an extensive set of math functions. However, I do not know how I can make use of this package, i.e. how I make the functions available for use in my program.
Any help would be very welcome.
Generally, to use an external library you would have to set the linker search paths to the directory the library files are stored in. You may also need to state which specific library modules you want to use.
The compiler you're using should have an options box that will let you change these things. After doing the above you would include the header files in your code as normal.
The library should also come with documentation of how to set it up, what files you should use etc.
I'm using Visual Studio (2008) for my programming, where can I set those linker search paths? I haven't been able to find it yet, but I'll do some further searching.
To set the search paths navigate to Tools->Options->Projects and Solutions->VC++ Directories.
Under "Show directories for" should be a combo box, select "Include files" and type in the path to the directory where the include files for your library are located.
Do the same thing for "Library files" - type in the path where the .lib files are located, then press ok.
You then may need to specify exactly which library (.lib) files you're going to use. Do this by navigating to Project->Properties->Configuration Properties->Linker->Input.
Type in the name of the library files you're going to use (if you're not sure the documentation should tell you, otherwise just type in all of them), then press ok. In your code you would then include the relevant header files (#include <whatever.h>)
I'm not entirely sure this will work as I usually don't use many external libraries.
This seems to work!
But I think there is a problem with the library itself, as I'm getting a few errors when compiling. I'll dig into it a bit further.
Thanks a lot for your quick help!
In order to include your library, (In visual studio 2005 and 2008)
Go To Project--->Your ProjectProperties--->Linker--->Input---->AdditionalDependencies(You need to add your library here)
Moreover in the command line inside the linker tab you can give your command ./verbose:lib...
While linking you can see what all libraries it is linking.