问题
Errors I get when trying to build the first block of code on this page under Xcode
Undefined symbols for architecture x86_64:
"fl_define_FL_SHADOW_LABEL()", referenced from:
_main in main.o
I installed FLTK with homebrew by brew install FLTK
and there were no errors:
/usr/local/Cellar/fltk/1.3.2_1: 315 files, 5.8M, built in 93 seconds
I realize this problem has been asked before, but the answer
You need to install it first as it's not on Mac OS X, using something like homebrew/macports/manually which will provide you with an installed copy that can be referenced using the
User Header Search Paths
andLibrary Search Paths
, as well as referencing the fltk library(/ies) in theLinked Frameworks and Libraries
did not work for me or I got the specific file paths wrong. I have tried Xcode 5.1.1 and 6.0 and both have the same problem.
I have attached a screenshot of my build settings.

回答1:
I have found the solution at groups.google.com and below is what I have done:
Change build settings as such:
Header Search Paths :
-I/usr/local/include
Library Search Paths :
/usr/local/lib

Go to terminal and type
fltk-config --ldflags
You get a line of flags, mine was
-L/usr/local/Cellar/fltk/1.3.2_1/lib -lfltk -lpthread -framework Cocoa
.In Xcode Build settings, paste that in
other linker flags

- After these steps Xcode compiled the file successfully.
来源:https://stackoverflow.com/questions/25879961/setup-xcode-and-fltk