implicit declaration using -std=c99
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I'm getting this warning: ( -std=c99 -pedantic ) warning : implicit declaration of function ‘ strndup ’ [- Wimplicit - function - declaration ] but I'm importing these libs: #include #include #include So what?! :( // file.c: #include "file.h" strndup (...) // file.h: #include #include #include 回答1: The issue is your usage of the -std=c99 option. Since strndup() isn't part of C99, and you're asking the compiler to go into standards compliant mode, it won't provide the prototype for it. It still links of course, because your C