taylorconor / tinytetris

80x23 terminal tetris!
Apache License 2.0
2.98k stars 591 forks source link

I cannot make it. #9

Open tong-hao opened 5 years ago

tong-hao commented 5 years ago
linux:~/code/other/tinytetris$ make
g++   -lcurses  tinytetris.cpp   -o tinytetris
/tmp/ccNKijAL.o: In function `F()':
tinytetris.cpp:(.text+0xf7): undefined reference to `move'
tinytetris.cpp:(.text+0x161): undefined reference to `stdscr'
tinytetris.cpp:(.text+0x171): undefined reference to `wattr_on'
tinytetris.cpp:(.text+0x184): undefined reference to `printw'
tinytetris.cpp:(.text+0x19c): undefined reference to `stdscr'
tinytetris.cpp:(.text+0x1ac): undefined reference to `wattr_off'
tinytetris.cpp:(.text+0x1ce): undefined reference to `move'
tinytetris.cpp:(.text+0x1e7): undefined reference to `printw'
tinytetris.cpp:(.text+0x1ec): undefined reference to `refresh'
/tmp/ccNKijAL.o: In function `L()':
tinytetris.cpp:(.text+0x634): undefined reference to `stdscr'
tinytetris.cpp:(.text+0x63c): undefined reference to `wgetch'
/tmp/ccNKijAL.o: In function `main':
tinytetris.cpp:(.text+0x83f): undefined reference to `initscr'
tinytetris.cpp:(.text+0x844): undefined reference to `start_color'
tinytetris.cpp:(.text+0x877): undefined reference to `init_pair'
tinytetris.cpp:(.text+0x89c): undefined reference to `resizeterm'
tinytetris.cpp:(.text+0x8a1): undefined reference to `noecho'
tinytetris.cpp:(.text+0x8a8): undefined reference to `stdscr'
tinytetris.cpp:(.text+0x8b5): undefined reference to `wtimeout'
tinytetris.cpp:(.text+0x8bf): undefined reference to `curs_set'
tinytetris.cpp:(.text+0x8c6): undefined reference to `stdscr'
tinytetris.cpp:(.text+0x8d8): undefined reference to `box'
tinytetris.cpp:(.text+0x8e2): undefined reference to `endwin'
collect2: error: ld returned 1 exit status
<builtin>: recipe for target 'tinytetris' failed
make: *** [tinytetris] Error 1
daxxog commented 4 years ago

Looks like your missing the curses library.

pzibang commented 3 years ago

Use LDLIBS instead of LDFLAGS in makefile.

Rainbwo commented 3 years ago

Use LDLIBS instead of LDFLAGS in makefile.

Thank you!

ZuoDaBao commented 3 years ago

Looks like your missing the curses library.

How to install "curses" in windows, i try to search on google but i can't find it

felixzng commented 3 years ago

On linux you may need to link with -lncurses. Of course ncurses library needs to be installed g++ -lncurses tinytetris.cpp -o tinytetris Cute game

forevergodd commented 2 years ago

在 Linux 上,您可能需要使用 -lncurses 链接。当然 ncurses 库需要安装g++ -lncurses tinytetris.cpp -o tinytetris Cute game

thank you

hqf2591102423 commented 2 years ago

have someone build it in window ,i can't built it

xiaodongYao commented 2 years ago

i can't too,someone who can help?

Jalever commented 1 year ago

have someone build it in window ,i can't built it

I also encountered this error when installing, the following steps are my successful record, I hope it can help you.

  1. vim Makefile and change LDFLAGS to LDLIBS, then save it.
  2. execute command: g++ -o tinytetris-commented tinytetris-commented.cpp -lncurses
  3. execute command: ./tinytetris-commented

Hope it helps you. : )