问题描述
我正在尝试编译一个简单的vxworks RTP应用程序。我正在获取对“ hostGetByName”的未定义引用。根据文档,此功能应该在用户空间中可用,并且在VSB中已包含必要的层“ IPNET_USRSPACE”,但仍然出现错误。有什么想法我想念吗?
/* includes */
#include <stdio.h>
#include <hostLib.h>
#include <sockLib.h>
#include <arpa/inet.h>
#include <ctype.h>
#include <fcntl.h>
#include <ifaddrs.h>
#include <netdb.h>
#include <netinet/in.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <unistd.h>
int main (
int argc,/* number of arguments */
char * argv[] /* array of arguments */
) {
char *inGroup;
int host;
host = hostGetByName(inGroup);
return 0;
}
对“ hostGetByName”的未定义引用
解决方法
看起来链接程序没有选择网络库。
-lnet
将完成工作。