Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to import an DLL in my FLL project?
Message
De
13/01/2005 08:31:59
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
00976185
Message ID:
00976722
Vues:
7
>Thaks for Your answer, I already did it but no luck. Of course I put sc.dll.lib in Project Settings
>I receive
>"fll_20 error LNK2019: unresolved external symbol "struct SGlobalMemorytag * __fastcall Init_scom(int)" (?Init_scom@@YIPAUSGlobalMemorytag@@H@Z) referenced in function "void __fastcall InitCom(struct ParamBlk *)" (?InitCom@@YIXPAUParamBlk@@@Z)"
>
>as a linker error message.
>
>Here my portion of code:
>
>
>*** sc_dll.h
>typedef struct SGlobalMemorytag
>{
>....
>)SGlobalMemorytag
>
>SGlobalMemorytag* Init_scom(int);
>void Close_scom();
>void Timer_proc();
>
>
>*** My main program
>
>#include "sc.dll.h"
>#define MAX_CON 20
>
>SGlobalMemorytag* sg
>
>
>
>void InitCom(ParamBlk *parm)
>{
>   long i = p0.ev_long-1;
>   sg = Init_scom(i);
>   if(sg == NULL)
>      _RetLogical(false);
>   else
>   {
>     for(int i=0;i<MAX_CON;i++)
>         sg->installed[i] = 0;						
>   _RetLogical(true);
>   }
>}
>
>
>TIA

Borislav,

First, I want to make sure that it is a typo in your code, is it ?
#include "sc.dll.h"     // should this be sc_dll.h ?
If it is a typo, try to add extern "C"
#include "sc_dll.h"
#define MAX_CON 20

extern "C"     // Assume C declarations for C++
{

   // put all of your prototype/declarations for the external header file here

   SGlobalMemorytag* sg

}              // End of extern "C"
Try to compile again

Update:
You might also need to put extern "C" in your header file (sc_dll.h). If there is another "#include" in the header, put it right after the "#include". To make your header be safe ( can compile with C and C++ ) put it like this:
#ifdef __cplusplus
extern "C" {
#endif

typedef struct SGlobalMemorytag
{
....
)SGlobalMemorytag

SGlobalMemorytag* Init_scom(int);
void Close_scom();
void Timer_proc();

#ifdef __cplusplus
}
#endif
Herman
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform