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

边栏推荐
- Centos7 deploy MySQL database server
- DNS domain name resolution service
- Regular execution of scratch
- KVM热迁移
- 单项链表的创建、遍历以及按要求查找结点
- Ten thousand words summarize and realize the commonly used sorting and performance comparison
- [learning notes] process creation
- Installation and configuration of unit test framework jest with typescript
- What is the most practical gift for Tanabata? A gift that will never go wrong is worth buying
- TCP/IP五层模型
猜你喜欢

Technology sharing | detailed explanation of actual combat interface test request methods get, post

技术分享 | 如何模拟真实使用场景?mock 技术来帮你

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

KVM热迁移

How to calculate the size of structure, segment and Consortium (common body)

Applet navigator cannot jump (debug)

Applet custom components - data, methods, and properties

Iptables firewall

思寒漫谈测试人职业发展

Custom components -- slots
随机推荐
Wechat applet custom compilation mode
Principle and configuration of NAT and pat
Compilation and preprocessing of C language
JSON notes
Custom component -- data listener
Network - data link layer
[learning notes] coding ability
组管理和权限管理
Ten thousand words summarize and realize the commonly used sorting and performance comparison
How to simulate the implementation of strcpy library functions
RAID disk array
搭建PHP7私有仓库
Test life | second tier cities with an annual salary of more than 40W? How did you achieve 100% salary increase under the epidemic?
Test interview questions collection (III) | computer network and database (with answers)
MySQL installation and use
Firewall - iptables firewall (four tables and five links, firewall configuration method, detailed explanation of matching rules)
File operation in C language
Traversal binary tree
Hdu-1097-a hard puzzle (fast power)
JS four operations are repackaged to solve the problem of precision loss