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

I cannot make it. #9

Open
tong-hao opened this issue May 24, 2019 · 9 comments · May be fixed by #10
Open

I cannot make it. #9

tong-hao opened this issue May 24, 2019 · 9 comments · May be fixed by #10

Comments

@tong-hao
Copy link

tong-hao commented May 24, 2019

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

@7anshuai 7anshuai linked a pull request May 27, 2019 that will close this issue
@daxxog
Copy link

daxxog commented Jul 16, 2020

Looks like your missing the curses library.

@pzibang
Copy link

pzibang commented Dec 6, 2020

Use LDLIBS instead of LDFLAGS in makefile.

@Rainbwo
Copy link

Rainbwo commented Mar 17, 2021

Use LDLIBS instead of LDFLAGS in makefile.

Thank you!

@ZuoDaBao
Copy link

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
Copy link

felixzng commented Sep 17, 2021

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
Copy link

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

thank you

@hqf2591102423
Copy link

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

@xiaodongYao
Copy link

i can't too,someone who can help?

@Jalever
Copy link

Jalever commented Aug 26, 2023

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. : )

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

Successfully merging a pull request may close this issue.

10 participants