Search code examples
.netc++-climixed-modecen-xfs

facing error LNK error


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.


Solution

  • 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