Hi @rohan,
I’ve been trying to implement libwebp into my project, using PlatformIO, but I can’t seem to be able to even build it. My firmware is arduino based, although I’ve tried using just espidf and have similar errors at linking time.
I understand this might go well beyond the purpose of this forum, so it’s ok if you can’t/won’t point me to the right direction.
I’m basically having this error (this is for arduino code, but espidf gives me similar undefined reference errors):
Compiling .pio/build/webp/src/main.cpp.o
Linking .pio/build/webp/firmware.elf
.pio/build/webp/src/main.cpp.o:(.literal._Z8testWebpv+0x4): undefined reference to `WebPAnimDecoderOptionsInitInternal'
.pio/build/webp/src/main.cpp.o:(.literal._Z8testWebpv+0x8): undefined reference to `WebPAnimDecoderNewInternal'
.pio/build/webp/src/main.cpp.o:(.literal._Z8testWebpv+0xc): undefined reference to `WebPAnimDecoderGetInfo'
.pio/build/webp/src/main.cpp.o:(.literal._Z8testWebpv+0x10): undefined reference to `WebPAnimDecoderHasMoreFrames'
.pio/build/webp/src/main.cpp.o:(.literal._Z8testWebpv+0x14): undefined reference to `WebPAnimDecoderGetNext'
.pio/build/webp/src/main.cpp.o:(.literal._Z8testWebpv+0x18): undefined reference to `WebPAnimDecoderReset'
.pio/build/webp/src/main.cpp.o:(.literal._Z8testWebpv+0x1c): undefined reference to `WebPAnimDecoderDelete'
.pio/build/webp/src/main.cpp.o: In function `testWebp()':
/Users/carlos/projects/esp32/test-webp/src/main.cpp:27: undefined reference to `WebPAnimDecoderOptionsInitInternal'
/Users/carlos/projects/esp32/test-webp/src/main.cpp:27: undefined reference to `WebPAnimDecoderNewInternal'
/Users/carlos/projects/esp32/test-webp/src/main.cpp:27: undefined reference to `WebPAnimDecoderGetInfo'
/Users/carlos/projects/esp32/test-webp/src/main.cpp:27: undefined reference to `WebPAnimDecoderHasMoreFrames'
/Users/carlos/projects/esp32/test-webp/src/main.cpp:27: undefined reference to `WebPAnimDecoderGetNext'
/Users/carlos/projects/esp32/test-webp/src/main.cpp:27: undefined reference to `WebPAnimDecoderReset'
/Users/carlos/projects/esp32/test-webp/src/main.cpp:27: undefined reference to `WebPAnimDecoderDelete'
collect2: error: ld returned 1 exit status
*** [.pio/build/webp/firmware.elf] Error 1
my directory structure looks like:
test-webp
├── .pio
├── include
│ └── README
├── lib
│ ├── README
│ └── libwebp
│ ├── library.json
│ └── src
│ ├── Makefile.am
│ ├── dec
│ ├── demux
│ ├── dsp
│ ├── enc
│ ├── libwebp.pc.in
│ ├── libwebp.rc
│ ├── libwebpdecoder.pc.in
│ ├── libwebpdecoder.rc
│ ├── mux
│ ├── utils
│ └── webp
├── platformio.ini
├── src
│ └── main.cpp
The code is very simple and based on google’s example, as I just created a new project to try to get this working, before implementing in on my code.
library.json
{
"name": "libwebp",
"build": {
"srcFilter": [
"+<src/**/*.c>"
],
"unflags": [
"-DHAVE_CONFIG_H"
]
}
}
I’m including demux.h
#include <webp/demux.h>
I’ve also tried including decode.h, and using extern "C"
notation, but none of that made any difference
extern "C" {
#include <webp/decode.h>
#include <webp/demux.h>
}
Are you using any additional building scripts or configuration that I might be missing?
Any suggestions would be much appreciated.
Thanks!