kripken/emscripten — Issue #186: Undefined reference to std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::__init(char const*, unsigned int)
Author: Andrepuel
Created: 2012-01-27 16:23:32+00:00
State: open

This simple code doesnt run:

#include

void func(std::string a) {
std::string b = a;
b+="_";
}

int main() {
func("aa");

return 0;
}

Because std::__1::basic_string, std::__1::allocator >::__init(char const*, unsigned int) -- __ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcj -- is undefined.

On the disassembled bytecode the function definition is also missing.

Using bisect I found that 1cb0ec225dd97470208cc9e3b59cf35d8f4e3a0b is the first bad commit. On the previous commit, cf5947187de4390ad0440940f323470b37befbc8, this function is present on the disassembled bytecode.