Emscripten not generating HTML file (but does generate js & data files)
by Jeff Moretti · in Torque 2D Professional · 02/14/2018 (7:59 am) · 7 replies
Dear GarageGames,
I have been working diligently on converting a TGB 1.7.5 game to the new Torque 2D MIT (3.3), primarily for the purpose of generating a web build of my game. I have been working hard on generating the Web build, and came to a point where the compiler would finish compiling, but only generate the following files:
- PuzzleGalaxiesWeb.html.data
- PuzzleGalaxiesWeb.html.js
- PuzzleGalaxiesWeb.html.js.mem (note this file was only generated when doing a release build)
js
The file I'm missing is the basic html file.
Do you know why this might be occurring? Or perhaps you can give me some direction on how to generate it on my own from this point?
Thanks in advance :)
Jeff Moretti
Evermore Game Studios
I have been working diligently on converting a TGB 1.7.5 game to the new Torque 2D MIT (3.3), primarily for the purpose of generating a web build of my game. I have been working hard on generating the Web build, and came to a point where the compiler would finish compiling, but only generate the following files:
- PuzzleGalaxiesWeb.html.data
- PuzzleGalaxiesWeb.html.js
- PuzzleGalaxiesWeb.html.js.mem (note this file was only generated when doing a release build)
js
The file I'm missing is the basic html file.
Do you know why this might be occurring? Or perhaps you can give me some direction on how to generate it on my own from this point?
Thanks in advance :)
Jeff Moretti
Evermore Game Studios
About the author
Recent Threads
#2
Here's the warnings/notifications I get when building (at the end):
[100%] Linking CXX executable PuzzleGalaxiesWeb.html.js
warning: emitted code will contain very large numbers of local variables, which is bad for performance (build to JS with -O2 or above to avoid this - make sure to do so both on source files, and during 'linking')
warning: unresolved symbol: _Z7dStrstrPKcS0_
warning: unresolved symbol: _ZN13DisplayDevice15getVerticalSyncEv
warning: unresolved symbol: _ZN16AudioDescriptionC1Ev
warning: unresolved symbol: _ZN18VorbisStreamSourceC1EPKc
warning: unresolved symbol: _book_maptype1_quantvals
warning: unresolved symbol: ogg_page_bos
warning: unresolved symbol: ogg_page_eos
warning: unresolved symbol: ogg_page_granulepos
warning: unresolved symbol: ogg_page_serialno
warning: unresolved symbol: ogg_stream_clear
warning: unresolved symbol: ogg_stream_init
warning: unresolved symbol: ogg_stream_packetout
warning: unresolved symbol: ogg_stream_pagein
warning: unresolved symbol: ogg_stream_reset
warning: unresolved symbol: ogg_stream_reset_serialno
warning: unresolved symbol: ogg_sync_buffer
warning: unresolved symbol: ogg_sync_clear
warning: unresolved symbol: ogg_sync_init
warning: unresolved symbol: ogg_sync_pageseek
warning: unresolved symbol: ogg_sync_reset
warning: unresolved symbol: ogg_sync_wrote
warning: unresolved symbol: oggpack_adv
warning: unresolved symbol: oggpack_bytes
warning: unresolved symbol: oggpack_look
warning: unresolved symbol: oggpack_read
warning: unresolved symbol: oggpack_readinit
warning: unresolved symbol: oggpack_write
warning: unresolved symbol: oggpack_writeclear
warning: unresolved symbol: oggpack_writeinit
warning: unresolved symbol: ov_ilog
warning: unresolved symbol: vorbis_book_clear
warning: unresolved symbol: vorbis_book_init_decode
warning: unresolved symbol: vorbis_book_init_encode
warning: unresolved symbol: vorbis_staticbook_destroy
warning: unresolved symbol: TypeFontAssetPtr
warning: unresolved symbol: _ZTI9FontAsset
warning: unresolved symbol: mapping0_exportbundle
[100%] Built target PuzzleGalaxiesWeb.html
jeffmoretti@jeffmoretti-Aspire-5734Z:~/Documents/MyGames/PuzzleGalaxiesWeb/engine/compilers/emscripten$
Thanks, any ideas?
02/20/2018 (7:18 pm)
Yes, I am going off the guide you mentioned.Here's the warnings/notifications I get when building (at the end):
[100%] Linking CXX executable PuzzleGalaxiesWeb.html.js
warning: emitted code will contain very large numbers of local variables, which is bad for performance (build to JS with -O2 or above to avoid this - make sure to do so both on source files, and during 'linking')
warning: unresolved symbol: _Z7dStrstrPKcS0_
warning: unresolved symbol: _ZN13DisplayDevice15getVerticalSyncEv
warning: unresolved symbol: _ZN16AudioDescriptionC1Ev
warning: unresolved symbol: _ZN18VorbisStreamSourceC1EPKc
warning: unresolved symbol: _book_maptype1_quantvals
warning: unresolved symbol: ogg_page_bos
warning: unresolved symbol: ogg_page_eos
warning: unresolved symbol: ogg_page_granulepos
warning: unresolved symbol: ogg_page_serialno
warning: unresolved symbol: ogg_stream_clear
warning: unresolved symbol: ogg_stream_init
warning: unresolved symbol: ogg_stream_packetout
warning: unresolved symbol: ogg_stream_pagein
warning: unresolved symbol: ogg_stream_reset
warning: unresolved symbol: ogg_stream_reset_serialno
warning: unresolved symbol: ogg_sync_buffer
warning: unresolved symbol: ogg_sync_clear
warning: unresolved symbol: ogg_sync_init
warning: unresolved symbol: ogg_sync_pageseek
warning: unresolved symbol: ogg_sync_reset
warning: unresolved symbol: ogg_sync_wrote
warning: unresolved symbol: oggpack_adv
warning: unresolved symbol: oggpack_bytes
warning: unresolved symbol: oggpack_look
warning: unresolved symbol: oggpack_read
warning: unresolved symbol: oggpack_readinit
warning: unresolved symbol: oggpack_write
warning: unresolved symbol: oggpack_writeclear
warning: unresolved symbol: oggpack_writeinit
warning: unresolved symbol: ov_ilog
warning: unresolved symbol: vorbis_book_clear
warning: unresolved symbol: vorbis_book_init_decode
warning: unresolved symbol: vorbis_book_init_encode
warning: unresolved symbol: vorbis_staticbook_destroy
warning: unresolved symbol: TypeFontAssetPtr
warning: unresolved symbol: _ZTI9FontAsset
warning: unresolved symbol: mapping0_exportbundle
[100%] Built target PuzzleGalaxiesWeb.html
jeffmoretti@jeffmoretti-Aspire-5734Z:~/Documents/MyGames/PuzzleGalaxiesWeb/engine/compilers/emscripten$
Thanks, any ideas?
#3
- the vorbis/ogg warnings are due to removing certain .c files from the assets list. I did this because these certain files had a 'main' function in them which was disrupting the build (only one main function allowed in build)
- other warnings, such as the following:
warning: unresolved symbol: _Z7dStrstrPKcS0_
warning: unresolved symbol: _ZN13DisplayDevice15getVerticalSyncEv
I found the compiler couldnt compile these due to errors in the code files, such as not being able to use const as an argument in the func, or getVertical not being implemented? I think it was something like that.
Let me know if this helps.
02/20/2018 (7:21 pm)
BTW I should also add, many of the warnings are due to the following (I am fairly certain on this anyways):- the vorbis/ogg warnings are due to removing certain .c files from the assets list. I did this because these certain files had a 'main' function in them which was disrupting the build (only one main function allowed in build)
- other warnings, such as the following:
warning: unresolved symbol: _Z7dStrstrPKcS0_
warning: unresolved symbol: _ZN13DisplayDevice15getVerticalSyncEv
I found the compiler couldnt compile these due to errors in the code files, such as not being able to use const as an argument in the func, or getVertical not being implemented? I think it was something like that.
Let me know if this helps.
#4
02/21/2018 (7:28 am)
It's weird to see the line " Built target PuzzleGalaxiesWeb.html", but you don't see it after the build finishes. Does the unmodified T2D MIT repo generate a build properly for you?
#5
Well...as per your question, the answer is no. The unmodified T2D MIT repo will not build. I had to work out a bunch of stuff to get to the point I was at above, Id say there was a good 5 or 6 issues I came across that I corrected to get there.
Nonetheless, I appreciate you helping me :) I'm happy to go through each error one-by-one on this forum with you if you wish. Feel free to let me know how to correct the first (below) error, and then I will attempt to recompile and let you know what I get next (I can even give you tips on how to fix the future bugs too).
The other option of course too is for me to leave this to you to sort out all of the various issues with the building (in emscripten) and get back to me once you've worked them out.
Ok....so the below error is the first error I get:
jeffmoretti@jeffmoretti-Aspire-5734Z:~/Documents/MyGames/Torque2D-master/engine/compilers/emscripten$ sh ./generate.sh
-- Configuring done
CMake Error at CMakeLists.txt:503 (ADD_EXECUTABLE):
Cannot find source file:
../../source/2d/sceneobject/ImageFont.cc
Tried extensions .c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh .h++ .hm .hpp
.hxx .in .txx
CMake Error: CMake can not determine linker language for target: Torque2D.html
CMake Error: Cannot determine link language for target "Torque2D.html".
-- Generating done
-- Build files have been written to: /home/jeffmoretti/Documents/MyGames/Torque2D-master/engine/compilers/emscripten
jeffmoretti@jeffmoretti-Aspire-5734Z:~/Documents/MyGames/Torque2D-master/engine/compilers/emscripten$ ^C
jeffmoretti@jeffmoretti-Aspire-5734Z:~/Documents/MyGames/Torque2D-master/engine/compilers/emscripten$
I believe this error is due to a old filename. I believe the file that should be included is 'TextSprite.cc' not 'ImageFont.cc'
Let me know what you think :)
Cheers,
Jeff
02/22/2018 (7:34 pm)
Hi Mike,Well...as per your question, the answer is no. The unmodified T2D MIT repo will not build. I had to work out a bunch of stuff to get to the point I was at above, Id say there was a good 5 or 6 issues I came across that I corrected to get there.
Nonetheless, I appreciate you helping me :) I'm happy to go through each error one-by-one on this forum with you if you wish. Feel free to let me know how to correct the first (below) error, and then I will attempt to recompile and let you know what I get next (I can even give you tips on how to fix the future bugs too).
The other option of course too is for me to leave this to you to sort out all of the various issues with the building (in emscripten) and get back to me once you've worked them out.
Ok....so the below error is the first error I get:
jeffmoretti@jeffmoretti-Aspire-5734Z:~/Documents/MyGames/Torque2D-master/engine/compilers/emscripten$ sh ./generate.sh
-- Configuring done
CMake Error at CMakeLists.txt:503 (ADD_EXECUTABLE):
Cannot find source file:
../../source/2d/sceneobject/ImageFont.cc
Tried extensions .c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh .h++ .hm .hpp
.hxx .in .txx
CMake Error: CMake can not determine linker language for target: Torque2D.html
CMake Error: Cannot determine link language for target "Torque2D.html".
-- Generating done
-- Build files have been written to: /home/jeffmoretti/Documents/MyGames/Torque2D-master/engine/compilers/emscripten
jeffmoretti@jeffmoretti-Aspire-5734Z:~/Documents/MyGames/Torque2D-master/engine/compilers/emscripten$ ^C
jeffmoretti@jeffmoretti-Aspire-5734Z:~/Documents/MyGames/Torque2D-master/engine/compilers/emscripten$
I believe this error is due to a old filename. I believe the file that should be included is 'TextSprite.cc' not 'ImageFont.cc'
Let me know what you think :)
Cheers,
Jeff
#6
02/23/2018 (10:34 am)
Unfortunately, I do not currently have the bandwidth to go through all the troubleshooting and set up a dev environment for T2D. It's been years since I even cloned the repo. I do think you might be able to get help from a more recent user if you crosspost this to the active forum. Additionally, you can try the IRC channel to attempt getting live help.
#7
Good news! I figured out how to fix the issue. I learned how to generate the html file by following the below forum post (from the emscripten website):
https://github.com/kripken/emscripten/issues/2655
The real magic line that I had to add was this:
set(CMAKE_EXECUTABLE_SUFFIX ".html")
By adding this line to the CMakeLists.txt file, and adding it as indicated below:
IF...
ELSEIF...
ENDIF...
set(CMAKE_EXECUTABLE_SUFFIX ".html")
ADD_EXECUTABLE(Torque2D.html
${T2D_SRCS}
...
Then the compiler also generated a really nifty (and big) html file to go along with the .data and the .js files.
Two things to note however:
1) Even after getting to this point, I still just see a black window for my video game :) I can see some T2D console stuff as well being written, but as far as a game running goes, that's going to need some more work :)
2) Even if you take a fresh copy of Torque2D (master or development branch) and add this line, when you compile you will still get plenty of C++ errors you will have to work through. I managed to get through them all (before I even got to the point where I realized I needed the line I mentioned above), and I got through them all by adding lots of directories to the includes (in the CMakeLists file), and source files to the build (in the CMakeLists file), and commenting out lots of code.
Anyways, duely noted...the above line will help you generate your web build :) Hope this helps :)
Jeff Moretti
Evermore Game Studios
Also
@MikePerry If you want me to email you a copy of my project for your own purposes (or perhaps just the CMakeLists.txt files in particular) let me know. You can email me at jeffmoretti@hotmail.com
03/23/2018 (7:47 pm)
Hi Mike,Good news! I figured out how to fix the issue. I learned how to generate the html file by following the below forum post (from the emscripten website):
https://github.com/kripken/emscripten/issues/2655
The real magic line that I had to add was this:
set(CMAKE_EXECUTABLE_SUFFIX ".html")
By adding this line to the CMakeLists.txt file, and adding it as indicated below:
IF...
ELSEIF...
ENDIF...
set(CMAKE_EXECUTABLE_SUFFIX ".html")
ADD_EXECUTABLE(Torque2D.html
${T2D_SRCS}
...
Then the compiler also generated a really nifty (and big) html file to go along with the .data and the .js files.
Two things to note however:
1) Even after getting to this point, I still just see a black window for my video game :) I can see some T2D console stuff as well being written, but as far as a game running goes, that's going to need some more work :)
2) Even if you take a fresh copy of Torque2D (master or development branch) and add this line, when you compile you will still get plenty of C++ errors you will have to work through. I managed to get through them all (before I even got to the point where I realized I needed the line I mentioned above), and I got through them all by adding lots of directories to the includes (in the CMakeLists file), and source files to the build (in the CMakeLists file), and commenting out lots of code.
Anyways, duely noted...the above line will help you generate your web build :) Hope this helps :)
Jeff Moretti
Evermore Game Studios
Also
@MikePerry If you want me to email you a copy of my project for your own purposes (or perhaps just the CMakeLists.txt files in particular) let me know. You can email me at jeffmoretti@hotmail.com
Employee Michael Perry
ZombieShortbus
When you are running the build/generator, any errors, warnings, or notifications?