Undefined JS symbols when running HelloServer.cpp example

Asked by Artem

I'm trying to run the Hello Server example from http://leaningtech.com/duetto/examples/.
Duetto 0.9.1 is installed using Ubuntu/Debian packages (from http://ppa.launchpad.net/leaningtech-dev/duetto-ppa/ubuntu).
Since https://answers.launchpad.net/duetto/+question/238985 I've created a Tntnet-based server stub (https://gist.github.com/ArtemGr/7607371) which compiles and runs fine (/opt/duetto/bin/clang++ -duetto-side=server -std=c++11 -O3 duetto_server_stub.cpp /opt/duetto/share/duetto/deserializer.cpp HelloServer.cpp -o HelloServer -pthread -ltntnet -lcxxtools && ./HelloServer).

I've created hw.html:
<html><head>
<script type="text/javascript" src="duetto.js"></script>
<script type="text/javascript" src="HelloServer.js"></script>
</head><body></body></html>
And duetto.js is a symbolic link to /opt/duetto/share/duetto/examples/duetto.js

When I try to run it in the browser I get a JavaScript error "ReferenceError: __ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcj is not defined" in HelloServer.js:5.

Here's the HelloServer.js: http://pastebin.com/0WBatpUx
And here's the duetto.js: http://pastebin.com/wQB3kjS9

It seems Duetto generates a JavaScript file with symbols absent from the duetto.js.
How can I fix this?

Question information

Language:
English Edit question
Status:
Solved
For:
Cheerp Edit question
Assignee:
No assignee Edit question
Solved by:
Artem
Solved:
Last query:
Last reply:
Revision history for this message
Artem (artemciy) said :
#1

I figured this is some std::string initialization stuff not necessary on the client so as a workaround I created the empty functions:
<script type="text/javascript">
  function __ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcj() {}
  function __ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED1Ev() {}
</script>
and now the HelloServer example works!

Revision history for this message
Artem (artemciy) said :
#2

This shouldn't happen, I guess. Created a bug report.