You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Other include files (e.g. esp_http_server.h) already have the extern "C" {.
When missing, the compile works, but the linker does not find the httpd_ssl_start() and httpd_ssl_stop() functions, because they are not available in the C++ namespace.
Expected Behavior
Be able to include esp_https_server.h in C++ source files.
Actual Behavior
Link errors with functions httpd_ssl_start() and httpd_ssl_stop() when included from C++ source files.
LD build/test.elf
C:/Msys32/home/ifranzki/esp/test/build/main\libmain.a(httpd.o):(.literal._Z16httpd_initializev+0x48): undefined reference to `httpd_ssl_start(void**, httpd_ssl_config*)'
C:/Msys32/home/ifranzki/esp/test/build/main\libmain.a(httpd.o):(.literal._Z15httpd_terminatev+0x0): undefined reference to `httpd_ssl_stop(void*)'
C:/Msys32/home/ifranzki/esp/test/build/main\libmain.a(httpd.o): In function `httpd_initialize()':
C:/Msys32/home/ifranzki/esp/test/main/httpd.cpp:347: undefined reference to `httpd_ssl_start(void**, httpd_ssl_config*)'
C:/Msys32/home/ifranzki/esp/test/build/main\libmain.a(httpd.o): In function `httpd_terminate()':
C:/Msys32/home/ifranzki/esp/test/main/httpd.cpp:354: undefined reference to `httpd_ssl_stop(void*)'
collect2.exe: error: ld returned 1 exit status
make: *** [C:/Msys32/home/ifranzki/esp/esp-idf/make/project.mk:458: /home/ifranzki/esp/test/build/test.elf]
Other items if possible
None
The text was updated successfully, but these errors were encountered:
Alvin1Zhang
changed the title
Include file esp_https_server.h misses 'extern "C"' when included in C++ sources
[TW#28162] Include file esp_https_server.h misses 'extern "C"' when included in C++ sources
Dec 27, 2018
Environment
Problem Description
The include file
esp_https_server.h
misses theextern "C" {
so that it can be included from C++ files:Other include files (e.g.
esp_http_server.h
) already have theextern "C" {
.When missing, the compile works, but the linker does not find the httpd_ssl_start() and httpd_ssl_stop() functions, because they are not available in the C++ namespace.
Expected Behavior
Be able to include
esp_https_server.h
in C++ source files.Actual Behavior
Link errors with functions httpd_ssl_start() and httpd_ssl_stop() when included from C++ source files.
Steps to repropduce
See below.
Code to reproduce this issue
USe example '/protocols/https_server' but within an C++ source file:
https://github.com/espressif/esp-idf/blob/master/examples/protocols/https_server/main/main.c
Debug Logs
Other items if possible
None
The text was updated successfully, but these errors were encountered: