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 2

Status
Not open for further replies.

rih5342

Marine/Ocean
May 8, 2007
40
Non-C programmer here.

I'm using GCC and Gfortran V5.2 (which BTW self compiled perfectly), on Windows7(64).

I'm getting this C error.

rpc/types.h:78:9: error: unknown type name '__u_char'
typedef __u_char u_char;

What does the double underscore do, what does it mean?

Thank you.
 
Replies continue below

Recommended for you

If the code is following ANSI standards, double underscores are reserved for compiler-specific libraries/functions.

Dan - Owner
URL]
 

Therefor in this case, since I have the source code, does it make sense to remove all the double underscores?

Thank you.
 
How can you remove them? They're part of the compiler library. You have to change your source code so you aren't attempting something that's weirding out the compiler or you need to get the compiler fixed.

Or are you actually typing in the double underscores?

Keith Cress
kcress -
 
I think a good book on ANSI C is in order here. While learning what compiler errors really mean appears to be a right of passage for all programmers, it would help immensely if you understood what the basic code is attempting to do... for example, what "typedef" means. I think once you understood that, the error will make more sense... you may not know enough to immediately resolve the issue, but you will likely be able to track down the root cause.

Dan - Owner
URL]
 

Sometimes open source projects compile link and run effortlessly which motivates you to try another, like this project, which requires the xdr components from glibc.

The source code is readily available but the headers account for half the code.

It's convoluted because of all the ifdef possibilities to accommodate compiling on almost any hardware.

Thank you for your input.

 
Are you running an IDE or just compiling with GCC? I would try bringing the project into an IDE. It might provide better descriptions of the errors and hopefully give you more direction. I personally like Code::Blocks, which is free.
 

I'm using a combination of command-line and makefile, and Codeblocks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor