当前位置: 技术问答>linux和unix
关于gcc编译的一个简单问题
来源: 互联网 发布时间:2015-09-20
本文导语: bash-2.03$ gcc unixnet.cpp -o unixnet Undefined first referenced symbol in file gethostbyname /var/tmp/ccQl3q1u.o herror ...
bash-2.03$ gcc unixnet.cpp -o unixnet
Undefined first referenced
symbol in file
gethostbyname /var/tmp/ccQl3q1u.o
herror /var/tmp/ccQl3q1u.o
ld: fatal: Symbol referencing errors. No output written to unixnet
collect2: ld returned 1 exit status
请教这是什么问题.
Undefined first referenced
symbol in file
gethostbyname /var/tmp/ccQl3q1u.o
herror /var/tmp/ccQl3q1u.o
ld: fatal: Symbol referencing errors. No output written to unixnet
collect2: ld returned 1 exit status
请教这是什么问题.
|
gethostbyname和herror用了哪个库,gcc的时候用-l包含进来
|
试试用g++编译看看
|
#include
#include
#include
#include
再试试!
#include
#include
#include
再试试!
|
g++
|
g++!!!
|
#include
#include
#include
#include
#include
#include
#include
|
不是编译器的问题
gethostbyname,herror要使用头文件
#include
#include
你用man命令看一下就知道了
gethostbyname,herror要使用头文件
#include
#include
你用man命令看一下就知道了
|
upppppppp!!!!!!!!!!!
|
这个这个。。。
没注意到是cpp文件啊
g++
没注意到是cpp文件啊
g++