I want to use a library (crypto++) which I compiled easily enough, but I have no idea how to use it in my code... Or any library for that matter. How does one use a library and get intellisense on the classes function in it?
using VS2003.
Printable View
I want to use a library (crypto++) which I compiled easily enough, but I have no idea how to use it in my code... Or any library for that matter. How does one use a library and get intellisense on the classes function in it?
using VS2003.
Check documentions that come with the library.
I'm more interested in knowing how to use libraries in general then this particular one. How do I include them in my code / set them up in the compiler ?
with visual studio you just add the library to your
project.
project -> add exsisting item -> add your library*
*
make sure the file drop down box is on all files,
or the lib file might now show up, depending on your
library that should be enough for visual studio.
or if its something you are gonna use a lot you can put it in the library directory or add a new directory for libraries
Go to Tools > Options
and then go to down to Projects > VC++ Directories
in the uper corner you can change it to libraries and add a directory.
so I've set the library in the compiler but to use it in a project I do what ?
#include "mylib.lib"
mylib.aFunction();
no if you add it the way i said,
you dont have to add any sort
of include for it, using visual studio anyways.
You probably should add an include (at least with my compilers), but you can call the function as if you wrote it:
Code:a_function();
Essentially the steps are this:
a. Make sure the library will get linked (I have no VC++ experience, but this is what ILoveVectors gave instructions for)
b. Include the appropriate header files from the library where you need them in your code (what you need where can be found in the documentation)
c. Call the functions, use the classes, etc just as normal
It might help to realize that std::cout and company are not part of the C++ language, but rather, part of a library themselves, the C++ Standard Library ... and you use them just as "black boxes" per se, but the syntax is no different than if you had written them.