报错:multiple definition of 和 first defined here

版权声明:版权所有!https://blog.csdn.net/weixin_38184741 https://blog.csdn.net/weixin_38184741/article/details/85246084

1、就只有一处定义了全局变量,但还是报错,提示重复定义。

2、检查.h头文件,已经避免重复包含了。

解决方法:

在.c程序中定义全局变量,在.h文件中使用extern 做外部声明,供其他文件调用。

参考链接:
https://blog.csdn.net/mantis_1984/article/details/53571758

猜你喜欢

转载自blog.csdn.net/weixin_38184741/article/details/85246084
今日推荐