Author Topic: Wierd Compilation Errors  (Read 6070 times)

GTar

  • Guest
Wierd Compilation Errors
« on: July 03, 2006, 05:09:07 pm »
I'm getting a whole stack of compile error any time I try and include a standard library from a C++ project I'm working on. Something along the lines of:

Code
C:/Program Files/CodeBlocks/include/stdio.h:405: error: `off64_t' has not been declared
C:/Program Files/CodeBlocks/include/stdio.h:412: error: expected init-declarator before "ftello64"
C:/Program Files/CodeBlocks/include/stdio.h:412: error: expected `,' or `;' before "ftello64"
... ( goes on and on )

The wierdest thing is that I've got many other projects set up running very similar code which compile fine with no problems! This leads me to believe that I might be missing something in my code or in the build options. Currently compiling under WinXP.

Any ideas???

Offline Michael

  • Lives here!
  • ****
  • Posts: 1608
Re: Wierd Compilation Errors
« Reply #1 on: July 03, 2006, 05:17:55 pm »
Hello,

Difficult to say. You should give some more info, e.g., C::B revision, which standard library, and so on.

Check if you do not have done a syntax error somewhere. Try also a re-build. May be it works.

Best wishes,
Michael

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Wierd Compilation Errors
« Reply #2 on: July 03, 2006, 05:20:29 pm »
off64_t is defined in types.h, line 115 if _OFF64_T_ is not defined.

stdio.h includes types.h if __MSVCRT__ is defined and __NO_MINGW_LFS is not defined.

Possible causes of your problem:
1. types.h does not exist. Can be ruled out because then you would see the error "cannot stat file" instead. You did not post any such thing.
2. The file does exist, but it corrupted for some reason (and it happens to display no other error). Very unlikely, but possible - who could tell for sure. Maybe a conflict with include paths, too, using some outdated file from somewhere?
3. stdio.h does not include types.h. As __MSVCRT__ is always defined in MinGW, this means that you have defined __NO_MINGW_LFS somewhere.
4. stdio.h includes types.h, but off64_t is not being typedefed. You have defined _OFF64_T_ earlier.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

GTar

  • Guest
Re: Wierd Compilation Errors
« Reply #3 on: July 04, 2006, 04:08:19 am »
Ah, I think I might know the problem. I've got my own header file defined types.h which looks something like the following:

Code
#ifndef _TYPES_H_
#define _TYPES_H_

...

#endif // _TYPES_H_

Think I've found my problem, cheers :)