I get the following errors with my code when using nmake

input.c(375) : error C2065: 'ulong' : undeclared identifier
input.c(375) : error C2146: syntax error : missing ';' before identifier 'datelo'
input.c(375) : error C2065: 'datelo' : undeclared identifier
input.c(376) : error C2146: syntax error : missing ';' before identifier 'datehi'
input.c(376) : error C2065: 'datehi' : undeclared identifier
input.c(377) : error C2065: 'lp' : undeclared identifier
input.c(380) : error C2059: syntax error : ')'

void v100msg_ntoh(MPSysLogMsg_v100* msg) {
#if !defined(BIGENDIAN)
  ulong datelo;
  ulong datehi;
  ulong* lp;

  msg->naddr_len = ntohs(msg->naddr_len);
  lp = (ulong*)&msg->date;

  datehi = ntohl(lp[1]);
  datelo = ntohl(lp[0]);

  lp[0] = datehi;
  lp[1] = datelo;

  msg->type = ntohs(msg->type);
  msg->naddr_type = ntohs(msg->naddr_type);
  msg->universe_len = ntohs(msg->universe_len);
  msg->logfile_len = ntohs(msg->logfile_len);
  msg->prog_len = ntohs(msg->prog_len);
  msg->pid_len = ntohs(msg->pid_len);
  msg->tid_len = ntohs(msg->tid_len);
  msg->package_len = ntohs(msg->package_len);
  msg->tag_len = ntohs(msg->tag_len);
  msg->msg_len = ntohs(msg->msg_len);

#endif /* if !defined(BIGENDIAN) */

any one got any ideas on how to fix my problem?

4 Years
Discussion Span
Last Post by RonalBertogi

input.c(375) : error C2065: 'ulong' : undeclared identifier:

Are you declaring ulong? i.e. typedef unsigned long ulong;

This might fix the other errors you have, I'm unsure since I don't have access to the full source code.


Is this C or C++ code? What are the error messages you get once you declare what ulong is?


C++ using visual studio 6 due to source being very old it is not my own work am just trying to get it running and I tried that and it never worked


You shouldn't attempt to just rip code. I don't / Can't tell what the issues are without compiling it myself because I do not have the files needed. When you try to compile the code you submitted, what are the error messages? I don't know, this might be C code, have you tried compiling it using C?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.