RE: Using DLLs generated by BlackBox

From: Greg Edwards <"Greg>
Date: Wed, 4 Apr 2001 08:44:50 -0700

Hi Doug,

I wish BB would create .lib files, but they don't, so as of right now, you'd
need to explicitly link (or get creative). Though BB creates DLLs, they
aren't perfectly useful because of the problem you just brought up (which I
hope they fix, or document better).

-Greg

-----Original Message-----
From: Danforth, Douglas [mailto:DDanforth{([at]})nowhere.xy
Sent: Wednesday, April 04, 2001 8:21 AM
To: 'blackbox{([at]})nowhere.xy
Subject: Using DLLs generated by BlackBox


Folks,

Being only a causal user of C/C++ I need a small amount of help
accessing a dll I generated with BlackBox, i.e.

DevLinker.LinkDll
QcLink.dll := QcLinkDll# ~

(QcLinkDll is just a rename for the MyDll given in the BB documentation
under DevLinker.LinkDll)

I can view QcLink.dll with MS 'Dependency Walker' and see the functions
Gcd and Lcm which are defined in the source code as:

DEFINITION QcLinkDll;

        PROCEDURE Gcd (a, b: INTEGER): INTEGER;
        PROCEDURE Lcm (a, b: INTEGER): INTEGER;

END QcLinkDll.

I have assumed that these translate into
int Gcd (int a, int b);
int Lcm (int a, int b);
which are to be included on the C side.

I am using MS Visual Studio for C++ and so
have assumed that I must under the Project->
Settings->Debug->Additional DLLs that
I include QcLink.dll there.

The C linker can't find _Gcd and _Lcm.

"Linking...
QcLink.obj : error LNK2001: unresolved external symbol _Lcm
QcLink.obj : error LNK2001: unresolved external symbol _Gcd
Debug/QcLink.exe : fatal error LNK1120: 2 unresolved externals
Error executing link.exe.

QcLink.exe - 3 error(s), 0 warning(s)"

Now the C linker documentation says:

"To implicitly link to a DLL, executables must obtain the following from the

provider of the DLL:
A header file (.H file) containing the declarations of the exported
functions and/or C++ classes.
An import library (.LIB files) to link with. (The linker creates the import
library when the DLL is built.)
The actual DLL (.DLL file). "

I had hoped that I only needed the .dll file so how do I generate the .lib
file?
I also do *not* wish to use 'explicit linking' where one needs to include in
the C
code:

"Call LoadLibrary ...
Call GetProcAddress ...
Call FreeLibrary when done with the DLL. ".

The reason I do not wish to do this is I am distributing BB code to a senior
level
individual who will not tolerate putting that into his code.

So, is there a way to avoid .lib and explicit linking and just use a header
file
and the .dll?

-Doug

---
Douglas G. Danforth, Ph.D. - Research Scientist
QuikCAT.com   6700 Beta Drive,  Suite 200,  Mayfield Village,  OH 44143-2335
danforth{([at]})nowhere.xy--------------------------------------------
To unsubscribe from this mailing list, send a message containing the word
"unsubscribe" to:
   blackbox-request{([at]})nowhere.xyTo get a list of valid e-mail commands and instructions on their usage, send
a message containing the word "help" to the above address.
Send any problem reports or questions related to this email list to the list
owner at
   owner-blackbox{([at]})nowhere.xy--------------------------------------------
To unsubscribe from this mailing list, send a message containing the word "unsubscribe" to:
   blackbox-request{([at]})nowhere.xyTo get a list of valid e-mail commands and instructions on their usage, send a message containing the word "help" to the above address.
Send any problem reports or questions related to this email list to the list owner at
   owner-blackbox{([at]})nowhere.xy
Received on Wed Apr 04 2001 - 15:44:50 UTC

This archive was generated by hypermail 2.3.0 : Thu Sep 26 2013 - 06:27:44 UTC