我正在处理一个 C++ 项目,我需要使用 libtcl。 我正在运行 Ubuntu 12.10 32 位,当我尝试编译我的文件时出现问题:
g++ -o executable executable.o -L/usr/share/tcltk -lncurses -ltcl
/usr/bin/ld: cannot find -ltcl
找到了 libncurses 但没有找到 libtcl... 你有什么想法吗?
我看到libtcl8.4.so.0 libtcl8.5.so.0存在于/usr/lib
我正在使用的 makefile 如下所示:
CC = g++
CFLAGS = -g
LDFLAGS =
EXEC = executable
LIB = -L/usr/share/tcltk -lncurses -ltcl
all: executable
executable: executable.o
$(CC) $(LDFLAGS) -o $(EXEC) executable.o $(LIB)
executable.o: executable.cpp
$(CC) $(CFLAGS) -c executable.cpp
clean:
rm -f executable executable.o
谢谢
最佳答案
(在评论中回答。参见 Question with no answers, but issue solved in the comments (or extended in chat) )
@soon 写道:
just create symlink to the your library like so
#ln -s /usr/lib/libtcl8.5.so.0 /usr/lib/libtcl.so
关于c++ - Ubuntu 12.10 - 编译 C++ 程序时找不到 -ltcl,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14857815/