0

I have a portion of the code as:

__weak  void TimingDelay_Decrement(void) {

}

and it keeps throwing up the captioned error. I checked the web and couldn't find relevant content for the __weak case. Any help is appreciated.

srkdb
  • 775
  • 3
  • 15
  • 28
  • 1
    `__weak` is probably specific to a certain compiler. Maybe you're using a different compiler. – Fiddling Bits Aug 17 '18 at 18:17
  • Possible duplicate: https://stackoverflow.com/questions/274753/how-to-make-weak-linking-work-with-gcc – user3386109 Aug 17 '18 at 18:17
  • 3
    `__weak` is not a keyword of standard C. I have only guesses as to what it might mean to whatever compiler your code was originally written for. The compiler you are using now doesn't know, either. It might work simply to remove the `__weak`, or to `#define` it to nothing, but it would be wise to first figure out what it was supposed to accomplish. – John Bollinger Aug 17 '18 at 18:17
  • I'm running this in the Atollic TrueStudio IDE, which says "Built on Eclipse, CDT, GCC and GDB. Simple to extend." – srkdb Aug 17 '18 at 18:23
  • Difference between [`#include ` and `#include "file.h"`](http://gcc.gnu.org/onlinedocs/cpp/Include-Syntax.html) – alvits Aug 17 '18 at 18:44
  • @P__J__ - I think you didn't see the comment I was commenting on. It's not related to the __weak definition. It's about the file not being found. Look at 3 comments above this. – alvits Aug 17 '18 at 20:28

1 Answers1

2

Because it is ARM Cortex gcc toolchain so the __weak is a definition of __attribute__((weak)).

The easiest way to add is to amend the gcc command line arguments: -D__weak=__attribute__((weak))

0___________
  • 60,014
  • 4
  • 34
  • 74