/usr/local/Cellar/riscv-gnu-toolchain/main/lib/gcc/riscv64-unknown-elf/13.2.0/…/…/…/…/riscv64-unknown-elf/bin/ld: final link failed: file in wrong format
collect2: error: ld returned 1 exit status
make: *** [build/RTOSDemo.axf] Error 1
I didn’t edit the makefile or any other files, what could be the error and what could be the solution?
How did you install the RISC-V toolchain? I have the following version and I am able to successfully build this project on Ubuntu -
$ /usr/bin/riscv64-unknown-elf-gcc --version
riscv64-unknown-elf-gcc () 10.2.0
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
I’m trying to run it on windows 10. Also, I downloaded the required toolchain from GitHub and I added it to the path but still the same error is occurring.
Ps. the toolchain is successfully installed because the version command doesn’t give an error and it gives the same respond as yours.
I tried on Mac and it worked great! I can’t try it on ubuntu because I need it on windows.
The link is: I can’t add a link but it is on github riscv-collab/riscv-gnu-toolchain
The response is:
riscv64-unknown-elf-gcc (GCC) 10.1.0
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.