I’m on Windows 10 and have a pretty large (I think) console application
written in C. 90+ files and about 17.000 lines of code.
It compiles without errors/warnings in emcc. However, when I run it, the
text input does not seem to work correctly. It keeps popping up the input
window and buffering text. So I went back to basics and to reproduce and
isolate the issue added a scanf() statement to the hello_world program that
comes with the emscripten package:
===================================================
/*
* Copyright 2011 The Emscripten Authors. All rights reserved.
* Emscripten is available under two separate licenses, the MIT license and
the
* University of Illinois/NCSA Open Source License. Both these licenses can
be
* found in the LICENSE file.
*/
#include <stdio.h>
int main() {
char input[25];
printf("hello, world!\n");
printf("Enter input: ");
scanf("%s", input);
printf("\nInput is: %s\n", input);
return 0;
}
===================================================
I compiled the file with command “emcc tests/hello_world.c –o
hello_world.html”.
This little program has the same issue. It keeps asking for input and only
when I cancel the input window it prints “hello, world!” “Enter input: “
and “Input is: <what I entered>“.
The program is at this link on my website so you can see the behavior:
hello_world <https://www.xvan.nl/emscripten/hello_world.html>
What I don't understand: why is the input window coming back each time and
why is the text buffered until I cancel the input window?
I did search the group, but actually I don’t know what I’m looking for.
--
You received this message because you are subscribed to the Google Groups
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/emscripten-discuss/29395d49-9ada-4100-b542-f1e59602137bn%40googlegroups.com.