Question

It compiles on an intel/linux 64bit machine just fine..

But I need to have this compile and work to test for Big/Little Endian on a SunOS machine.. But its not compiling..

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

Here is The Header Portion of the declaration @ line 48:

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

Here is the CPP file of the function:

 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);
 }
Was it helpful?

Solution

the declaration might be incorrect. It should be:

void addrFromHostname(const char* , in_addr_t*);

Check it out.

OTHER TIPS

It looks like a syntax error somewhere before line 48, maybe a missing parenthesis or semicolon.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top