linux - I'm trying to write a shell command to find and compile all C programs -
i'm trying write shell command find , compile c programs
find . -type f -name '*.c' -exec sh -c 'gcc {} -o $(dirname {})/$(basename {} .c)' \;
is have now, , compile c files, returns these errors.
/usr/lib/gcc/x86_64-redhat-linux/4.7.2/../../../../lib64/crt1.o: in function `_start': (.text+0x20): undefined reference `main' collect2: error: ld returned 1 exit status
i'm stuck , appreciated.
you don't have main defined c file/files. check individual inclusions trying create separate executable each of c file. want show #include of compiled files.
Comments
Post a Comment