# RISC-V Compiler

**URL:** <https://forums.sifive.com/t/risc-v-compiler/2527>\
**Category:** RISC-V\
**Created:** [June 28, 2019, 12:08pm UTC](https://forums.sifive.com/t/risc-v-compiler/2527 "2019-06-28T12:08:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Blueburn2](https://avatars.discourse-cdn.com/v4/letter/b/ea5d25/32.png) [@Blueburn2](https://forums.sifive.com/u/Blueburn2)\
**Post date:** [June 28, 2019, 12:08pm UTC](https://forums.sifive.com/t/risc-v-compiler/2527/1 "2019-06-28T12:08:53Z")

</div>

@jimw

**Since you already built the cross compiler, you should be using it to try to compile your firmware code.**

Okay…so can you tell me what steps I have to follow to use the cross-compiler in place of default gcc to compile my firmware code…(say my C code is in test.c)  
Bcz I just can’t use the command “gcc test.c”…When I tried that, I was under the impression that it would automatically use the cross-compiler …But it turned out that it was using the default built-in GCC. **So can u help me how to use the cross-compiler**?

---

<div class="post-metadata">

**Author:** ![Ciaran](https://avatars.discourse-cdn.com/v4/letter/c/c77e96/32.png) [@Ciaran](https://forums.sifive.com/u/Ciaran)\
**Post date:** [June 28, 2019, 1:33pm UTC](https://forums.sifive.com/t/risc-v-compiler/2527/2 "2019-06-28T13:33:08Z")

</div>

Hi,

I have limit knowledge on this but you could try the following:  
Instead of using “gcc test.c” try using the “riscv\*\*-unknown-elf-gcc test.c” where \*\* is either 64 or 32 depending on which you’ve built.
