#include <FL/Fl_Window.H>
#include <FL/Fl_Box.H>
int main(int argc, char **argv) {
Fl_Window *window = new Fl_Window(300,180);
Fl_Box *box = new Fl_Box(20,40,260,100,"Hello, World!");
box->box(FL_UP_BOX);
box->labelsize(36);
box->labelfont(FL_BOLD+FL_ITALIC);
box->labeltype(FL_SHADOW_LABEL);
window->end();
window->show(argc, argv);
return Fl::run();
}
I am addicted Xcode user and I am trying to integrate latest FLTK tool in Xcode Project. I searched a little bit and combined a few solutions together. Now it works (well, at least it pops out the “hello world” interface).
A couple of things to note:
- FLTK is reported to be somehow incompatible with OS X 10.10. If you downloaded from the office site, there might be bugs as you compiled the source codes (using sudo make install). For me, they are "make[1]: *** [Fl_cocoa.o] Error 1” and "make: *** [install] Error 1”.
- We will use homebrew to install FLTK 1.3.3. Type in your terminal ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)”
I am addicted Xcode user and I am trying to integrate latest FLTK tool in Xcode Project. I searched a little bit and combined a few solutions together. Now it works (well, at least it pops out the “hello world” interface).A couple of things to note:
- FLTK is reported to be somehow incompatible with OS X 10.10. If you downloaded from the office site, there might be bugs as you compiled the source codes (using sudo make install). For me, they are "make[1]: *** [Fl_cocoa.o] Error 1” and "make: *** [install] Error 1”.
- We will use homebrew to install FLTK 1.3.3. Type in your terminal ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)”
/System/Library/Frameworks/AppKit.framework/Headers/NSGraphics.h:31:92: error: expected unqualified-id before ',' token
NSCompositeHighlight NS_DEPRECATED_MAC(10_0, 10_0, "Use NSCompositeSourceOver instead"),
^
/System/Library/Frameworks/AppKit.framework/Headers/NSGraphics.h:54:1: error: expected unqualified-id before '}' token
};
^
/System/Library/Frameworks/AppKit.framework/Headers/NSGraphics.h:54:1: error: expected declaration before '}' token
make[1]: *** [Fl_cocoa.o] Error 1
make: *** [all] Error 1
On Fri May 01 2015 05:26:54, Zhao Xinyu wrote:
On May 2, 2015 9:29 AM, "Zhao Xinyu" wrote:
>
> BTW, you said “use Xcode bundled in that”, do you mean put Xcode Project into FLTK’s the top-level folder?
>
In the IDE folder of the tarball there is a project for use with Xcode.
Apple have done a reasonable job of maintaining compatibility between Xcode versions so it pretty much just works with recent Xcode too.
There is some discussion of this, I believe, in the OSX README in the top folder of the tarball.
--
Ian
Sent, perhaps surprisingly, from my Fairphone FP1