Post by jimmarlowe on Dec 8, 2015 18:48:26 GMT 1
Since building from source for android was successful, I thought I'd try emscripten as well. Urho3d makes it easy enough to read thru the forums and understand how it might be done. I downloaded the emscripten SDK and compiled that, and built the Urho3D source against that. I figured with the smaller assets that I did for the android build, it would work faster on emscripten too. I successfully got an emscripten build, but some samples are not built, and neither is Urho3DPlayer. If no Urho3DPlayer, then no running angelscript code I converted a C++ DroneAnarchy into a sample format, so it could be run by itself, but it got some link errors which make it look like it does not support angelscript yet. The angelscript integration sample is also not in the emscripten build.
So no emscripten DroneAnarchy (for now). Urho3D emscripten is definately a work in progress, and waiting will enable it in the future as an option.
These are the link errors :
JimMarlowe@marlowe-09 ~/tools/MyEm1s $ make
[ 6%] Built target FreeType
[ 6%] Built target JO
[ 7%] Built target LZ4
[ 7%] Built target PugiXml
[ 7%] Built target rapidjson
[ 7%] Built target SDL
[ 7%] Built target StanHull
[ 7%] Built target STB
[ 12%] Built target Lua
[ 13%] Built target toluapp
[ 14%] Built target Detour
[ 15%] Built target DetourCrowd
[ 16%] Built target DetourTileCache
[ 18%] Built target Recast
[ 26%] Built target Box2D
[ 49%] Built target Bullet
[ 51%] Built target tolua++
[ 92%] Built target Urho3D
[ 93%] Built target PackageTool
[ 93%] Checking and packaging resource directories
Checking /home/JimMarlowe/tools/Urho3D-1.5/bin/CoreData...
Checking /home/JimMarlowe/tools/Urho3D-1.5/bin/Data...
[ 93%] Built target RESOURCE_CHECK
Linking CXX executable ../../../bin/41_DroneAnarchy.html
error: unresolved symbol: _ZN6Urho3D14ScriptInstance12CreateObjectEPNS_10ScriptFileERKNS_6StringE
error: unresolved symbol: _ZN6Urho3D6ScriptC1EPNS_7ContextE
Aborting compilation due to previous errors | undefined
Traceback (most recent call last):
File "/home/JimMarlowe/tools/emsdk_portable/emscripten/master/emcc", line 1344, in <module>
final = shared.Building.emscripten(final, append_ext=False, extra_args=extra_args)
File "/home/JimMarlowe/tools/emsdk_portable/emscripten/master/tools/shared.py", line 1571, in emscripten
call_emscripten(cmdline)
File "/home/JimMarlowe/tools/emsdk_portable/emscripten/master/emscripten.py", line 1304, in _main
temp_files.run_and_clean(lambda: main(
File "/home/JimMarlowe/tools/emsdk_portable/emscripten/master/tools/tempfiles.py", line 64, in run_and_clean
return func()
File "/home/JimMarlowe/tools/emsdk_portable/emscripten/master/emscripten.py", line 1310, in <lambda>
DEBUG_CACHE=DEBUG_CACHE,
File "/home/JimMarlowe/tools/emsdk_portable/emscripten/master/emscripten.py", line 1208, in main
temp_files=temp_files, DEBUG=DEBUG, DEBUG_CACHE=DEBUG_CACHE)
File "/home/JimMarlowe/tools/emsdk_portable/emscripten/master/emscripten.py", line 201, in emscript
cwd=path_from_root('src'), error_limit=300)
File "/home/JimMarlowe/tools/emsdk_portable/emscripten/master/tools/jsrun.py", line 75, in run_js
raise Exception('Expected the command ' + str(command) + ' to finish with return code ' + str(assert_returncode) + ', but it returned with code ' + str(proc.returncode) + ' instead! Output: ' + str(ret)[:error_limit])
Exception: Expected the command ['/home/JimMarlowe/tools/emsdk_portable/node/4.1.1_64bit/bin/node', '/home/JimMarlowe/tools/emsdk_portable/emscripten/master/src/compiler.js', '/tmp/tmpE_Pjrd.txt', '/home/JimMarlowe/tools/emsdk_portable/emscripten/master/src/library_pthread_stub.js'] to finish with return code 0, but it returned with code 1 instead! Output: // The Module object: Our interface to the outside world. We import
// and export values on it, and do the work to get that through
// closure compiler if necessary. There are various ways Module can be used:
// 1. Not defined. We create it here
// 2. A function parameter, function(Module) { ..gener
make[2]: *** [bin/41_DroneAnarchy.html] Error 1
make[1]: *** [Source/Samples/42_DroneAnarchy/CMakeFiles/41_DroneAnarchy.dir/all] Error 2
make: *** [all] Error 2
So no emscripten DroneAnarchy (for now). Urho3D emscripten is definately a work in progress, and waiting will enable it in the future as an option.
These are the link errors :
JimMarlowe@marlowe-09 ~/tools/MyEm1s $ make
[ 6%] Built target FreeType
[ 6%] Built target JO
[ 7%] Built target LZ4
[ 7%] Built target PugiXml
[ 7%] Built target rapidjson
[ 7%] Built target SDL
[ 7%] Built target StanHull
[ 7%] Built target STB
[ 12%] Built target Lua
[ 13%] Built target toluapp
[ 14%] Built target Detour
[ 15%] Built target DetourCrowd
[ 16%] Built target DetourTileCache
[ 18%] Built target Recast
[ 26%] Built target Box2D
[ 49%] Built target Bullet
[ 51%] Built target tolua++
[ 92%] Built target Urho3D
[ 93%] Built target PackageTool
[ 93%] Checking and packaging resource directories
Checking /home/JimMarlowe/tools/Urho3D-1.5/bin/CoreData...
Checking /home/JimMarlowe/tools/Urho3D-1.5/bin/Data...
[ 93%] Built target RESOURCE_CHECK
Linking CXX executable ../../../bin/41_DroneAnarchy.html
error: unresolved symbol: _ZN6Urho3D14ScriptInstance12CreateObjectEPNS_10ScriptFileERKNS_6StringE
error: unresolved symbol: _ZN6Urho3D6ScriptC1EPNS_7ContextE
Aborting compilation due to previous errors | undefined
Traceback (most recent call last):
File "/home/JimMarlowe/tools/emsdk_portable/emscripten/master/emcc", line 1344, in <module>
final = shared.Building.emscripten(final, append_ext=False, extra_args=extra_args)
File "/home/JimMarlowe/tools/emsdk_portable/emscripten/master/tools/shared.py", line 1571, in emscripten
call_emscripten(cmdline)
File "/home/JimMarlowe/tools/emsdk_portable/emscripten/master/emscripten.py", line 1304, in _main
temp_files.run_and_clean(lambda: main(
File "/home/JimMarlowe/tools/emsdk_portable/emscripten/master/tools/tempfiles.py", line 64, in run_and_clean
return func()
File "/home/JimMarlowe/tools/emsdk_portable/emscripten/master/emscripten.py", line 1310, in <lambda>
DEBUG_CACHE=DEBUG_CACHE,
File "/home/JimMarlowe/tools/emsdk_portable/emscripten/master/emscripten.py", line 1208, in main
temp_files=temp_files, DEBUG=DEBUG, DEBUG_CACHE=DEBUG_CACHE)
File "/home/JimMarlowe/tools/emsdk_portable/emscripten/master/emscripten.py", line 201, in emscript
cwd=path_from_root('src'), error_limit=300)
File "/home/JimMarlowe/tools/emsdk_portable/emscripten/master/tools/jsrun.py", line 75, in run_js
raise Exception('Expected the command ' + str(command) + ' to finish with return code ' + str(assert_returncode) + ', but it returned with code ' + str(proc.returncode) + ' instead! Output: ' + str(ret)[:error_limit])
Exception: Expected the command ['/home/JimMarlowe/tools/emsdk_portable/node/4.1.1_64bit/bin/node', '/home/JimMarlowe/tools/emsdk_portable/emscripten/master/src/compiler.js', '/tmp/tmpE_Pjrd.txt', '/home/JimMarlowe/tools/emsdk_portable/emscripten/master/src/library_pthread_stub.js'] to finish with return code 0, but it returned with code 1 instead! Output: // The Module object: Our interface to the outside world. We import
// and export values on it, and do the work to get that through
// closure compiler if necessary. There are various ways Module can be used:
// 1. Not defined. We create it here
// 2. A function parameter, function(Module) { ..gener
make[2]: *** [bin/41_DroneAnarchy.html] Error 1
make[1]: *** [Source/Samples/42_DroneAnarchy/CMakeFiles/41_DroneAnarchy.dir/all] Error 2
make: *** [all] Error 2