linker error2019

  • Thread starter Thread starter barkha shah
  • Start date Start date
B

barkha shah

Hi All,
I am trying to call a C function (in static library) from C++ class ( Dll
application).
The C function is declared as follow in the multitheaded library as follows:
#ifdef __cplusplus
extern "C" {

#endif

extern int abc(const char *host, int Port);

#ifdef __cplusplus

}

My Call in C++ ( Multithreaded Dll app)



Class hey

{

public:

int heysee()

{

int a = abc("sdf",234);

return a;

}

};

IXhubService.obj : error LNK2019: unresolved external symbol _abc referenced
in function "public: int __thiscall hey::abc(char const *,int)"
(?heysee@hey@@QAEHPBDH@Z)

Can anyone please tell me how to remove this linking error?

Thanks
 
barkha said:
IXhubService.obj : error LNK2019: unresolved external symbol _abc
referenced in function "public: int __thiscall hey::abc(char const
*,int)" (?heysee@hey@@QAEHPBDH@Z)

Can anyone please tell me how to remove this linking error?

Link against the LIB.

You can do this either in the linker settings or with:

#pragma comment(lib, "libname.lib")

--
Greetings
Jochen

Do you need a memory-leak finder ?
http://www.codeproject.com/useritems/leakfinder.asp
 
Yah , thanks. I was not able to link the dll with the proper lib and because
of which the definition was not found.
 
Back
Top