Emscriptenを使用して、私はImpulseEngine project by Randy Gaul (C++)をJavaScriptプログラムにコンパイルしようとしていました。 Emscriptenを実行したら、hereというチュートリアルに従いました。私はすべての手順に従っています。.cppファイルを.bcファイルにリンクし、それらを.jsファイルにコンパイルします。ここでEmscriptenでJavaScriptにC++ ImpulseEngineをコンパイル
は、私が走ったコマンドの一覧です:
た.cpp - > .BC:
emcc ImpulseEngine-master/main.cpp -o main.bc
emcc ImpulseEngine-master/Scene.cpp -o Scene.bc
emcc ImpulseEngine-master/Render.cpp -o Render.bc
emcc ImpulseEngine-master/Precompiled.cpp -o Precompiled.bc
emcc ImpulseEngine-master/Manifold.cpp -o Manifold.bc
emcc ImpulseEngine-master/Collision.cpp -o Collision.bc
emcc ImpulseEngine-master/Clock.cpp -o Clock.bc
emcc ImpulseEngine-master/Body.cpp -o Body.bc
.BC - >が
emcc main.bc Scene.bc Render.bc Precompiled.bc Manifold.bc Collision.bc Clock.bc Body.bc -s LEGACY_GL_EMULATION=1 -o github/khanfusiion3.github.io/index.html
注意を.jsファイル-s LEGACY_GL_EMULATION=1
オプション:これは、 OpenGLの機能を有効にします。私は、コマンドを実行したときに確かに、ここに見られるように、私はまだ、未解決のシンボルに関するいくつかの警告を受けた:
warning: unresolved symbol: glPointSize
warning: unresolved symbol: glRasterPos2i
warning: unresolved symbol: glutBitmapCharacter
warning: unresolved symbol: glutBitmap9By15
理論的には、プログラムは今かかわらず、次に何が起こるかの失敗しますが、私はとにかく試してみました。それはすぐに間違いを投げ出して終了した。ここでは、すべてのエラーのリストがコンソールに記録されます。
WARNING: using emscripten GL emulation. This is a collection of limited workarounds, do not expect it to work.Module.printErr @ khanfusiion3.github.io/:1249
khanfusiion3.github.io/:1249 WARNING: using emscripten GL emulation unsafe opts. If weirdness happens, try -s GL_UNSAFE_OPTS=0Module.printErr @ khanfusiion3.github.io/:1249
khanfusiion3.github.io/:1249 pre-main prep time: 12 msModule.printErr @ khanfusiion3.github.io/:1249
khanfusiion3.github.io/:1249 WARNING: using emscripten GL immediate mode emulation. This is very limited in what it supportsModule.printErr @ khanfusiion3.github.io/:1249
khanfusiion3.github.io/:1249 missing function: glRasterPos2iModule.printErr @ khanfusiion3.github.io/:1249
khanfusiion3.github.io/:1237 -1
khanfusiion3.github.io/:1249 -1Module.printErr @ khanfusiion3.github.io/:1249
khanfusiion3.github.io/:1249 warning: build with -s DEMANGLE_SUPPORT=1 to link in libcxxabi demanglingModule.printErr @ khanfusiion3.github.io/:1249
/index.js:1879 Uncaught abort(-1) at Error
at jsStackTrace (http://khanfusiion3.github.io/index.js:1060:13)
at stackTrace (http://khanfusiion3.github.io/index.js:1077:22)
at abort (http://khanfusiion3.github.io/index.js:25065:44)
at _glRasterPos2i (http://khanfusiion3.github.io/index.js:8051:58)
at __Z12RenderStringiiPKc (http://khanfusiion3.github.io/index.js:13374:2)
at Array.__Z11PhysicsLoopv (http://khanfusiion3.github.io/index.js:9462:2)
at dynCall_v (http://khanfusiion3.github.io/index.js:24605:30)
at Object.Runtime.dynCall (http://khanfusiion3.github.io/index.js:331:39)
at http://khanfusiion3.github.io/index.js:8107:21
at Object.Browser.mainLoop.runIter (http://khanfusiion3.github.io/index.js:1873:13)
私はまた-s DEMANGLE_SUPPORT=1
オプションでそれを実行してみましたが、他のエラーが停止していないので、それはまだ失敗しました。
エラーの原因と解決方法についてのヘルプがありますか?
シンボルglPointSize、glRasterPos2i、glutBitmapCharacter、およびglutBitmap9By15が未解決のようです。あなたがすでに見たように。 – immibis