Ubuntu implicit declaration of function xxx 和format %u expects argument of type xxx解决办法

在静态库的生成和使用时遇到了两个问题
Ubuntu implicit declaration of function xxx 和format %u expects argument of type xxx解决办法
第一个问题产生的原因有两个

  1. 没有把函数所在的c文件生成.o目标文件。
  2. 在函数所在的c文件中定义了,但是没有在与之相关联的.h文件中声明。

参考文章http://blog.chinaunix.net/uid-21558711-id-34462.html

我的解决办法:建立.h文件,并在需要引用的.c文件中引入该.h文件

unsgn_pow.c
Ubuntu implicit declaration of function xxx 和format %u expects argument of type xxx解决办法
unsgn_pow.h
Ubuntu implicit declaration of function xxx 和format %u expects argument of type xxx解决办法
pow_test.c
Ubuntu implicit declaration of function xxx 和format %u expects argument of type xxx解决办法
第一个问题解决

第二个问题,在执行编译命令时添加-Wformat=0

gcc -o pow_test pow_test.c -Wformat=0 -L. -lpow

参考文章 https://www.wandouip.com/t5i379220/