waveshareteam / Pico_ePaper_Code

Waveshrae Pico e-Paper driver code
GNU General Public License v3.0
124 stars 44 forks source link

Update EPD_3in7.h #15

Closed souramoo closed 2 years ago

souramoo commented 2 years ago

Fix error if functions are called from C++, to allow examples to compile when using EPD_3IN7

This is because the C++ linker tries to mangle the reference when linking to a C library such as this, resulting in the error:

[build] [ 72%] Linking CXX executable pidroponics.elf
[build] ld.exe: CMakeFiles/pidroponics.dir/PidroDisplay.cpp.obj: in function `_ZN11PiDroponics12PidroDisplay11GetInstanceEv':
[build] PidroDisplay.cpp:(.text._ZN11PiDroponics12PidroDisplay11GetInstanceEv+0x16): undefined reference to `_Z19EPD_3IN7_4Gray_Initv'
[build] ld.exe: PidroDisplay.cpp:(.text._ZN11PiDroponics12PidroDisplay11GetInstanceEv+0x1a): undefined reference to `_Z20EPD_3IN7_4Gray_Clearv'
[build] collect2.exe: error: ld returned 1 exit status

Found with @GreenyRepublic