프로그램 컴파일 관련 도움 부탁드립니다

안녕하세요~
리눅스는 완전 초보입니다.

가끔 텍스트 머드를 하느라 tintin 이라는 클라이언트 프로그램을 쓸때가 있는데요…

이번에 오랜만에 다시 텍스트 머드를 해보려고 우분투에 설치를 해보려고 했는데 잘 안되네요 ㅜㅠ

이전에 cent os 에서는 문제없이 설치가 되었는데…
우분투에서는 ./configure, 하고 make 하는 과정에서 readline 이 어쩌고 하면서 에러가 나면서 실행파일 생성이 안되네요…

어떤 패키지를 추가로 설치하거나… 아니면 설정 수정이 필요한 것인지 모르겠습니다.

고수분들의 많은 도움 말씀 부탁드립니다.

tintin 소스는 첨부하겠습니다.

틴틴 홈페이지에 이런 안내가 있네요.

http://tintin.sourceforge.net/install.php#Ubuntu

[quote:z8idfhui]Ubuntu
The following commands should install TinTin++ on Unbuntu.

mkdir tintin
cd tintin
sudo apt-get install build-essential
sudo apt-get build-dep tintin++
wget <!-- m --><a class="postlink" href="http://downloads.sourceforge.net/tintin/tintin-2.00.5.tar.gz">http://downloads.sourceforge.net/tintin ... 0.5.tar.gz</a><!-- m -->
tar -zxvf tintin-2.00.5.tar.gz
cd /tt/src
./configure
sudo make install

Execute: tt++ to launch TinTin++[/quote:z8idfhui]

그리고 저장소에 tintin++가 있으니 컴파일 할 필요 없이
패키지 관리자에서 tintin++로 검색하여 설치하면 될것 같습니다.

혹은 터미널에서 아래 명령으로 설치하세요.

[code:z8idfhui]sudo apt-get install tintin++[/code:z8idfhui]

안녕하세요~
도움 말씀 너무 감사드립니다.

그런데 제가 꼭 1.87b 버젼이 필요해서요…
제가 하려는 머드에서 사용가능한 스크립트가 1.87b 기준으로 제작되어 있어서, 그 버젼에서만 오류없이 작동이 되더라구요…

일단
sudo apt-get install build-essential

이것만 실행하고
다시 컴파일 해봤는데…

일단 ./configure 할때는 아래와 같은 에러메시지가 뜨구요…

Please Note: Readline wasn’t found in either of the normal spots.
(/usr/include or /usr/local/include) You will need to specific
the location of the readline library to configure with --libdir and
–includedir then do a make clean;configure from the tintin++ src tree.
Please take a look at the INSTALL file for instructions.

에러를 무시하고 make 를 해보면 아래와 같은 메시지가 뜹니다.

gcc -O2 -D_GNU_SOURCE -DHAVE_CONFIG_H -c action.c
action.c:44:31: fatal error: readline/readline.h: 그런 파일이나 디렉터리가 없습니다
compilation terminated.
make: *** [action.o] 오류 1

Readline 이라는게 정상적인 위치에 있지 않아서 에러가 난다는 것 같은데…
사실 제가 readline 이 뭔지도 몰라서요 ㅜㅠ

조언 부탁드립니다. ㅜㅠ

sudo apt-get install build-essential libreadline-dev
라고 입력해보세요

build-essential 패키지는 원래는 debian파일을 컴파일 하기 위해 필요한 패키지이지만,
컴파일에 필요한 패키지들도 포함되어 있으므로, 같이 설치해주세요

xxx-dev패키지는 컴파일 할때 필요한 패키지들입니다.
컴파일시에 필요로하는 패키지가 있다면 해당패키지이름-dev를 설치해보세요.

protochaos 님 답변 감사드립니다!!

sudo apt-get install build-essential libreadline-dev
를 실행시킨 다음에 다시 컴파일 해보니…
아까 보다는 진도가 훨씬 더 많이 나가네요…

원래는 바로 에러가 떳는데…

이번에는 make 하니까 메시지가 한참 출력되다가 에러가 납니다.
에러메시지도 틀려 졌구요…

========================
---- Linking…
gcc -O2 -D_GNU_SOURCE -DHAVE_CONFIG_H -o tt++ action.o alias.o ansi.o antisub.o files.o glob.o help.o highlight.o ivars.o llist.o log.o main.o misc.o net.o parse.o path.o rl.o rlhist.o rltab.o rltick.o rlvt100.o scrsize.o session.o substitute.o text.o ticks.o utils.o variables.o function.o bindkey.o walk.o chat.o -lreadline -lhistory -lnsl -ltermcap
action.o: In function check_all_actions': action.c:(.text+0x9ec): undefined reference to readline_echoing_p’
parse.o: In function parse_input': parse.c:(.text+0xa75): undefined reference to readline_echoing_p’
collect2: ld returned 1 exit status
make: *** [tt++] 오류 1

이제는 이런 에러메시지가 나오네요…

여기서 뭘더 시도해 볼 수 있을까요??

답변 다시 한번 감사드립니다!!!

ld에서 에러가 났고, 심볼을 찾을 수 없다고 나오니,
해당 패키지가 설치 되지 않았거나, 해당 라이브러리가 존재하지 않는 경우일 겁니다.

sudo apt-get install readline-common libreadline6

해보세요

답변감사드립니다!!

말씀하신데로
sudo apt-get install readline-common libreadline6
를 실행했더니…

=======================================
libreadline6 패키지는 이미 최신 버전입니다.
readline-common 패키지는 이미 최신 버전입니다.

이렇게 나오네요…

./configure 와 make 했을때의 메시지를 모두 올려 보겠습니다.

./configure 실행했을때…

meji96@meji96-desktop:~/tintin++/src$ ./configure
creating cache ./config.cache
checking for gcc… gcc
checking whether the C compiler (gcc ) works… yes
checking whether the C compiler (gcc ) is a cross-compiler… no
checking whether we are using GNU C… yes
checking whether gcc accepts -g… yes
checking how to run the C preprocessor… gcc -E
checking for POSIXized ISC… no
checking for AIX… no
checking for minix/config.h… no
checking for working const… yes
checking for inline… inline
checking for tgetent in -ltermcap… yes
checking for socket in -lsocket… no
checking for gethostbyname in -lnsl… yes
checking for strings.h… yes
checking for string.h… yes
checking for stdlib.h… yes
checking for unistd.h… yes
checking for time.h… yes
checking for sys/time.h… yes
checking for sys/termio.h… no
checking for sys/ioctl.h… yes
checking for termcap.h… yes
checking for param.h… no
checking for sys/ptem.h… no
checking for net/errno.h… no
checking for readline/readline.h… yes
checking for ctype.h… yes
checking whether time.h and sys/time.h may both be included… yes
checking whether gcc needs -traditional… no
checking return type of signal handlers… void
checking for strcasecmp… yes
checking for gmake… no
checking for make… make
checking for getmntent in -lsun… no
checking for getmntent in -lseq… no
checking for getmntent in -lgen… no
checking for getmntent… yes
checking for dirent.h that defines DIR… yes
checking for opendir in -ldir… no
checking for strftime… yes
updating cache ./config.cache
creating ./config.status
creating Makefile
creating config.h

Configure has finished. To compile, type: make

make 실행했을때…

meji96@meji96-desktop:~/tintin++/src$ make
gcc -O2 -D_GNU_SOURCE -DHAVE_CONFIG_H -c action.c
gcc -O2 -D_GNU_SOURCE -DHAVE_CONFIG_H -c alias.c
gcc -O2 -D_GNU_SOURCE -DHAVE_CONFIG_H -c ansi.c
gcc -O2 -D_GNU_SOURCE -DHAVE_CONFIG_H -c antisub.c
gcc -O2 -D_GNU_SOURCE -DHAVE_CONFIG_H -c files.c
gcc -O2 -D_GNU_SOURCE -DHAVE_CONFIG_H -c glob.c
glob.c: In function ‘match’:
glob.c:43:17: warning: incompatible implicit declaration of built-in function ‘strlen’
gcc -O2 -D_GNU_SOURCE -DHAVE_CONFIG_H -c help.c
help.c: In function ‘help_command’:
help.c:128:20: warning: incompatible implicit declaration of built-in function ‘strlen’
help.c:145:7: warning: incompatible implicit declaration of built-in function ‘strlen’
gcc -O2 -D_GNU_SOURCE -DHAVE_CONFIG_H -c highlight.c
gcc -O2 -D_GNU_SOURCE -DHAVE_CONFIG_H -c ivars.c
ivars.c: In function ‘revstring_command’:
ivars.c:195:14: warning: incompatible implicit declaration of built-in function ‘strlen’
gcc -O2 -D_GNU_SOURCE -DHAVE_CONFIG_H -c llist.c
gcc -O2 -D_GNU_SOURCE -DHAVE_CONFIG_H -c log.c
gcc -O2 -D_GNU_SOURCE -DHAVE_CONFIG_H -c main.c
gcc -O2 -D_GNU_SOURCE -DHAVE_CONFIG_H -c misc.c
misc.c: In function ‘system_command’:
misc.c:628:9: warning: ignoring return value of ‘system’, declared with attribute warn_unused_result
misc.c: In function ‘bell_command’:
misc.c:155:8: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result
gcc -O2 -D_GNU_SOURCE -DHAVE_CONFIG_H -c net.c
gcc -O2 -D_GNU_SOURCE -DHAVE_CONFIG_H -c parse.c
gcc -O2 -D_GNU_SOURCE -DHAVE_CONFIG_H -c path.c
gcc -O2 -D_GNU_SOURCE -DHAVE_CONFIG_H -c rl.c
rl.c: In function ‘initrl’:
rl.c:182:32: warning: assignment from incompatible pointer type
rl.c: In function ‘cleanscreen’:
rl.c:466:9: warning: ignoring return value of ‘system’, declared with attribute warn_unused_result
gcc -O2 -D_GNU_SOURCE -DHAVE_CONFIG_H -c rlhist.c
gcc -O2 -D_GNU_SOURCE -DHAVE_CONFIG_H -c rltab.c
gcc -O2 -D_GNU_SOURCE -DHAVE_CONFIG_H -c rltick.c
gcc -O2 -D_GNU_SOURCE -DHAVE_CONFIG_H -c rlvt100.c
gcc -O2 -D_GNU_SOURCE -DHAVE_CONFIG_H -c scrsize.c
gcc -O2 -D_GNU_SOURCE -DHAVE_CONFIG_H -c session.c
gcc -O2 -D_GNU_SOURCE -DHAVE_CONFIG_H -c substitute.c
gcc -O2 -D_GNU_SOURCE -DHAVE_CONFIG_H -c text.c
gcc -O2 -D_GNU_SOURCE -DHAVE_CONFIG_H -c ticks.c
gcc -O2 -D_GNU_SOURCE -DHAVE_CONFIG_H -c utils.c
gcc -O2 -D_GNU_SOURCE -DHAVE_CONFIG_H -c variables.c
gcc -O2 -D_GNU_SOURCE -DHAVE_CONFIG_H -c function.c
gcc -O2 -D_GNU_SOURCE -DHAVE_CONFIG_H -c bindkey.c
gcc -O2 -D_GNU_SOURCE -DHAVE_CONFIG_H -c walk.c
gcc -O2 -D_GNU_SOURCE -DHAVE_CONFIG_H -c chat.c
---- Linking…
gcc -O2 -D_GNU_SOURCE -DHAVE_CONFIG_H -o tt++ action.o alias.o ansi.o antisub.o files.o glob.o help.o highlight.o ivars.o llist.o log.o main.o misc.o net.o parse.o path.o rl.o rlhist.o rltab.o rltick.o rlvt100.o scrsize.o session.o substitute.o text.o ticks.o utils.o variables.o function.o bindkey.o walk.o chat.o -lreadline -lhistory -lnsl -ltermcap
action.o: In function check_all_actions': action.c:(.text+0x9ec): undefined reference to readline_echoing_p’
parse.o: In function parse_input': parse.c:(.text+0xa75): undefined reference to readline_echoing_p’
collect2: ld returned 1 exit status
make: *** [tt++] 오류 1

이런식으로 출력이 되네요…

이그 이건 훔…
해당 c파일을 뒤져봐야 할 것도 같네요.

여튼 오류의 원인은
해당 c소스파일에서 xxx라는 함수를 호출하려고 하는데…
그 함수가 없다는 겁니다.

해당 함수가 xxx.so처럼 동적라이브러리에 포함되어 있을 수도 있고,
또는 소스중에 다른파일에 존재 할 수 도 있죠.

그러면 sudo apt-get build-dep tintin++ 해보세요.
관련된 파일중에 빠진것이 있을 수 도 있죠.

에고 protochaos님 답변 너무 감사드립니다.
이 tintin 1.87b 버젼이 제가 1997년도~2000년도 사이에 한창 텍스트머드 할때 하던 프로그램이라…
엄청 오래된 프로그램이나 최근 버젼 리눅스에서 잘 컴파일이 안되나 생각이 드네요…

방금 주신 댓글보고
sudo apt-get build-dep tintin++
를 실행해도 변화는 없네요 ㅜㅠ

그런데 소스에 포함된 FAQ 파일을 읽다 보니…

Q3) Where can I get the readline library?

A3) You can get the readline library from many ftp sites. The main ftp
site for the readline library is ftp.gnu.org. The most recent version
should be available there. Tintin has been tested with readline 4.0 and 4.1.
It has been reported to me that readline 2.0 does not work, so make sure you
get a recent version of readline.

Q4) When I do a ./configure, it complains that it can’t find the readline
library. How do I fix that?

A4) Configure normally only checks the standard default directories for
the readline library and the readline header files. If you don’t have them
there, you need to tell configure where to find them. You can (as if tintin
version 1.82) do a

"./configure --includedir=<directory name> --libdir=<directory name>"

to tell ./configure where to find them.

If you put readline in /tmp/readline-4.1 then you would need to do the
following:

  1. rename it to be called readline (mv readline-4.1 readline)

  2. tell configure to look there (./configure --includedir=/tmp --libdir=tmp)

NOTE: You must use the full path when specifying the directory.

이런내용이 있네요…
대충 해석해 보니 이소스는 readline 4.0, 4.1 에서 테스트 되었다는 것 같네요…

그럼 제 우분투의 readline 을 4.0이나 4.1로 바꿔서 다시 시도해 보려고 하는데요…
현재는 아까 보니까 readline6 이 설치되어 있는것 같은데… 이것을 4.1로 다운그레이드 하는것이 가능할지요?

아무래도 무리일듯…

apt-rdepends로 보니 의존성이 많이 걸려있네요.

꼭필요하다면… virtualbox에서 예전버전의 리눅스를 설치해서 테스트해보세요 쩝.

어흐흑…그렇군요 ㅜㅠ

스크립트쪽을 고치는게 빠르지 않을까요;;;

제가 이쪽 분야에서는 완전히 문외한이어서요 ㅜㅠ

시험삼아서 cent os 5.5 설치하고…컴파일 해봤는데…
cent os 에서는 컴파일이 잘되고, 실행파일 생성이 문제없이 되더라구요…

cent os 5.5 도 그리 오래된 버젼은 아니어서 readline 버젼이 그리 낮지는 않을것 같은데… 여기서는 잘되더라구요…

무슨 문제일지 참 ㅜㅠ

우분투가 많은 분들이 쓰는 리눅스 여서 가능하면 우분투에서 돌리고 싶은데 쉽지가 않네요 ㅜㅠ