Why Visual Studio 2015 highlights the function declaration with a wavy line and writes

no function definition found

although it exists and the program works (when calling this function, the code from the definition is executed)?

The ad is in my .h file, and the definition is in .cpp . Everything else does not emphasize.

If you use IntelliSense and create the definition automatically (the signature matches the non-automatic one), the wavy line disappears for a while, I insert the code into the new definition, delete the old definition, the wavy line reappears :(

If you comment out the code in the definition, the underscore disappears!

By line-by-line commenting, it also turned out that an underscore is caused by a string that uses #define from a third-party library.

  • It is difficult to answer without pressing out your code. The error is clearly syntactic. - perfect
  • @perfect if you comment out the code in the definition, the underscore disappears! How can this be? - maxmaks
  • 2
    It may be buggy VS. Create a minimal example that demonstrates the problem so that other participants can check. - αλεχολυτ
  • @alexolut added a question. It is difficult to create it, because used third-party library - maxmaks
  • one
    If everything works, and VS emphasizes, then the problem is in VS and nothing else. - ixSci

1 answer 1

IntelliSense uses a slightly different way of checking and misunderstand the scope for #define and #undef . In particular, if they are in the same file and between them there is a code in which the declared is used, it will be underlined there.

Faced with this in earlier versions of the studio, they could already fix it.

In general, nothing can be done about it. Just ignore.