I'm trying to compile to javascript...but i cant...or better i don't know how....can you tell me please??how i can???
If i do this work for simple helloworld c++........:
Code: Select all
*************************************************************************************************************
C:\Users\Save\Desktop\t>emcc test.cpp
C:\Users\Save\Desktop\t>emcc test.cpp -0 test.html
ERROR:root:test.html: No such file or directory ("test.html" was expected to be an input file, based on the commandline arguments provided)
C:\Users\Save\Desktop\t>em++ test.cpp -0 test.html
ERROR:root:test.html: No such file or directory ("test.html" was expected to be an input file, based on the commandline arguments provided)
C:\Users\Save\Desktop\t>em++ test.cpp
C:\Users\Save\Desktop\t>em++ test.cpp -o test.html
C:\Users\Save\Desktop\t> THIS WORKS FINE!!!!
******************************************************************************************************************
But if if try to compile like this...give me error:
C:\Users\Save\Desktop\t>em++ tictactoe.cpp here below the error:
Code: Select all
C:\Users\Save\Desktop\tictac troppo>em++ tictactoemod.cpp
tictactoemod.cpp:1:1: error: unknown type name 'import'
import "ecere"
^
tictactoemod.cpp:1:8: error: expected unqualified-id
import "ecere"
^
tictactoemod.cpp:4:1: error: unknown type name 'define'
define lineWidth = 10;
^
tictactoemod.cpp:5:1: error: unknown type name 'define'
define mastery = 97;
^
tictactoemod.cpp:7:1: error: unknown type name 'define'
define noAvailableMove = -100;
^
tictactoemod.cpp:13:19: error: expected class name
class TicTacToe : Window
^
tictactoemod.cpp:15:4: error: C++ requires a type specifier for all declarations
caption = "TicTacToe";
^
tictactoemod.cpp:15:12: warning: in-class initialization of non-static data
member is a C++11 extension [-Wc++11-extensions]
caption = "TicTacToe";
^
tictactoemod.cpp:16:4: error: C++ requires a type specifier for all declarations
background = green;
^
tictactoemod.cpp:16:15: warning: in-class initialization of non-static data
member is a C++11 extension [-Wc++11-extensions]
background = green;
^
tictactoemod.cpp:17:4: error: C++ requires a type specifier for all declarations
hasClose = true;
^
tictactoemod.cpp:17:13: warning: in-class initialization of non-static data
member is a C++11 extension [-Wc++11-extensions]
hasClose = true;
^
tictactoemod.cpp:18:4: error: C++ requires a type specifier for all declarations
clientSize = { 400, 400 };
^
tictactoemod.cpp:18:15: warning: in-class initialization of non-static data
member is a C++11 extension [-Wc++11-extensions]
clientSize = { 400, 400 };
^
tictactoemod.cpp:20:4: error: unknown type name 'FontResource'
FontResource tttFont { "Comic Sans MS", 50, bold = true, window = this };
^
tictactoemod.cpp:20:17: error: function definition does not declare parameters
FontResource tttFont { "Comic Sans MS", 50, bold = true, window = this };
^
tictactoemod.cpp:22:20: error: C++ requires a type specifier for all
declarations
TTTSquare turn; turn = X;
^
tictactoemod.cpp:22:20: error: duplicate member 'turn'
tictactoemod.cpp:22:14: note: previous declaration is here
TTTSquare turn; turn = X;
^
tictactoemod.cpp:22:25: warning: in-class initialization of non-static data
member is a C++11 extension [-Wc++11-extensions]
TTTSquare turn; turn = X;
^
tictactoemod.cpp:52:55: error: unknown type name 'Point'
float BestMove(TTTSquare t, TTTSquare state[3][3], Point bestMove)
^
tictactoemod.cpp:143:20: error: unknown type name 'Surface'
void DrawPieces(Surface surface)
^
tictactoemod.cpp:174:18: error: unknown type name 'Surface'
void OnRedraw(Surface surface)
^
tictactoemod.cpp:192:42: error: unknown type name 'Modifiers'
bool OnLeftButtonDown(int mx, int my, Modifiers mods)
^
tictactoemod.cpp:218:4: error: unknown type name 'Button'
Button btnReset
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
5 warnings and 20 errors generated.
ERROR:root:compiler frontend failed to generate LLVM bitcode, halting