If an existing project was using IAR but you want switch to GCC you have the following options.
A - Restart the project from scratch but this time select GCC as a toolchain.
B - Change the toolchain to GCC in the project configuration of the existing IAR project.
This article is showing the steps for the option B below.
1. Go to Project->Build Configurations->Manage..
2. Create a new build configuration by New..
3. Select GNU ARM v4.9.3 – default option. Then press OK.
4. Set the newly created GNU ARM configuration active. You can delete the IAR ARM configuration if you are sure that you don’t want to switch back for IAR in the future.
5. Go to File-> Properties for opening the project properties window. Go to C/C++ build -> Settings then select Memory Layout on the Tool Settings tab. Make sure the project configuration is GNU ARM. Now browse for the linker script of your device.
6. Open the .isc file on your workspace with text editor.
7. Replace the iar with gcc in the line which starts with architecture. Save the .isc with CTRL + S.
8. Close the .isc and reopen with double click. Press Generate.
9. Optional step: If your project using additional header or library files then the built in SDK examples you may add their paths to project on the project configuration window. See point 5.
10. Now build your project. (CTRL + B). The project should build with GCC without errors.