当前位置:网站首页>About gcc:multiple definition of
About gcc:multiple definition of
2022-07-28 06:59:00 【Zhaoyang】
stay ubuntu Edit in environment C Language source code
//file name main.c
#include<stdio.h>
#include "increment.c"
#include "negate.c"
int main()
{
printf("%d\t%d\n",increment(10),negate(10));
printf("%d\t%d\n",increment(0),negate(0));
printf("%d\t%d\n",increment(-10),negate(-10));
return 0;
}//file name increment
int increment(int a)
{
return ++a;
}//file name negare.c
int negate(int b)
{
return b*(-1);
}Compile the connection through the command, and multiple definition of( Error reporting with multiple definitions )

modify main.c file
//file name main.c
include<stdio.h>
int increment(int a);
int negate(int b);
int main()
{
printf("%d\t%d\n",increment(10),negate(10));
printf("%d\t%d\n",increment(0),negate(0));
printf("%d\t%d\n",increment(-10),negate(-10))
}Recompile connection and execute

边栏推荐
- VMware Workstation 配置net模式
- Installation and configuration of unit test framework jest with typescript
- 搭建PHP7私有仓库
- 防火墙——iptables防火墙(四表五链、防火墙配置方法、匹配规则详解)
- What kind of air conduction Bluetooth headset with good configuration is recommended
- 进程和线程的区别
- NFS 共享存储服务
- Applet navigator cannot jump (debug)
- Technology sharing | how to do Assertion Verification in interface automated testing?
- DNS domain name resolution service
猜你喜欢

思寒漫谈测试人职业发展

Which brand of air conduction earphones is better? These four should not be missed

Custom component -- data listener

Wechat applet custom compilation mode

How to simulate the implementation of strcpy library functions

Build php7 private warehouse

Technology sharing | how to simulate real use scenarios? Mock technology to help you

技术分享 | 服务端接口自动化测试, Requests 库的这些功能你了解吗?

Shell script - sort, uniq, TR, array sort, cut, Eval command configuration

Shell script - regular expression
随机推荐
遍历 二叉树
Applet custom components - data, methods, and properties
How to simulate the implementation of strcpy library functions
Create, traverse and search nodes as required for single linked list
Ubuntu MySQL setting remote access permissions
shell脚本——“三剑客”之awk命令
Which brand of air conduction earphones is better? These four should not be missed
Centos7 deploy MySQL database server
Common models in software development
Cocos2d-x learning notes Tile Map tiledmap
Upload and download files from Ubuntu server
MySQL主主
Ubuntu18.04+centos7 configure redis master-slave [learning notes]
FTP service
NFS shared storage service
OSI七层模型
一、PXE概述和安装
Method of designing test cases
JS四则运算重新封装,解决精度丢失问题
RAID disk array