Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build ok, make error #20

Closed
goxofy opened this issue Oct 26, 2016 · 6 comments
Closed

build ok, make error #20

goxofy opened this issue Oct 26, 2016 · 6 comments

Comments

@goxofy
Copy link

goxofy commented Oct 26, 2016

# tink @ HOMEBOT in ~/ttyd/build on git:master o [20:50:21]
$ make
[ 20%] Generating html.h from index.html
Scanning dependencies of target ttyd
[ 40%] Building C object CMakeFiles/ttyd.dir/src/server.c.o
/home/tink/ttyd/src/server.c: In function ‘tty_server_new’:
/home/tink/ttyd/src/server.c:93:5: error: ‘for’ loop initial declarations are only allowed in C99 mode
     for (int i = 0; i < cmd_argc; i++) {
     ^
/home/tink/ttyd/src/server.c:93:5: note: use option -std=c99 or -std=gnu99 to compile your code
/home/tink/ttyd/src/server.c:104:14: error: redefinition of ‘i’
     for (int i = 0; i < cmd_argc; i++) {
              ^
/home/tink/ttyd/src/server.c:93:14: note: previous definition of ‘i’ was here
     for (int i = 0; i < cmd_argc; i++) {
              ^
/home/tink/ttyd/src/server.c:104:5: error: ‘for’ loop initial declarations are only allowed in C99 mode
     for (int i = 0; i < cmd_argc; i++) {
     ^
/home/tink/ttyd/src/server.c: In function ‘calc_command_start’:
/home/tink/ttyd/src/server.c:132:5: error: ‘for’ loop initial declarations are only allowed in C99 mode
     for (int i = 0; i < argc; i++) {
     ^
/home/tink/ttyd/src/server.c:144:9: error: ‘for’ loop initial declarations are only allowed in C99 mode
         for (int i = 0; i < argc; i++) {
         ^
/home/tink/ttyd/src/server.c:153:14: error: redefinition of ‘i’
     for (int i = 0; i < argc; i++) {
              ^
/home/tink/ttyd/src/server.c:132:14: note: previous definition of ‘i’ was here
     for (int i = 0; i < argc; i++) {
              ^
/home/tink/ttyd/src/server.c:153:5: error: ‘for’ loop initial declarations are only allowed in C99 mode
     for (int i = 0; i < argc; i++) {
     ^
make[2]: *** [CMakeFiles/ttyd.dir/src/server.c.o] Error 1
make[1]: *** [CMakeFiles/ttyd.dir/all] Error 2
make: *** [all] Error 2
@tsl0922
Copy link
Owner

tsl0922 commented Oct 26, 2016

This may be a cmake or gcc version issue, I've tested ttyd on ubuntu 16.04 only. Can you try if -std= gnu99 (change this line) works?

@goxofy
Copy link
Author

goxofy commented Oct 26, 2016

yes, i changed it with -std=gnu99 , it works!

@goxofy goxofy closed this as completed Oct 26, 2016
@goxofy
Copy link
Author

goxofy commented Oct 27, 2016

有无方案支持复制粘贴?

@tsl0922
Copy link
Owner

tsl0922 commented Oct 27, 2016

@goxofy try shift + insert or cmd + v on mac.

I'm planning to add command-line options for setting hterm preference on the server side (#17), reference:

https://chromium.googlesource.com/apps/libapps/+/HEAD/hterm/js/hterm_preference_manager.js

@tsl0922
Copy link
Owner

tsl0922 commented Oct 27, 2016

@goxofy you may want to try the dev branch with CJK and IME support (#10).

@goxofy
Copy link
Author

goxofy commented Oct 28, 2016

OK, thank you! i'll try the dev branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants