Keil Logo Arm Logo

GCC: ERROR (UNDEFINED REFERENCE TO ...)


Information in this article applies to:

  • GNU C Compiler for ARM All Versions

QUESTION

I have added my C source file, MYFILE.C, to my µVision project. When I compile and link the project, all external functions and variables of this module are reported as Error: undefined reference to .... I am sure that these functions and variables are defined in the other modules. What is the reason for this error?

ANSWER

The GNU tools are case sensitive. The file extension '.C' (uppercase C) is considered to be a C++ module, not a C module. The function and variable names are not compatible across C and C++ modules unless they are defined as extern "C".

Change the file extension to '.c' (lowercase c) and add this file to your project again. The filename may contain lowercase and uppercase characters.

Last Reviewed: Monday, July 10, 2006


Did this article provide the answer you needed?
 
Yes
No
Not Sure
 

Keil logo

Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

ARM’s Privacy Policy has been updated. By continuing to use our site, you consent to ARM’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.

Acquisition of ARM Holdings plc. by SoftBank Group Corp.

We are pleased to inform you that on 5 September 2016, SoftBank Group Corp. acquired ARM Holdings Plc. ARM will continue to operate as an independent business within the SoftBank group.

Any current agreements between ARM Ltd (or other ARM group companies, as applicable) you / your company remain in effect as between the parties, and the parties will continue to be bound by and perform the obligations in such agreements. If you have any queries please direct these to ARMSoftbank-Notifications@arm.com.