question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Undefined reference to `_binary_src_certs_pem_start'

See original GitHub issue

I want to use SSL, so I have put " certs.pem " in /src folder. In the main.c, I have put " extern const char cert_start[] asm("_binary_src_certs_pem_start"); ". and in platformio.ini, I have put " board_build.embed_txtfiles = src/certs.pem ". I have tried to build the code and clean before the build and the same error: …

Linking .pio/build/esp32dev/firmware.elf
/home/walidamriou/.platformio/packages/toolchain-xtensa32/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld: .pio/build/esp32dev/esp-idf/src/update.c.o:(.literal.update+0x4): undefined reference to `_binary_src_certs_pem_start'
collect2: error: ld returned 1 exit status
*** [.pio/build/esp32dev/firmware.elf] Error 1

I can fix the problem by using the certificate direct in the main.c but I want to use it as a file, this how I have used it in main.c:

const char* cert = \
"-----BEGIN CERTIFICATE-----\n" \
"MIIEkjCCA3qgAwIBAgIQCgFBQgAAAVOFc2oLheynCDANBgkqhkiG9w0BAQsFADA/\n" \
"MSQwIgYDVQQKExtEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdCBDby4xFzAVBgNVBAMT\n" \
"DkRTVCBSb290IENBIFgzMB4XDTE2MDMxNzE2NDA0NloXDTIxMDMxNzE2NDA0Nlow\n" \
...
"wApIvJSwtmVi4MFU5aMqrSDE6ea73Mj2tcMyo5jMd6jmeWUHK8so/joWUoHOUgwu\n" \
"X4Po1QYz+3dszkDqMp4fklxBwXRsW10KXzPMTZ+sOPAveyxindmjkW8lGy+QsRlG\n" \
"PfZ+G6Z6h7mjem0Y+iWlkYcV4PIWL1iwBi8saCbGS5jN2p8M+X+Q7UNKEkROb3N6\n" \
"KOqkqm57TH2H3eDJAkSnh6/DNFu0Qg==\n" \
"-----END CERTIFICATE-----\n";

Any solutions or ideas to fix this problem?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
valeroscommented, Sep 2, 2020

Hi guys, sorry for the late reply. I pushed some changes together with updates for ESP-IDF v4.1 that could possibly fix this issue.

It would be great if you could retest your projects with the upstream version:

[env:upstream_develop]
platform = https://github.com/platformio/platform-espressif32.git
framework = esp-idf
board = ...

Symbol names should be without additional paths, e.g. _binary_coap_ca_pem_start for coap_ca.pem

Read more comments on GitHub >

github_iconTop Results From Across the Web

undefined reference to (function) c++ [duplicate] - Stack Overflow
This is true in general case, but first thing you think about when somebody asks about undefined reference in C++ should be "does...
Read more >
Undefined reference to stacktrace standard library - GNU.org
cpp ``` And I get the next output: ``` /usr/bin/ld: a-cpp_file.o: in function `std::stacktrace_entry::_S_init()': cpp_file.cpp:(.text.
Read more >
C compilation Error: undefined reference to - YouTube
C compilation Error: undefined reference to. Watch later. Share. Copy link. Info. Shopping. Tap to unmute. If playback doesn't begin shortly ...
Read more >
undefined reference to espeak function - compiling - Ask Ubuntu
I just edited this part ############ Find ESPEAK TTS ############ find_path(LIBESPEAK_INCLUDE_DIRS NAMES speak_lib.h HINTS ...
Read more >
Undefined references when compiling - Forum Open Cascade ...
I built OCC as static libraries, and now I want to build a static binary for portability. My code is: // STEP Read...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found