[Tkinter-discuss] Embedding compilation problems after installing Tkinter mo

Jeff Epler jepler at unpythonic.net
Fri Apr 2 14:29:30 EST 2004


Yes, it works just fine when I link in the libs required by _tkinter,
which is exactly what I intended to suggest in my earlier message.  I
made this change to Demo/embed/Makefile:

--- Demo/embed/Makefile	25 Jul 2002 16:23:21 -0000	1.12
+++ Demo/embed/Makefile	2 Apr 2004 19:20:32 -0000
@@ -22,7 +22,8 @@
 LIBPYTHON=	$(blddir)/libpython$(VERSION).a
 
 # XXX edit LIBS (in particular) to match $(blddir)/Modules/Makefile
-LIBS=		-lnsl -ldl -lreadline -ltermcap -lieee -lpthread -lutil
+LIBS=		-lnsl -ldl -lreadline -ltermcap -lieee -lpthread -lutil \
+		-L/usr/X11R6/lib -ltcl8.3 -ltk8.3 -lX11
 LDFLAGS=	-Xlinker -export-dynamic
 SYSLIBS=	-lm
 MODLIBS=	

$ make demo
gcc -g -I../../Include -I../..  -c -o demo.o demo.c
gcc -Xlinker -export-dynamic demo.o ../../libpython2.4.a  -lnsl -ldl
-lreadline -ltermcap -lieee -lpthread -lutil -L/usr/X11R6/lib -ltcl8.3
-ltk8.3 -lX11 -lm -o demo
../../libpython2.4.a(posixmodule.o)(.text+0x3628): In function
`posix_tmpnam':
Modules/posixmodule.c:5873: the use of `tmpnam' is dangerous, better use
`mkstemp'
../../libpython2.4.a(posixmodule.o)(.text+0x359a): In function
`posix_tempnam':
Modules/posixmodule.c:5826: the use of `tempnam' is dangerous, better
use `mkstemp'
$ ./demo
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
'import site' failed; use -v for traceback
Hello, brave new world

('__builtin__', '__main__', '_codecs', '_sre', '_symtable', '_tkinter',
'errno', 'exceptions', 'gc', 'imp', 'marshal', 'posix', 'signal', 'sys',
'xxsubtype', 'zipimport')
['zipimport', 'signal', '__builtin__', 'sys', '__main__', 'exceptions',
'xyzzy']
/usr/src/python/dist/src/Demo/embed/demo
['./demo']

Goodbye, cruel world

Jeff



More information about the Tkinter-discuss mailing list