Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Failure to link to a DLL

Status
Not open for further replies.

mlockwood

Programmer
Joined
Oct 11, 2000
Messages
2
Location
GB
I would be grateful if someone can help a poor Delphi programmer. I need to use a DLL provided by someone else to carry out a simple fire-and-forget action.
I have been provided with two files :
aiqsdkif.lib
aiqsdkif.dll

which I know contain the three routines I need namely :

InstallAIQ();
UninstallAIQ();
RebuildMasterTickerList();

There are two files that I have cloned fromthose provided to me :
AIQSDK.h :
---------------------------------------------------------------------
#ifndef __AIQSDK_H
#define __AIQSDK_H

#ifdef _WIN32
# ifndef _AIQSDK_
# define AIQSDKAPI __declspec( dllimport )
# else
# define AIQSDKAPI __declspec( dllexport )
# endif
#else
# define AIQSDKAPI
#endif

#ifdef __cplusplus
extern "C" {
#endif

AIQSDKAPI void FAR PASCAL InstallAIQ();
AIQSDKAPI void FAR PASCAL UninstallAIQ();
AIQSDKAPI BOOL FAR PASCAL RebuildMasterTickerList();

#ifdef __cplusplus
};
#endif

#endif //__AIQSDK_H
---------------------------------------------------------------------

SDKTest.cpp
---------------------------------------------------------------------
#include "windows.h"
#include <stdio.h>
#include <conio.h>
#include &quot;aiqsdk.h&quot;

int main(int argc, char* argv[])
{
InstallAIQ();
RebuildMasterTickerList();
UninstallAIQ();
return 0;

}

---------------------------------------------------------------------
The program compiles but fails to link with the messages :

Linking...
SDKtest.obj : error LNK2001: unresolved external symbol __imp__UninstallAIQ@0
SDKtest.obj : error LNK2001: unresolved external symbol __imp__RebuildMasterTickerList@0
SDKtest.obj : error LNK2001: unresolved external symbol __imp__InstallAIQ@0
Debug/Test1.exe : fatal error LNK1120: 3 unresolved externals

I guess there must be some way of linking in the .lib or dll files
But I am afraid I use Visual C++ (6) so little I do not know what to do.
 
put aiqsdkif.lib in Project->Settings->Link-> aditional libraries. Ion Filipski
1c.bmp


filipski@excite.com
 
Or you can add the line as the first line in your main .h or .cpp file.

HTH, s-)

Blessed is he who in the name of justice and goodwill, sheperds the weak through the valley of darkness...
 
Sorry, my mistake. Put the quotes like this. I hope this answer is still of some use.

#pragma comment( lib, &quot;aiqsdk&quot; );

where aiqsdk is the name of your .lib file.

HTH,



s-)

Blessed is he who in the name of justice and goodwill, sheperds the weak through the valley of darkness...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top