Ld emits ignoring invalid character `#' in expression


What can cause this error?
c:/users/frank/.platformio/packages/toolchain-xtensa32/bin/…/lib/gcc/xtensa-esp32-elf/5.2.0/…/…/…/…/xtensa-esp32-elf/bin/ld.exe:esp32_out.ld:23: ignoring invalid character `#’ in expression
c:/users/frank/.platformio/packages/toolchain-xtensa32/bin/…/lib/gcc/xtensa-esp32-elf/5.2.0/…/…/…/…/xtensa-esp32-elf/bin/ld.exe:esp32_out.ld:23: syntax error

Compile part is clean. Message gives no hint as to where to look. or what might be wrong. I have 1 global,

i2c_port_t i2c_num; defined in the main module and used in a submodule. I have included

extern i2c_port_t i2c_num;

in its header (.h) file
This may be a red herring but I have tried a number of other possibilities. that don’t go anywhere

Any help is appreciated.


Could you take a look at the esp32_out.ld-file in your projects directory? It can be found in your projects directory in the .pioenvs-folder. Just use the windows search function to get the exact path there. Open the file in any texteditor and paste the region around line 23 here.