简体   繁体   English

错误:预期在'。'之前的','或'...'。 代币

[英]error: expected `,' or `…' before '.' token

It compiles on an intel/linux 64bit machine just fine.. 它可以在intel / linux 64位计算机上编译。

But I need to have this compile and work to test for Big/Little Endian on a SunOS machine.. But its not compiling.. 但是我需要进行编译,然后才能在SunOS机器上测试Big / Little Endian。但是它没有编译。

Here is the Error:
   util.h:48: error: expected `,' or `...' before '.' token

Here is The Header Portion of the declaration @ line 48: 这是第48行声明的标题部分:

 void addrFromHostname(const char* hostName, in_addr_t *s_addr);

Here is the CPP file of the function: 这是函数的CPP文件:

 void addrFromHostname(const char* hostName, in_addr_t *s_addr){
   struct hostent *server;
   server = gethostbyname(hostName);

   if (server == NULL) {
     fprintf(stderr,"ERROR, no such host as %s\n", hostName);
     exit(0);
   }

   bcopy((char *)server->h_addr, (char *)s_addr, server->h_length);
 }

the declaration might be incorrect. 声明可能不正确。 It should be: 它应该是:

void addrFromHostname(const char* , in_addr_t*);

Check it out. 看看这个。

在第48行之前的某个地方看起来像是语法错误,可能是缺少括号或分号。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM