当前位置:网站首页>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

边栏推荐
- 测试面试题集锦(二)| 测试工具篇(附答案)
- [learning notes] VIM editor
- Repair the faulty sector
- Teach you three steps to complete the construction of the test monitoring system hand in hand
- Ubuntu18.04+centos7 configure redis master-slave [learning notes]
- 2022 Tanabata gift recommendation! Nice, cheap and practical gift recommendation
- shell脚本——正则表达式
- Pku-2739-sum of constructive prime numbers
- How to describe a bug and the definition and life cycle of bug level
- How to calculate the size of structure, segment and Consortium (common body)
猜你喜欢

Technology sharing | common proxy tools for interface testing

Which is the best air conduction Bluetooth headset? Air conduction Bluetooth headset ranking

Archery database audit platform deployment

shell脚本——正则表达式

MySQL主主

raid磁盘阵列

Technology sharing | sending requests using curl

What kind of air conduction Bluetooth headset with good configuration is recommended

Cocos2d-x learning notes Tile Map tiledmap

QGraphicsView提升为QChartView
随机推荐
[learning notes] thread creation
Life cycle (process) of software testing
How about air conduction Bluetooth headset? It's the most worthwhile air conduction headset to start with
Ubuntu18.04+centos7 configure redis master-slave [learning notes]
Applet creation component
Archery database audit platform deployment
QT使用MSVC编译器输出中文乱码问题
What is the good brand of air conduction Bluetooth headset and the best brand recommendation of air conduction headset
---栈&队列---
MySQL common commands
技术分享 | 使用postman发送请求
KVM热迁移
Compilation and preprocessing of C language
File operation in C language
Pku-2524-ubiquitous relations (parallel search template)
Applets: WSX scripts
Technology sharing | how to simulate real use scenarios? Mock technology to help you
Ubuntu MySQL setting remote access permissions
PKU-2739-Sum of Consecutive Prime Numbers(筛素数法打表)
VMware Workstation 配置net模式