| |||||
Technical Support Support Resources
Product Information | GCC: USING PRINTF WITH GNUInformation in this article applies to:
QUESTIONI have problems when linking C code that contains calls to standard library functions like printf. My target is Keil MCB2100 with Philips LPC2129 CPU and I am using the GNU C Compiler that was included with this Board. When I link my application I get the message listed below: linking... main.o(.text+0x18): In function 'main': main.c(8): error: undefined reference to 'printf' collect2: ld returned 1 exit status ANSWERYou need to configure the GNU Run-time system. A good example that shows this is in the folder Keil\ARM\GNU\Examples\Measure. Take a look at the dialog Project — Options — Linker. It is important that you add standard run-time libraries and that you re-target the low-level output routines with similar functions as shown in the files SYSCALLS.C and SERIAL.C. As an alternative, you may download the current revision of the Keil ARM tools and use the Keil CARM Compiler. The run-time system of this compiler is designed for embedded systems and will work instantly with the MCB2100 Board. MORE INFORMATION
SEE ALSOLast Reviewed: Tuesday, January 16, 2007 | ||||
| |||||