Hello,

i'm trying to port Kaffe (www.kaffe.org) to a Windows Mobile Platform
using CeGCC, but i have a problem with seekdir and telldir functions.

For example, if i try to compile with CeGCC this program:

----- start telldir.c ----
#include <dirent.h>
#include <sys/types.h>
#include <errno.h>
#include <string.h>
#include <stdio.h>

int main(){

  DIR *mydir = opendir(".");

  if (mydir == NULL)
    {
      printf("Err: %s\n", strerror(errno)) ;
    }

  else
    {
      long int currLoc = telldir(mydir);
      printf("telldir : %d\n", currLoc);

      printf("Seekdir\n");
      seekdir(mydir, currLoc);
        

    }
  }

---- end telldir.c -----

i get this error:

[EMAIL PROTECTED] /cygdrive/c/Code
$ arm-wince-cegcc-gcc-4.1.0 -std=gnu99 telldir.c -o telldir-arm.exe
Info: resolving _CRT_MT by linking to __imp__CRT_MT (auto-import)
/cygdrive/c/DOCUME~1/zzmlatr/IMPOST~1/Temp/ccETF0iv.o:telldir.c:(.text+0x5c):
undefined reference to `telldir'
/cygdrive/c/DOCUME~1/zzmlatr/IMPOST~1/Temp/ccETF0iv.o:telldir.c:(.text+0x84):
undefined reference to `seekdir'
collect2: ld returned 1 exit status

but a compilation with gcc-x86 is successful:

[EMAIL PROTECTED] /cygdrive/c/Code
$ gcc telldir.c -o telldir-x86.exe

[EMAIL PROTECTED] /cygdrive/c/Code
$ ./telldir-x86.exe
telldir : 0
Seekdir

I'm using Cygwin on Windows XP with CeGCC 0.51 binary package (the
file i downloaded from sourceforge.net is
cygwin-cegcc-cegcc-0.51.0-1.tar.gz). It is located in /opt/cegcc.

the command "arm-wince-cegcc-gcc-4.1.0 -v" gives:

Using built-in specs.
Target: arm-wince-cegcc
Configured with: /home/pedro/cegcc/0.51/src/gcc/configure --with-gcc
--with-gnu-ld --with-gnu-as --target=arm-wince-cegcc
--prefix=/opt/cegcc --enable-threads=win32 --disable-nls
--enable-languages=c,c++ --disable-win32-registry --disable-multilib
--disable-interwork --without-newlib --enable-checking --with-headers
Thread model: win32
gcc version 4.1.0

It seems that telldir and seekdir functions are not defined in libc.
In fact if i try to show the symbol on libc.a ( compiled for x86) i
give:

$ nm /lib/libc.a | grep seekdir
00000000 I __imp___seekdir
00000000 T __seekdir
00000000 I __imp___seekdir64
00000000 T __seekdir64
seekdir.o:
         U __imp___seekdir64
00000000 I __imp__seekdir
00000000 T _seekdir

while for libc.a (bundled with CeGCC):

[EMAIL PROTECTED] /cygdrive/c/Code
$ arm-wince-cegcc-nm.exe /opt/cegcc/arm-wince-cegcc/lib/libc.a | grep seekdir

Can someone give me a suggestion on how to solve this problem ?

Thank you very much,

Mario Latronico

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Cegcc-devel mailing list
Cegcc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cegcc-devel

Reply via email to