C++ utils linker error
Posted: Fri Apr 20, 2018 9:10 am
C:/Work/Actisense/Esp32_http/build/cpp_utils\libcpp_utils.a(WebSocket.o):(.rodata._ZTI23WebSocketInputStreambuf[typeinfo for WebSocketInputStreambuf]+0x8): undefined reference to `typeinfo for std::basic_streambuf<char, std::char_traits<char> >'
collect2.exe: error: ld returned 1 exit status
make: *** [C:/Work/LibDev/esp32/esp-idf/make/project.mk:388: /c/Work/Actisense/Esp32_http/build/app-template.elf] Error 1
I am getting this error when I used HttpServer. I start happening recently. I was compiling before.
#include "HttpServer.h"
#include "HttpRequest.h"
#include "HttpResponse.h"
#include <Task.h>
#include <WiFi.h>
#include <WiFiEventHandler.h>
#include <tcpip_adapter.h>
#include "esp_log.h"
#include "sdkconfig.h"
#include <esp_wifi.h>
extern "C" {
void app_main(void);
}
static WiFi *wifi;
static void helloWorldHandler(HttpRequest* pRequest, HttpResponse* pResponse)
{
printf("helloWorldHandler gets called\n");
pResponse->setStatus(HttpResponse::HTTP_STATUS_OK, "OK");
pResponse->addHeader(HttpRequest::HTTP_HEADER_CONTENT_TYPE, "text/plain");
pResponse->sendData("Hello back");
pResponse->close();
}
class HttpTask: public Task {
void run(void *data) {
ESP_LOGD("http", "Testing http ...");
HttpServer* pHttpServer = new HttpServer();
pHttpServer->addPathHandler(
HttpRequest::HTTP_METHOD_GET,
"/helloWorld",
helloWorldHandler);
pHttpServer->start(80);
return;
}
};
static HttpTask *http_task;
class MyWiFiEventHandler: public WiFiEventHandler {
public:
esp_err_t staGotIp(system_event_sta_got_ip_t event_sta_got_ip)
{
printf("staGotIp\n");
http_task = new HttpTask();
http_task->setStackSize(12000);
http_task->start();
return ESP_OK;
}
esp_err_t apStart()
{
printf("apStart\n");
/*
esp_err_t err = tcpip_adapter_set_hostname(TCPIP_ADAPTER_IF_STA, "mytest");
printf("tcpip_adapter_set_hostname err=%d\n", err);
*/
return ESP_OK;
}
};
collect2.exe: error: ld returned 1 exit status
make: *** [C:/Work/LibDev/esp32/esp-idf/make/project.mk:388: /c/Work/Actisense/Esp32_http/build/app-template.elf] Error 1
I am getting this error when I used HttpServer. I start happening recently. I was compiling before.
#include "HttpServer.h"
#include "HttpRequest.h"
#include "HttpResponse.h"
#include <Task.h>
#include <WiFi.h>
#include <WiFiEventHandler.h>
#include <tcpip_adapter.h>
#include "esp_log.h"
#include "sdkconfig.h"
#include <esp_wifi.h>
extern "C" {
void app_main(void);
}
static WiFi *wifi;
static void helloWorldHandler(HttpRequest* pRequest, HttpResponse* pResponse)
{
printf("helloWorldHandler gets called\n");
pResponse->setStatus(HttpResponse::HTTP_STATUS_OK, "OK");
pResponse->addHeader(HttpRequest::HTTP_HEADER_CONTENT_TYPE, "text/plain");
pResponse->sendData("Hello back");
pResponse->close();
}
class HttpTask: public Task {
void run(void *data) {
ESP_LOGD("http", "Testing http ...");
HttpServer* pHttpServer = new HttpServer();
pHttpServer->addPathHandler(
HttpRequest::HTTP_METHOD_GET,
"/helloWorld",
helloWorldHandler);
pHttpServer->start(80);
return;
}
};
static HttpTask *http_task;
class MyWiFiEventHandler: public WiFiEventHandler {
public:
esp_err_t staGotIp(system_event_sta_got_ip_t event_sta_got_ip)
{
printf("staGotIp\n");
http_task = new HttpTask();
http_task->setStackSize(12000);
http_task->start();
return ESP_OK;
}
esp_err_t apStart()
{
printf("apStart\n");
/*
esp_err_t err = tcpip_adapter_set_hostname(TCPIP_ADAPTER_IF_STA, "mytest");
printf("tcpip_adapter_set_hostname err=%d\n", err);
*/
return ESP_OK;
}
};