# extern and PROGMEM

**URL:** <https://forum.arduino.cc/t/extern-and-progmem/616100>\
**Category:** Programming\
**Created:** [October 18, 2019, 6:31pm UTC](https://forum.arduino.cc/t/extern-and-progmem/616100 "2019-10-18T18:31:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![MGarber123](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/mgarber123/32/1126675_2.png) [@MGarber123](https://forum.arduino.cc/u/MGarber123)\
**Post date:** [October 18, 2019, 6:31pm UTC](https://forum.arduino.cc/t/extern-and-progmem/616100/1 "2019-10-18T18:31:12Z")

</div>

... the 2 dont seem compatable.

if I put:  
**const int PROGMEM x[] = {1,2};**  
in one file, and ....

**extern const int PROGMEM x[];**  
:  
**int a=x[0];**  
in another, they both compile find but I get the linker error:

(filename).cpp:(line# of a=x[0]) : undefined reference to x

---

<div class="post-metadata">

**Author:** ![Juraj](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/juraj/32/238785_2.png) [@Juraj](https://forum.arduino.cc/u/Juraj)\
**Post date:** [October 19, 2019, 3:57am UTC](https://forum.arduino.cc/t/extern-and-progmem/616100/2 "2019-10-19T03:57:41Z")

</div>

int a = pgm\_read\_word\_near(x + i);

> **[PROGMEM - Arduino Reference](https://www.arduino.cc/reference/en/language/variables/utilities/progmem/)**
>
> The Arduino programming language Reference, organized into Functions, Variable and Constant, and Structure keywords.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [May 6, 2021, 12:05am UTC](https://forum.arduino.cc/t/extern-and-progmem/616100/3 "2021-05-06T00:05:07Z")

</div>


