Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Using C++ regex causes compile to fail #125

Closed
znebby opened this issue Oct 4, 2018 · 2 comments
Closed

Using C++ regex causes compile to fail #125

znebby opened this issue Oct 4, 2018 · 2 comments

Comments

@znebby
Copy link

znebby commented Oct 4, 2018

I'm trying to use C++ regex.

#include <regex>

std::regex poly_regex("[a-z0-9_-]{11}", std::regex::icase);

When I build, I get:

/usr/local/eosio.cdt/bin/wasm-ld: error: locale.cpp.o: undefined symbol: strftime_l
/usr/local/eosio.cdt/bin/wasm-ld: error: memory.cpp.o: undefined symbol: __cxa_pure_virtual
/usr/local/eosio.cdt/bin/wasm-ld: error: system_error.cpp.o: undefined symbol: __cxa_pure_virtual

if I comment out that line (not the include), it builds fine.

@sim31
Copy link

sim31 commented Oct 9, 2018

I get undefined symbol: __cxa_pure_virtual error as well, when I have pure virtual functions in my own code.

Related issues:
EOSIO/eos#5832
nlohmann/json#1284

@larryk85
Copy link
Contributor

the issue with __cxa_pure_virtual has been resolved for v1.3.0. But, for classes like regex/stringstream and some other classes that rely on std::locale, most of the functionality is broken. Even if these were patched to work, they will bloat the size of your contract very dramatically, so to keep cpu/ram costs these types shouldn't be used any way.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants