1

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 and Library Search Paths, as well as referencing the fltk library(/ies) in the Linked 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. Build Settings on Xcode

Community
  • 1
  • 1
tomtclai
  • 333
  • 6
  • 18

1 Answers1

2

I have found the solution at groups.google.com and below is what I have done:

  1. Change build settings as such:

    Header Search Paths : -I/usr/local/include

    Library Search Paths : /usr/local/lib

Search Paths

  1. 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

enter image description here

  1. After these steps Xcode compiled the file successfully.
tomtclai
  • 333
  • 6
  • 18