Main Page | Report this Page
Computers Forum Index  »  Computer Architecture - Embedded  »  gcc - missing define?...
Page 1 of 1    

gcc - missing define?...

Author Message
Not Really Me...
Posted: Sat Oct 24, 2009 7:00 pm
Guest
I'm building a project using gcc and coming up with a couple of missing
defines. I've tried this with both native gcc with 686 for a target and
ppc-elf-gcc with a ppc target.

When it includes stdio.h there are a couple of undefined symbols, off_t and
clock_t.

In file included from ..\a01\a0101.c:70:
/usr/include/stdio.h:232: error: parse error before "off_t"
/usr/include/stdio.h:233: error: parse error before "ftello"
/usr/include/stdio.h:362: error: parse error before "__getdelim"
/usr/include/stdio.h:363: error: parse error before "__getline"

#ifndef __STRICT_ANSI__
#ifdef _COMPILING_NEWLIB
int _EXFUN(fseeko, (FILE *, _off_t, int));
_off_t _EXFUN(ftello, ( FILE *));
#else
int _EXFUN(fseeko, (FILE *, off_t, int)); <<<<<<<<<<<<<<<<<<<
off_t _EXFUN(ftello, ( FILE *));
#endif

The "parse error" message is confusing, but the issue appears to be off_t
not being defined.
If I define it locally, the problem goes away.

I think I am missing a command line setting so they aren't included. There
appear to be a couple of different types.h files included, but apparently a
conditional isn't set right to get these enable

Here is the command line:
C:\cygwin\bin\gcc -c -IC:\libsrc34\inc a0101.c

There are a couple of -D on the line, but they are only for the file being
built, and definitely not related to the problem.

Any ideas or suggestions on another ng to post this to?


--
Scott
Validated Software
Lafayette, CO



__________ Information from ESET NOD32 Antivirus, version of virus signature database 4538 (20091024) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com
 
Tauno Voipio...
Posted: Sat Oct 24, 2009 8:38 pm
Guest
Not Really Me wrote:
Quote:
I'm building a project using gcc and coming up with a couple of missing
defines. I've tried this with both native gcc with 686 for a target and
ppc-elf-gcc with a ppc target.

When it includes stdio.h there are a couple of undefined symbols, off_t and
clock_t.

In file included from ..\a01\a0101.c:70:
/usr/include/stdio.h:232: error: parse error before "off_t"
/usr/include/stdio.h:233: error: parse error before "ftello"
/usr/include/stdio.h:362: error: parse error before "__getdelim"
/usr/include/stdio.h:363: error: parse error before "__getline"

#ifndef __STRICT_ANSI__
#ifdef _COMPILING_NEWLIB
int _EXFUN(fseeko, (FILE *, _off_t, int));
_off_t _EXFUN(ftello, ( FILE *));
#else
int _EXFUN(fseeko, (FILE *, off_t, int));
off_t _EXFUN(ftello, ( FILE *));
#endif

The "parse error" message is confusing, but the issue appears to be off_t
not being defined.
If I define it locally, the problem goes away.

I think I am missing a command line setting so they aren't included. There
appear to be a couple of different types.h files included, but apparently a
conditional isn't set right to get these enable

Here is the command line:
C:\cygwin\bin\gcc -c -IC:\libsrc34\inc a0101.c

There are a couple of -D on the line, but they are only for the file being
built, and definitely not related to the problem.

Any ideas or suggestions on another ng to post this to?


Do you have the run-tine libraries and corresponding development
headers installed in the system?

Can you translate and run a simple 'hello.c'?

---

Please understand that the run-time library (and especially stdio)
is heavily dependent on the target system.

--

Tauno Voipio
tauno voipio (at) iki fi
 
Not Really Me...
Posted: Sat Oct 24, 2009 9:20 pm
Guest
Tauno Voipio wrote:
Quote:
Not Really Me wrote:
I'm building a project using gcc and coming up with a couple of
missing defines. I've tried this with both native gcc with 686 for
a target and ppc-elf-gcc with a ppc target.

When it includes stdio.h there are a couple of undefined symbols,
off_t and clock_t.

In file included from ..\a01\a0101.c:70:
/usr/include/stdio.h:232: error: parse error before "off_t"
/usr/include/stdio.h:233: error: parse error before "ftello"
/usr/include/stdio.h:362: error: parse error before "__getdelim"
/usr/include/stdio.h:363: error: parse error before "__getline"

#ifndef __STRICT_ANSI__
#ifdef _COMPILING_NEWLIB
int _EXFUN(fseeko, (FILE *, _off_t, int));
_off_t _EXFUN(ftello, ( FILE *));
#else
int _EXFUN(fseeko, (FILE *, off_t, int));
off_t _EXFUN(ftello, ( FILE *));
#endif

The "parse error" message is confusing, but the issue appears to be
off_t not being defined.
If I define it locally, the problem goes away.

I think I am missing a command line setting so they aren't included.
There appear to be a couple of different types.h files included, but
apparently a conditional isn't set right to get these enable

Here is the command line:
C:\cygwin\bin\gcc -c -IC:\libsrc34\inc a0101.c

There are a couple of -D on the line, but they are only for the file
being built, and definitely not related to the problem.

Any ideas or suggestions on another ng to post this to?


Do you have the run-tine libraries and corresponding development
headers installed in the system?

Can you translate and run a simple 'hello.c'?

---

Please understand that the run-time library (and especially stdio)
is heavily dependent on the target system.

Yes to the run-time. This is a full cygwin install. FWIW, we have tried
this on multliple systems.

I hate to admit I didn't try a hello.c, but I guess that is next. Thanks.



__________ Information from ESET NOD32 Antivirus, version of virus signature database 4538 (20091024) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com
 
Tauno Voipio...
Posted: Sat Oct 24, 2009 9:56 pm
Guest
Not Really Me wrote:
Quote:
Tauno Voipio wrote:
Not Really Me wrote:
I'm building a project using gcc and coming up with a couple of
missing defines. I've tried this with both native gcc with 686 for
a target and ppc-elf-gcc with a ppc target.

When it includes stdio.h there are a couple of undefined symbols,
off_t and clock_t.

In file included from ..\a01\a0101.c:70:
/usr/include/stdio.h:232: error: parse error before "off_t"
/usr/include/stdio.h:233: error: parse error before "ftello"
/usr/include/stdio.h:362: error: parse error before "__getdelim"
/usr/include/stdio.h:363: error: parse error before "__getline"

#ifndef __STRICT_ANSI__
#ifdef _COMPILING_NEWLIB
int _EXFUN(fseeko, (FILE *, _off_t, int));
_off_t _EXFUN(ftello, ( FILE *));
#else
int _EXFUN(fseeko, (FILE *, off_t, int));
off_t _EXFUN(ftello, ( FILE *));
#endif

The "parse error" message is confusing, but the issue appears to be
off_t not being defined.
If I define it locally, the problem goes away.

I think I am missing a command line setting so they aren't included.
There appear to be a couple of different types.h files included, but
apparently a conditional isn't set right to get these enable

Here is the command line:
C:\cygwin\bin\gcc -c -IC:\libsrc34\inc a0101.c

There are a couple of -D on the line, but they are only for the file
being built, and definitely not related to the problem.

Any ideas or suggestions on another ng to post this to?

Do you have the run-tine libraries and corresponding development
headers installed in the system?

Can you translate and run a simple 'hello.c'?

---

Please understand that the run-time library (and especially stdio)
is heavily dependent on the target system.

Yes to the run-time. This is a full cygwin install. FWIW, we have tried
this on multliple systems.

I hate to admit I didn't try a hello.c, but I guess that is next. Thanks.


As far as I know, Cygwin does not run PPC code.

--

Tauno Voipio
tauno voipio (at) iki fi
 
Mel...
Posted: Sun Oct 25, 2009 2:42 am
Guest
Not Really Me wrote:
[ ... ]
Quote:
The "parse error" message is confusing, but the issue appears to be off_t
not being defined.
If I define it locally, the problem goes away.

I think I am missing a command line setting so they aren't included.
There appear to be a couple of different types.h files included, but
apparently a conditional isn't set right to get these enable

Here is the command line:
C:\cygwin\bin\gcc -c -IC:\libsrc34\inc a0101.c

There are a couple of -D on the line, but they are only for the file being
built, and definitely not related to the problem.

Any ideas or suggestions on another ng to post this to?

One thing to try is to grep through the include directories to find out
where the symbol is defined, like

cd c:\libsrc34\inc
grep -R off_t *.h

If it's been hidden somewhere a bit non-standard, that might pull it out.

ISTR that off_t is the type returned by ftello, and used by lseek, if that's
any help.

http://opengroup.org/onlinepubs/007908799/xsh/fseek.html
has handy docs for this type of thing.

Mel.
 
Hans-Bernhard Bröker...
Posted: Sun Oct 25, 2009 3:08 pm
Guest
Not Really Me wrote:

Quote:
When it includes stdio.h there are a couple of undefined symbols, off_t and
clock_t.

In file included from ..\a01\a0101.c:70:
/usr/include/stdio.h:232: error: parse error before "off_t"
/usr/include/stdio.h:233: error: parse error before "ftello"
/usr/include/stdio.h:362: error: parse error before "__getdelim"
/usr/include/stdio.h:363: error: parse error before "__getline"

I don't quite agree that these symptoms match the conclusion preceding
them...

Note that it says "parse error _before_". More often than not, that
means the actual problem really is strictly before the quoted token.

In this case, my primay suspect would be the _EXFUN macro. I suggest
you acquire pre-processor intermediate output (just add options
-save-temps and -dD to your existing compiler invokation) and look at
what these lines actually turned into. As a side effect, you'll also
learn which edition of a types.h header you ended up including.

Quote:
Here is the command line:
C:\cygwin\bin\gcc -c -IC:\libsrc34\inc a0101.c

Just on the off chance it'll make a difference, I would suggest you use
forward slashes, and consider putting GCC in the path for this exercise:

gcc -c -Ic:/libsrc34/inc a0101.c

or even the fully Cygwin-ish style:

gcc -c -I /cygdrive/c/libsrc34/inc a0101.c

And unless your target is actually i686-pc-cygwin or i686-pc-mingw,
which I guess to be somewhat unlikely, you'll have to give this
additional options so it avoids pulling in stuff specific to those
platforms (-nostdinc, a -m specification, ...)

Quote:
There are a couple of -D on the line, but they are only for the file being
built, and definitely not related to the problem.

That's easy for you to say, with nobody else allowed a chance at
checking it...
 
 
Page 1 of 1    
All times are GMT
The time now is Tue Dec 15, 2009 1:21 am