Hey guys,

I am trying to implement something in VC++ and have to use a library for this purpose. This library is in C++ and the authors have provided a seperate download for VC++

How exactly do I use the functions provided in this library in my own code? They have provided all the source and header files but at the same time, a object file library, is also present in the same folder.

Do I need to included this object file library direclty in my VC++ project, or do I need to make a new one using all the source and header files provided?

The library can be found here..

http://crypto.stanford.edu/pbc/download.html


Regards,

Abhi

Usually libraries will come with a .lib or .dll file that you can link with, and headers for compiling. But if you have all of the source, you might be able to build it all fresh too.

Hey Tom,

Yes. Your are right. Authors have provided a separate download for windows binaries and it contains the .dll and .lib files..

How do I add them in VC++ ( VS 2005)

Regards,

Abhijit

Hi Tom,

I did that. Tested building it.. and it worked fine..

how do I call the functions in the DLL?

the name is pbc.dll...
can u explain a little on this?

Hi Tom,

Thanks a ton for this wonderful link. I tried both the methods, implicit as well as explicit and now understand the concept of DLL's better. :)

I have couple of more questions for you..

First of all, how different is your method from P/Invoke, which is also used to call functions in dll's.

Also, is it necessary, that if someone has published a dll/lib for a library, it will contain all the functions defined in their source code..
what if some functions are not exported.... will I still be able to use them?


Many thanks for your time..

Regards,

Abhi

Edited 7 Years Ago by abhipro: n/a

First of all, how different is your method from P/Invoke, which is also used to call functions in dll's.

P/Invoke is a way to access unmanaged COM DLLs from managed code. The implicit and explicit linking you read about in the tutorial were strictly unmanaged methods. The only way you can use P/Invoke, AFAIK, is to jump into C++/CLI, which is technically a different language from standard C++.

what if some functions are not exported.... will I still be able to use them?

Officially, as good little programmers we are not allowed to use functions that were not exported. Unofficially, we can do anything well damn well please given sufficient knowledge of the file formats. But circumventing the rules is tricky and complex. For example, signature scanning is one way to find and use functions that are not part of the export table in a DLL or executable.

There are lots of reasons why you do not want to do that. First and foremost is versioning. Unexported functions are not bound by the interface and can change or go away entirely between versions of a DLL. It is the same as circumventing the access restrictions in C++ to get at a class' private methods.

This article has been dead for over six months. Start a new discussion instead.