Release config works but I get compile errors in Debug config

Go To Last Post
3 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 

Hi,

 

I am using Eclipse +Ubuntu 14.04 + AVR Dragon and program in C. Currently, I am trying to get up to speed with hardware debugging in Ubuntu. (I used to use AS 4 and 6 and debugging with my AVRONE! was great back in the day)

 

My code builds and runs flawlessly when I build it in Release mode. However, when I try to build it in Debug mode, I receive the following error, which makes no sense.

 

avr-gcc -Wl,-Map,PWM_Drive_for_RGB_LED_WS2812.map -mmcu=atmega328p -o "PWM_Drive_for_RGB_LED_WS2812.elf"  ./PWM_Drive.o ./adc_atmega328p.o ./timer0_atmega328p.o   
./timer0_atmega328p.o: In function `__vector_14':
../timer0_atmega328p.c:261: undefined reference to `rgbLogic1Signal'
../timer0_atmega328p.c:263: undefined reference to `rgbLogic0Signal'
collect2: error: ld returned 1 exit status

 

Another interesting thing about the above error is that the line numbers 261 and 263 in the respective files correspond to totally irrelevant parts of the code where there is no reference to the functions rgbLogic1Signal and rgbLogic0Signal . (mind you all optimizations are turned off as well during the build)

 

Any suggestions on what may be happening here?

 

Thanks

 

 

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

When you build "Release" it defines "NDEBUG". When you build "Debug" it defines "DEBUG" instead - perhaps some code is predicated on these?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 

That may be the case.

 

Note the two functions that are flagged here are defined as follows. Maybe using "inline" is the issue here. I will check this.

 

inline void rgbLogic0Signal()

inline void rgbLogic1Signal()