From: Kevin W. <kw...@co...> - 2015-09-18 01:00:37
|
Andy, On 9/15/15 6:58 AM, Andy Colebourne wrote: > This might be a general Mac compilation thing, but I'm not so experienced > with the Mac. Any suggestions welcome. > > I'm trying to compile the Togl that Kevin mentioned below, but keep getting > CF_AVAILABLE related errors. This is with tcl/tk 6.1. I can't speak to the specific errors you are seeing, but another actively-maintained version of Togl that seems to work with Cocoa is maintained here: https://bitbucket.org/t3m/snappy/src/a3e18951148c204f48f3f91288a5a65d232a3a45/opengl/?at=default SnapPy is an OpenGL/Tkinter-based tool for scientific visualization. Its co-author, Marc Culler, has contributed many of the recent advances in Tk/Cocoa. I tried to build it and could not; it threw this error: /usr/include/mach/mach.h:86:15: error: redefinition of 'tclStubsPtr' as different kind of symbol extern void panic(const char *, ...); ^ /Library/Frameworks/Tcl.framework/Headers/tcl.h:2622:19: note: expanded from macro 'panic' # define panic Tcl_Panic ^ I see this error a lot with Tcl extensions on 10.10, and it seems to arise because of how "panic" is defined in the Tcl and Cocoa headers. The solution I've found is to do something like this: #include <tcl.h> #include <tk.h> #undef panic #include <CoreFoundation/CoreFoundation.h> #include <CoreServices/CoreServices.h> #include <Carbon/Carbon.h> #include <ApplicationServices/ApplicationServices.h> #define panic Tcl_Panic In other words, import the Tcl headers, undef panic, import the Mac headers, then re-define panic. That seems to work. In the Togl package, the error seems to be thrown in togl.c. I don't have time to patch this for you, but I hope that this provides you some help. Thanks, Kevin -- Kevin Walzer Code by Kevin/Mobile Code by Kevin http://www.codebykevin.com http://www.wtmobilesoftware.com |