warning: implicit declaration of function

前端 未结 7 812
旧时难觅i
旧时难觅i 2020-11-22 02:19

My compiler (GCC) is giving me the warning:

warning: implicit declaration of function

Please help me understand why is it coming

相关标签:
7条回答
  • 2020-11-22 03:13

    When you get the error: implicit declaration of function it should also list the offending function. Often this error happens because of a forgotten or missing header file, so at the shell prompt you can type man 2 functionname and look at the SYNOPSIS section at the top, as this section will list any header files that need to be included. Or try http://linux.die.net/man/ This is the online man pages they are hyperlinked and easy to search. Functions are often defined in the header files, including any required header files is often the answer. Like cnicutar said,

    You are using a function for which the compiler has not seen a declaration ("prototype") yet.

    0 讨论(0)
提交回复
热议问题