Compiling errors: Tk with X11 - help with dependencies
Compiling errors: Tk with X11 - help with dependencies
I am trying to compile Tk into my code and I am having difficulty in getting X11 dependencies right in my Makefile. To include Tk I made the following change to my Makefile:
LIBS64 = \
-ltk8.5 \
-ltcl8.5
On compiling I got the following errors. I have edited it to reduce clutter:
...
: undefined reference to `XDrawLine'
<local>/libtk8.5.a(ttkElements.o)(.text+0x16b0): In function `SliderElementDraw':
...
: undefined reference to `XFillPolygon'
<local>/libtk8.5.a(ttkElements.o)(.text+0x1bbd): In function `TabElementDraw':
...
: undefined reference to `XFillRectangle'
collect2: ld returned 1 exit status
To get rid of this error I added -lX11 to my Makefile:
LIBS64 = \
-ltk8.5 \
-ltcl8.5 \
-L/usr/X11R6/lib64 \
-lX11
On compiling I got the following errors. I have edited it to reduce clutter:
: undefined reference to `FcPatternAddInteger'
<local>/libtk8.5.a(tkUnixRFont.o)(.text+0xe39): In function `TkpGetNativeFont':
: undefined reference to `XftXlfdParse'
<local>/libtk8.5.a(tkUnixRFont.o)(.text+0xe6c): In function `TkpGetNativeFont':
: undefined reference to `FcPatternDestroy'
collect2: ld returned 1 exit status
So I tried adding more libraries but I seem stuck with compilation errors.
My last Makefile looked like this:
LIBS64 = \
-ltk8.5 \
-ltcl8.5 \
-L/usr/X11R6/lib64 \
-lXft \
-lXss \
-lX11 \
-lICE \
-lSM
I can't figure out what dependencies and the libraries that needs to included to get it compiled. I would be much obliged if开发者_运维知识库 some one can help me compile this.
The obvious possibility here is that you are missing the development packages eg. the headers for tcl/tk, which usually look like tcl8.5-dev or tk8.5-dev, and if that is the case, then probably other development packages besides. What operating system are you using?
精彩评论