-2

I want to have this or should I say I want to fire or call the functions like Wfs_StartUp, Wfs_Open, Wfs_Execute etc within the Form1(void) but I'm getting these errors:

error LNK2028: unresolved token (0A000371) "int _cdecl mytestapp::Wfs_Execute(unsigned short)" (?Wfs_Execute@mytestapp@@$$FYAHG@Z) referenced in function "public: _clrcall mytestapp::Form1::Form1(void)" (??0Form1 @mytestapp@@$$FQ$AAM@XZ)

This error is reported twice but in the second error it's

error LNK2019: unresolved external symbol "int _cdecl mytestapp::Wfs_Execute(unsigned short)" (?Wfs_Execute@mytestapp@@$$FYAHG@Z) referenced in function "public: _clrcall mytestapp::Form1::Form1(void)" (??0Form1@mytestapp@@$$FQ$AAM@XZ)

And the third error:

error LNK1120: 2 unresolved externals.

Deduplicator
  • 44,692
  • 7
  • 66
  • 118
  • Microsoft Visual Studio C++ 2010 – Mlungisi Ndlela Jan 08 '16 at 11:56
  • For managed C++ "unresolved token" is an analog of "unresolved reference" in native C++, i.e. linker cannot find definitions of symbols (functions, variables etc.) due to absence of those definitions in your code or due to missing library dependencies – Ivan Aksamentov - Drop Jan 08 '16 at 11:56
  • I've tried adding the path to the .lib files but still. I don't understand exactly what is not linked whether its the Wfs_Execute() or its is it parameter which is now defined as "unsigned short". What's exactly is the problem. I've read even those answers on the link provided tried some but still no luck. I even thought that maybe I was calling the wrong function "Wfs_Execute" and even changed it to "WFSExecute" but still same error. – Mlungisi Ndlela Jan 08 '16 at 12:32
  • Just figured out which line is coursing this error. On Form1(void) this is what I've done: HSERVICE hservice=0; BOOl fSuccess=EXIT_SUCCESS; if(Wfs_StartUp()) { if(Wfs_Open(&hService)) { if(Wfs_Lock(hService)) { Wfs_Execute(hService); // This is the line producing this error as if I comment out this line the app execute. That's where this error is coming from. So what might be the problem here? Is it the Wfs_Execute function or maybe its could be parameters? – Mlungisi Ndlela Jan 08 '16 at 12:50
  • @world have added the reference to the assembly where those functions reside? if yes, are those functions declared public? – AndersK Jan 08 '16 at 15:15

1 Answers1

0

The error is pointing to the function mytestapp::Wfs_Execute. I would check:

  1. whether this function is not inline but is called from another translation unit
  2. whether the signature of this function matches between declaration and definition
  3. whether the source file where this function is implemented is a part of the build
dmi
  • 1,424
  • 1
  • 9
  • 9