I'm attempting to set up Keil uVision to build a simple C++ program for the STM32F3 microcontroller. I've downloaded the GNU ARM toolchain on my Windows computer and placed it into the directory C:\Program Files (x86)\GNU Tools ARM Embedded\bin\. In Keil, I created a project and opened a window Manage Project Items where I was able to select Use GCC Compiler (GNU) for ARM projects and specified the prefix arm-none-eabi-.

When I click Build, the output window shows that it finishes compiling and reaches the linking stage. Here's the output:

Rebuild target 'Target 1' linking... --- Error: failed to execute 'arm-none-eabi-gcc' ".\evt-bms.elf" - 1 Error(s), 0 Warning(s). Target not created. Build Time Elapsed: 00:00:00

I've verified that arm-none-eabi-gcc.exe is in the bin directory (though I'd be expecting a complaint about g++ since it's a C++ source).

Here's a screenshot of the Folders/Extensions settings page: Folders/Extensions settings screenshot

Does anyone have any ideas for further debugging I can do? It'd be great if the output window had a little more information, as it really isn't all that helpful by just saying it couldn't run it without any context of the command it attempted.

  • \$\begingroup\$ C++ code needs to be linked with the …-g++ compiler driver, because the linker cannot tell from the .o files that these used to be C++, so linking with …-gcc will not link correctly. There should be a setting somewhere to select how to call the linker, but I don't have a current installation, so I cannot check. \$\endgroup\$ – Simon Richter Oct 14 '17 at 2:15
  • \$\begingroup\$ Try running the identical command line from a terminal, to see what the compiler says directly. (You can add -v or --verbose for more information) \$\endgroup\$ – Brian Drummond Oct 14 '17 at 10:53
  • \$\begingroup\$ @BrianDrummond unfortunately I can't even see what command was run that triggered that. The output I posted was the result of clicking the Build or Rebuild buttons. \$\endgroup\$ – Shane Snover Oct 15 '17 at 13:32
  • 1
    \$\begingroup\$ There will be some way to get that command line - buried deep in the documentation, no doubt. \$\endgroup\$ – Brian Drummond Oct 15 '17 at 20:41

I use Keil µVision, too (didn't even know you can set the GNU compiler)

I installed the "GNU Tools ARM Embedded\6 2017-q2-update" and Keil automatically filled the path - but without the leading /bin/ as seen in your screenshot. Maybe try removing it? (e.g. my path is "C:\Program Files (x86)\GNU Tools ARM Embedded\6 2017-q2-update\")


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.