How can I get Tkinter to work in Python? (I tried many things)

T

tomzam

I am trying to get Tkinter to work with my Python build.
I've scoured usenet(comp.lang.Python) and google and there's
information that's helpful but I just can't seam to get it completely
right. I tried many of the suggestion, but nothing seems to work
My setup is Fedora Core 6 [my yum is also broken. (sigh. yes, I know
I should upgrade)]
I've download Tcl/Tk from Active State and installed it here:
/usr/ActiveTcl-8.5
My python to build is in this directory:
/home/tomzam/mylib6/Python-2.6.2
I removed the comment symbol (#) from the line:
_tkinter _tkinter.c tkappinit.c -DWITH_APPINIT \
in the Modules/Setup
so the lines in the Setup file look like this:

# *** Always uncomment this (leave the leading underscore in!):
_tkinter _tkinter.c tkappinit.c -DWITH_APPINIT \
# *** Uncomment and edit to reflect where your Tcl/Tk libraries are:
-L/usr/ActiveTcl-8.5/lib/tk8.5 \
# *** Uncomment and edit to reflect where your Tcl/Tk headers are:
-I/usr/ActiveTcl-8.5/include/tcl8.5 \
when I run ./configure in /home/tomzam/mylib6/Python-2.6.2 everything
looks
right but then I try running make in /home/tomzam/mylib6/Python-2.6.2

There are errors, but since there is many of them:
here is a cut out of the _tkinter errors:

libpython2.6.a(_tkinter.o): In function `Tkapp_CallProc':
/home/tomzam/mylib6/Python-2.6.2/./Modules/_tkinter.c:1263: undefined
reference to `Tcl_MutexLock'
/home/tomzam/mylib6/Python-2.6.2/./Modules/_tkinter.c:1264: undefined
reference to `Tcl_ConditionNotify'
/home/tomzam/mylib6/Python-2.6.2/./Modules/_tkinter.c:1265: undefined
reference to `Tcl_MutexUnlock'
/home/tomzam/mylib6/Python-2.6.2/./Modules/_tkinter.c:1251: undefined
reference to `Tcl_GetStringResult'
libpython2.6.a(_tkinter.o): In function `Tkapp_CallDeallocArgs':
/home/tomzam/mylib6/Python-2.6.2/./Modules/_tkinter.c:1123: undefined
reference to `Tcl_Free'
libpython2.6.a(tkappinit.o): In function `Tcl_AppInit':
/home/tomzam/mylib6/Python-2.6.2/./Modules/tkappinit.c:48: undefined
reference to `Tcl_Init'
/home/tomzam/mylib6/Python-2.6.2/./Modules/tkappinit.c:77: undefined
reference to `Tcl_GetVar'
/home/tomzam/mylib6/Python-2.6.2/./Modules/tkappinit.c:81: undefined
reference to `Tk_Init'
/home/tomzam/mylib6/Python-2.6.2/./Modules/tkappinit.c:84: undefined
reference to `Tk_MainWindow'
/home/tomzam/mylib6/Python-2.6.2/./Modules/tkappinit.c:81: undefined
reference to `Tk_Init'
collect2: ld returned 1 exit status
make: *** [python] Error 1

But since they are all undefined references - I feel I'm pretty close
to a solution.

Can you help me the rest of the way?
I'm trying to make tkinter work with my local Python install,
any help will be appreciated!

Thank in advance,
-Tom Z
 
P

Peter Pearson

On Mon, 27 Apr 2009 17:49:26 -0700 (PDT), (e-mail address removed) wrote:
[snip]
There are errors, but since there is many of them:
here is a cut out of the _tkinter errors:

libpython2.6.a(_tkinter.o): In function `Tkapp_CallProc':
/home/tomzam/mylib6/Python-2.6.2/./Modules/_tkinter.c:1263: undefined
reference to `Tcl_MutexLock'

I believe this message means that something named _tkinter.c
was previously compiled into an object file named
_tkinter.o, which was bundled into a library named
libpython2.6.a; and that when you attempt to use
libpython2.6.a to satisfy the external references of something
(not identified) that you're trying to link, the linker
discovers that _tkinter.o contains a function Tkapp_CallProc
that (on line 1263 of _tkinter.c) attempts to call function
Tcl_MutexLock, but the linker can't find anything named
Tcl_MutexLock to satisfy it.

Tcl_MutexLock is probably *supposed* to be provided by some
Tcl runtime library, but not being very knowledgeable, I
don't know what library. Just before the beginning of the
list of error messages, you'll probably find the command line
that's running the linker, and it probably names a bunch of
libraries, one of which is supposed to include Tcl_Mutexlock
but doesn't. I apologize for being so vague; with any luck,
someone much smarter will come along soon.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,906
Latest member
SkinfixSkintag

Latest Threads

Top