| |||||||||||
Tcl/Tl initialization in Windows Posted by tclfan (tclfan), 24 March 2004 Please help me with this problem, I'll be extremely grateful !I have to use Tcl/Tk from C code, and I do it in this way : #include <tcl.h> #include <tk.h> int main(int argc, char* argv[]) { Tcl_Interp* pInt; Tcl_CreateInterp(pInt); Tcl_Init(pInt); Tk_Init(pInt); <here I submit some my command to pInt> Tk_MainLoop(); Tcl_DeleteInterp(pInt); } The problem is that in Windows Tcl_Init returns TCL_ERROR (and nothing works), but if I skip a call to Tcl_Init, later calls fail. Though this code works fine in Solaris. Can anybody tell me what am I doing wrong ? or what should I do ? I use Tcl/Tck 8.4.6, self compliled as well as ActiveTcl binary release for Win. They both fail. Posted by admin (Graham Ellis), 25 March 2004 I wonder if you're using the same compiler for your Tcl application that was used for the Tcl libraries. If the libraries were compiled with (say) 16 bit integers and the your code - including crutially the .h files - with 32 bit integers, you'll be in all sorts of trouble.Posted by tclfan (tclfan), 29 March 2004 Thank you for your posting !I use the same compiler, but I'm not shure all project settings that came to me in makefile with Tcl sources are the same to settings I use in my project. Unfortunatelly, I have no time to examine all of the numerous MVSC settings, used there, so I cannot guarantee project settings are completely the same. But I've noticed an interesting thing. Though the sample I've described doesn't work, the way when I generate Tcl script and then pass it into Tk_Main, works fine ! That's why I asked do I start Tcl properly, thinking I don't make somethihg that Tk_Main does. I've traced into Tcl sources trying to find the difference, but found out that the problem takes more time I can afford. But its nevermind, the way through Tk_Main is acceptable for my task, so I'll use it. Thank you for resplonce ! This page is a thread posted to the opentalk forum
at www.opentalk.org.uk and
archived here for reference. To jump to the archive index please
follow this link.
|
| ||||||||||
PH: 01144 1225 708225 • FAX: 01144 1225 793803 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho |