[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

C library problem



Anyone seen this problem before?

gcc_cris -melinux -muclibc=/home/work/axis/axis/eroot -s -symbolic diglogd.o
-o diglogd
diglogd.o(.text+0x93c): undefined reference to `_alphasort'
diglogd.o(.text+0x942): undefined reference to `_scandir'
make: *** [diglogd] Error 1

scandir + alphasort are defined in dirent.h but when linking to C library it
fails because the symbols referenced don't seem to exist in library that
comes with devboard-R1_0_2-with_compiler.tgz.


Can anyone try to compile this code and and see if it works on devboard LX?

#include <dirent.h>

int sort_dir(char *path){
    int err;
    struct dirent **nlist;
 
    err = scandir(path, &nlist, 0, alphasort);
 
    if (err < 0){
        perror(__FUNCTION__);
        return errno;
    }
    else
        while(err--) printf("%s\n", nlist[err]->d_name);
 
    return 0;
}  

int main(){
	sort_dir(".");
	return 0;
}

-- 
                                    | 1. Wild enthusiam
Historic Project Stages for all     | 2. Gradual disillusionment
Silicon Valley Projects.            | 3. Search for the guilty
                                    | 4. Punishment of the innocents
Where are you at?                   | 5. Promotion of non-participants