sr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib/crt1.o: In function `_start'问题解决
2016-07-08 09:39
483 查看
自己写了一个简单的hello.c
#include "stdio.h"
void
hello (const char * name)
{
printf ("Hello, %s!/n", name);
}
$gcc hello.c
就会出现/usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib/crt1.o: In function `_start'
:
(.text+0x20): undefined reference to `main'
collect2: ld returned 1 exit status
解决方法:只要把hello函数名改为main就没错了! 最好主函数名为main
#include "stdio.h"
void
main (const char * name)
{
printf ("Hello, %s!/n", name);
}
$gcc hello.c
ok!
#include "stdio.h"
void
hello (const char * name)
{
printf ("Hello, %s!/n", name);
}
$gcc hello.c
就会出现/usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib/crt1.o: In function `_start'
:
(.text+0x20): undefined reference to `main'
collect2: ld returned 1 exit status
解决方法:只要把hello函数名改为main就没错了! 最好主函数名为main
#include "stdio.h"
void
main (const char * name)
{
printf ("Hello, %s!/n", name);
}
$gcc hello.c
ok!
相关文章推荐
- Linux下怎样搜索文件
- Centos7+Mysql5.7实现主从复制
- Linux中yum和apt-get用法及区别
- linux 系统调用sysconf【总结】
- CentOS 部署 Java Web
- Linux上使用Qt Creator进行C/C++开发
- linux守护进程
- Linux系统设置及基本操作
- Linux中brk()系统调用,sbrk(),mmap(),malloc(),calloc()的异同
- 嵌入式 Linux进程间通信(八)——共享内存
- Linux系统设置 history 相关系统变量(包括显示时间、history条数)
- 每天一个linux命令(38)--lsof命令
- linux 基础命令
- 工程部署到linux
- CentOS上安装Git服务器
- Linux下crontab命令的用法
- LINUX SCSI回调IO的分析
- linux vlan configuration
- window、ubuntu与arm板文件挂载
- 芯片启动过程 ARM C51 Soc - RTOS LINUX - 之一