From some random moment and for some unknown reason, my compiler stopped working. It lets me know about errors, warnings, etc., but i still get this error:
/home/vhajsman/opt/cross/lib/gcc/i686-elf/14.0.0/../../../../i686-elf/bin/ld: cannot find crt0.o: No such file or directory
/home/vhajsman/opt/cross/lib/gcc/i686-elf/14.0.0/../../../../i686-elf/bin/ld: cannot find -lc: No such file or directory
collect2: error: ld returned 1 exit status
/home/vhajsman/opt/cross/lib/gcc/i686-elf/14.0.0/../../../../i686-elf/bin/ld: cannot find crt0.o: No such file or directory
/home/vhajsman/opt/cross/lib/gcc/i686-elf/14.0.0/../../../../i686-elf/bin/ld: cannot find -lstdc++: No such file or directory
/home/vhajsman/opt/cross/lib/gcc/i686-elf/14.0.0/../../../../i686-elf/bin/ld: cannot find -lm: No such file or directory
/home/vhajsman/opt/cross/lib/gcc/i686-elf/14.0.0/../../../../i686-elf/bin/ld: cannot find -lc: No such file or directory
collect2: error: ld returned 1 exit status
cp: missing destination file operand after 'build/obj'
Try 'cp --help' for more information.
/home/vhajsman/opt/cross/lib/gcc/i686-elf/14.0.0/../../../../i686-elf/bin/ld: cannot find build/obj/*: No such file or directory
collect2: error: ld returned 1 exit status
I dont get it. Can someone please help me? Here is my build script, but i am sure it is correct, because compiler can not even compile simple hello world program (which is 100% correct) without throwing these errors.
SOURCES_CPP=$(find -type f -name "*.cpp")
SOURCES_C=$(find -type f -name "*.c")
SOURCES_ASM=$(find -type f -name "*.s")
CFLAGS=" -ffreestanding -O2 -Wall -Wextra -fno-exceptions -lgcc -I ./src/ -I ./src/libs/libc"
i686-elf-as $SOURCES_ASM
i686-elf-gcc $CFLAGS $SOURCES_C -std=gnu99
i686-elf-g++ $CFLAGS $SOURCES_CPP -fno-rtti
OBJFILES=$(find -type f -name "*.out")
cp $OBJFILES "build/obj"
rm -f $OBJFILES
i686-elf-g++ -T src/linker.ld -o build/bin/cubebox.bin -ffreestanding -O2 -nostdlib build/obj/* -lgcc
Can someone, please explain and help me? Thanks!