0

I added this line in my c code

uint64_t *ab_cd;  //Line 1

It throws an error stating "external symbol 'ab_cd' defined without a prior declaration".

RULE 8.4 says that "A compatible declaration shall be visible when an object or function with external linkage is defined"

  • Does this answer your question? [QA C warning message in C Code](https://stackoverflow.com/a/37673682/105104) – dvhh Nov 28 '19 at 07:02

1 Answers1

1

Add:

extern uint64_t *ab_cd;

Somewhere before your variable definition. Probably in a header, if this variable is intended to be shared between compilation units. If it’s not, maybe making this variable static would be a better choice?

Carl Norum
  • 219,201
  • 40
  • 422
  • 469