Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations KootK on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

C Headers, part 3

Status
Not open for further replies.

rih5342

Marine/Ocean
May 8, 2007
40
Making progress.

Next error involves macros,
and reviewing Kernigen and Ritchie
4.11.2 Macro Substitution
A definition has the form
#define name replacement text
It calls for a macro substitution of the simplest kind-subsequent occurrences of
the token name will be replaced by the replacement text.

The actual error

C:
C:\gcc\bin\gcc.exe  -c cxdrinit.c
In file included from rpc/types.h:97:0,
                 from rpc/rpc.h:38,
                 from cxdrinit.c:2:
rpc/in.h:38:9: error: macro names must be identifiers
 #define <a name="_NETINET_IN_H_" <="" a=""><b>_NETINET_IN_H_</b>
         ^

Does it make sense to count both left and right brackets?

Suggestions?
 
Replies continue below

Recommended for you

It looks like some HTML got mixed in there. Not sure if that is really in your code or if you copy/pasted from some sort of rich text? Either way, a macro can't start with a _ underscore or a < less than character. It needs to start with a letter.
 
That is a rather strange one. My rpc/rpc.h contains
Code:
#include <netinet/in.h>
But then again, I am running the Linux version: not the Windows version.
 
Maybe that's my problem, I'm mixing windows and Linux.

I'm using Windows7, GCC 5.2, MinGW command-line and make.

Searching for information, I read somewhere that MinGW no longer includes some essential variable types, so this project has changed from a compile link and run to a minor rewrite.

Do you know of a "windows ready" xdr library?
 

Thank you, tried that.

Just to be clear, I'm using Windows7, GCC-5.2, and a MinGW msys-1.0 command window.

I call success being able to download the source, execute ./configure, make, and make install, with no errors.

I have attempted this with:

fxdr_2.1c,
glibc-2.23,
portablexdr-4.91,
WinPortableXDR-4.9.1, and
sunrpc-4.0

The only package that works on my machine is sunrpc.

All the others go down a rabbit hole of macros and header errors.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor