← Foro de C / C++

funciones extern

Hilo en el foro de C / C++ · 29 de Noviembre del 2004 · 1 respuestas
carlos29 de Noviembre del 2004
Pregunta
Tengo un arextern. h, en el que pone: extern funcion /* external definition macros extracted from the c_variables.h include file */
/* Builds the correct external reference for the type of compiler being used */

#if defined(__cplusplus)
/* Definitions for C++ 2.0 and later */
# define EXTERN_FUNCTION( rtn, args ) extern "C" { rtn args; }
# define STRUCT_TAG( tag_name ) /* the tag disappears */
.....
EXTERN_FUNCTION (int ARCreateEntry, (ARControlStruct *, ARNameType,
ARFieldValueList *, AREntryIdType, ARStatusList *));

He creado un sampleapi.cpp:
#define "arextern.h,
...
....
y me da el error siguiente de linkado:

Linking...
SampleApi.obj : error LNK2001: unresolved external symbol _FreeARStatusList
SampleApi.obj : error LNK2001: unresolved external symbol "void __cdecl PrintARStatusList(struct ARStatusList *)" (?PrintARStatusList@@YAXPAUARStatusList@@@Z)
SampleApi.obj : error LNK2001: unresolved external symbol _ARInitialization, siendo ARInitialization:

EXTERN_FUNCTION (int ARInitialization, (ARControlStruct *, ARStatusList *)); dentro de arextern.h y EXTERN_FUNCTION(void FreeARStatusList, (ARStatusList *, ARBoolean)) dentro de arfree.h, que también está incluido.
Debug/SampleApi.exe : fatal error LNK1120: 3 unresolved externals

Respuestas 1

farnoune29 de Noviembre del 2004
bonjour,
j'ai le même problème que le votre, à priori il faut vérifier les chemins de liens de vos .dll et .LIB
bon courage
¿Buscas más hilos como este? Mira el foro de C / C++ o usa el buscador.