Multiple definition of functions when trying to use regex

zliudr
Posts: 141
Joined: Thu Oct 03, 2019 5:15 am

Multiple definition of functions when trying to use regex

Postby zliudr » Wed Apr 22, 2020 6:35 am

I "make clean" already. Code is minimal. It seems that I can't use

Code: Select all

In function `std::__throw_logic_error(char const*)':
functexcept.cc:(.text._ZSt19__throw_logic_errorPKc+0x0): multiple definition of `std::__throw_logic_error(char const*)'
My code: hello_world.cpp

Code: Select all

#include "esp_system.h"
#include <iostream>
#include <regex>


extern "C" void app_main()
{
	char char_array[]="12345678";
	//std::string str="12345678901234";
	std::regex reg1 ("^(\\d{8}|\\d{12,14})$");

   for (int i = 10; i >= 0; i--) 
	{
        vTaskDelay(1000 / portTICK_PERIOD_MS);
    }
    esp_restart();
}

ESP_Sprite
Posts: 3469
Joined: Thu Nov 26, 2015 4:08 am

Re: Multiple definition of functions when trying to use regex

Postby ESP_Sprite » Wed Apr 22, 2020 8:08 am

If you haven't done this already, can you post this as an issue on Github as well? Makes it a bit easier for us to track it and give feedback.

zliudr
Posts: 141
Joined: Thu Oct 03, 2019 5:15 am

Re: Multiple definition of functions when trying to use regex

Postby zliudr » Wed Apr 22, 2020 1:45 pm

Thank you for your advice! I've not raised this issue on git yet. I'm using V3.3 so I'm not very up to date. I've read that the beta version of ESP-IDF 4.1 has included regex.h support for C. I'd rather use C support than the C++ std (ugly and probably costs unnecessarily large memory footprint with concats). But I'm in the middle of an important development and don't want to introduce any uncertainties by updating my tool chain. If I can get regex match with V3.3 that would be great. Thanks.

ESP_igrr
Posts: 1656
Joined: Tue Dec 01, 2015 8:37 am

Re: Multiple definition of functions when trying to use regex

Postby ESP_igrr » Wed Apr 22, 2020 3:26 pm

Tracking this internally as IDFGH-3153.

zliudr
Posts: 141
Joined: Thu Oct 03, 2019 5:15 am

Re: Multiple definition of functions when trying to use regex

Postby zliudr » Thu Apr 23, 2020 3:18 am

Should I still post to git? Thanks.

ESP_igrr
Posts: 1656
Joined: Tue Dec 01, 2015 8:37 am

Re: Multiple definition of functions when trying to use regex

Postby ESP_igrr » Thu Apr 23, 2020 8:36 am

No need, already have an issue logged for this. Will give you feedback once this is resolved.

nickname
Posts: 5
Joined: Sat Sep 28, 2019 2:37 am

Re: Multiple definition of functions when trying to use regex

Postby nickname » Thu May 21, 2020 6:46 am

Hi @zliudr,

Do you mind trying the attached patch? I could reproduce your problem on IDF v3.3 and the patch solves it.

Thanks!
Attachments
0001-Add-missing-regex_error-stub.zip
(990 Bytes) Downloaded 13 times

Who is online

Users browsing this forum: No registered users and 16 guests