← Back to team overview

leaningtech-dev team mailing list archive

[Bug 1254187] Re: Undefined JS functions called (std::string char_traits)

 

I believe you have to link /opt/duetto/lib/libc++.bc with the client
side build. Something like this:

/opt/duetto/bin/clang -target duetto -c -emit-llvm test.cpp -o test.bc
/opt/duetto/bin/llvm-link test.bc /opt/duetto/lib/libc++.bc -o linked.bc
/opt/duetto/bin/duetto-compiler linked.bc

Also note that this complexity is only required for the 0.9.1 release.
The upcoming 0.9.2 (and current git) will be able to automatically link
system libs.

-- 
You received this bug notification because you are a member of
Leaningtech Team, which is subscribed to Duetto.
https://bugs.launchpad.net/bugs/1254187

Title:
  Undefined JS functions called (std::string char_traits)

Status in Duetto: C++ for the Web:
  New

Bug description:
  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.

To manage notifications about this bug go to:
https://bugs.launchpad.net/duetto/+bug/1254187/+subscriptions


References