当前位置: 技术问答>linux和unix
编译socket程序出现的提示,我菜鸟不懂,高手能否指点一下!万分感激!!!
来源: 互联网 发布时间:2015-02-18
本文导语: 错误提示: /usr/lib/gcc-lib/i386-redhat-linux/3.2/../../../crt1.o: In function `_start': /usr/lib/gcc-lib/i386-redhat-linux/3.2/../../../crt1.o(.text+0x18): undefined reference to `main' collect2: ld returned 1 exit status 代码如下: #include #include #inclu...
错误提示:
/usr/lib/gcc-lib/i386-redhat-linux/3.2/../../../crt1.o: In function `_start':
/usr/lib/gcc-lib/i386-redhat-linux/3.2/../../../crt1.o(.text+0x18): undefined reference to `main'
collect2: ld returned 1 exit status
代码如下:
#include
#include
#include
#include
#include
#include
#include
#include
#include
#define SERVER_PORT 8080
int read_all(int fd,void *buf,int n)
{
int nleft;
int nbytes;
char *ptr;
ptr=buf;
nleft=n;
for(;nleft>0;)
{
nbytes=read(fd,ptr,nleft);
if(nbytes
/usr/lib/gcc-lib/i386-redhat-linux/3.2/../../../crt1.o: In function `_start':
/usr/lib/gcc-lib/i386-redhat-linux/3.2/../../../crt1.o(.text+0x18): undefined reference to `main'
collect2: ld returned 1 exit status
代码如下:
#include
#include
#include
#include
#include
#include
#include
#include
#include
#define SERVER_PORT 8080
int read_all(int fd,void *buf,int n)
{
int nleft;
int nbytes;
char *ptr;
ptr=buf;
nleft=n;
for(;nleft>0;)
{
nbytes=read(fd,ptr,nleft);
if(nbytes