Hi, I have a main.c file as follows:
#include "lpc_system_init.h" int main(void) { uint32_t adc_value; System_Init(); // Initialize System while(1) { // Start conversion ADC_StartCmd(LPC_ADC, ADC_START_NOW); //Wait conversion complete while (!(ADC_ChannelGetStatus(LPC_ADC, ADC_CHANNEL_4, ADC_DATA_DONE))); adc_value = ADC_ChannelGetData(LPC_ADC, ADC_CHANNEL_4); //Display the result of conversion on the UART0 printf(LPC_UART0,"\x1b[1;1H ADC value on channel 4: %d04", adc_value); } return 1; }
I am getting 15 errors as:
linking... .\Objects\Adc1.axf: Error: L6200E: Symbol rb multiply defined (by lpc_syetem_init.o and main.o). .\Objects\Adc1.axf: Error: L6200E: Symbol rb multiply defined (by lpc17xx_adc.o and main.o). .\Objects\Adc1.axf: Error: L6200E: Symbol rb multiply defined (by lpc17xx_gpio.o and main.o). .\Objects\Adc1.axf: Error: L6200E: Symbol rb multiply defined (by lpc17xx_systick.o and main.o). .\Objects\Adc1.axf: Error: L6200E: Symbol rb multiply defined (by lpc17xx_uart.o and main.o). .\Objects\Adc1.axf: Error: L6200E: Symbol EscFlag multiply defined (by lpc_syetem_init.o and main.o). .\Objects\Adc1.axf: Error: L6200E: Symbol EscFlag multiply defined (by lpc17xx_adc.o and main.o). .\Objects\Adc1.axf: Error: L6200E: Symbol EscFlag multiply defined (by lpc17xx_gpio.o and main.o). .\Objects\Adc1.axf: Error: L6200E: Symbol EscFlag multiply defined (by lpc17xx_systick.o and main.o). .\Objects\Adc1.axf: Error: L6200E: Symbol EscFlag multiply defined (by lpc17xx_uart.o and main.o). .\Objects\Adc1.axf: Error: L6200E: Symbol TxIntStat multiply defined (by lpc_syetem_init.o and main.o). .\Objects\Adc1.axf: Error: L6200E: Symbol TxIntStat multiply defined (by lpc17xx_adc.o and main.o). .\Objects\Adc1.axf: Error: L6200E: Symbol TxIntStat multiply defined (by lpc17xx_gpio.o and main.o). .\Objects\Adc1.axf: Error: L6200E: Symbol TxIntStat multiply defined (by lpc17xx_systick.o and main.o). .\Objects\Adc1.axf: Error: L6200E: Symbol TxIntStat multiply defined (by lpc17xx_uart.o and main.o). Not enough information to list image symbols. Not enough information to list load addresses in the image map. Finished: 2 information, 0 warning and 15 error messages. ".\Objects\Adc1.axf" - 15 Error(s), 2 Warning(s). Target not created.
Please Help!!!
"multiply defined" is dreadful English. What they mean is, "has multiple definitions"
So the message become:
Symbol 'rb' has multiple definitions (by lpc_syetem_init.o and main.o)
Thank you for your reply but the problem is I have checked all my source and header files which are mentioned in the error. But none of them contain any definition of either "rb" or "EscFlag" or "TxIntStat". So I cannot resolve these errors.
But clearly they do - that's why you are getting the error!
If all else fails, try looking at the Preprocessor Output...
www.keil.com/.../armcc_chr1359124916428.htm
Doing anything stupid like #including a C file?
Do a find-in-files on TxIntStat
Or defining a variable in an include file which you then include into everything else?
Remember to use "extern" in .H files where appropriate