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