RE: [fltk.general] trouble installing FLTK on xcode 8.3.3 on mac 10.12.4 using 64 bit macbook [General Use]

95 views
Skip to first unread message

MacArthur, Ian (Leonardo, UK)

unread,
Jun 21, 2017, 5:08:41 AM6/21/17
to fltkg...@googlegroups.com
> I have some problems installing fltk on the xcode. More specifically, I
> managed to run the demo using fltk 1.3.4. But I am not entirely sure
> about 4.7 in readme.osx:
>

OK, so just to be clear:

You have downloaded a tarball for fltk-1.3.4-1, and built it for OSX using some version of Xcode (which one? something recent, I assume; more recent than Xcode 4, anyway?)

Having built fltk in this way, the demo programs in the fltk test folder all seem to run correctly.

Now you want to use this fltk build to do the examples from Dr.S's book, and are having trouble getting your code to build against the fltk lib.

Are these correct statements?


Assuming they are, then a few points arise.

Firstly, and this is a key one, I generally would not bother to install fltk at all, since it works perfectly fine from the build directory.

(That's often much less hassle than actually installing it, and means I can have multiple different versions of fltk for experiments without them interacting badly...)

I'm not sure what all the different versions of Xcode do, so it is *very* likely they have moved those menus and settings about.

I'm afraid I can't help you with that; I gave up on Xcode. I know a lot of folks like it, but I couldn't get used to the workflow. I only install it to get the compiler and binutils, then use my own tools...



> But it does not compile. The error message is <FL/Fl.h> is not found. I
> searched online and tried to add header files in FL folder in the xcode
> header search path.


I'm not sure how Xcode handles setting the include paths now, but assuming you build fltk in the folder "/Users/name/fltk/fltk-1.3.4", then it should be enough to add that path to the include files searched by your project; the "FL" folder will then be found under that path and all should be well.

Similarly, the lib files ought to be in "/Users/name/fltk/fltk-1.3.4/lib" after a successful build.

> This time, xcode manage to find all three header
> file, but it cannot find "#include <FL/Fl_Export.H>" mentioned in
> <Fl.h>. So, I suppose I did not add header search path correctly.

Hmm, I can't see how that could be so; the files Fl.H and Fl_Export.H are in the same folder, so if you can find one, you can surely find the other?

Note that names can be case-sensitive, so make sure you have the case right, in particular it is <Fl.H> you want, not <Fl.h> here.

Ditto for Fl_Box.H and Fl_Window.H, etc.


> In addition, when I create a whole new project, I have no idea how to
> "include fltk environment", and I have no idea how to include all fltk
> libraries at a new xcode projects.


You need to figure out which menu in your version of Xcode the library paths are set and then make sure that

"/Users/name/fltk/fltk-1.3.4/lib"

(for appropriate values of Users/name/etc...) is added to the lib search path, and that the libraries

-lfltk_images -lfltk_png -lfltk_z -lfltk_jpeg -lfltk_gl -lfltk

are added to the linked libraries.



> A more senior programmer has tried to fix the problem, but failed. So, I
> suppose it is not trivial. Any help is much appreciated! Thank you.


Hmm, shouldn't be that hard.

But I don't use Xcode, so maybe it isn’t that easy, either!

FWIW, I always build for the Mac at the command line using simple Makefiles instead. Much easier...

not everyone would agree with me, though.





Leonardo MW Ltd
Registered Office: Sigma House, Christopher Martin Road, Basildon, Essex SS14 3EL
A company registered in England & Wales. Company no. 02426132
********************************************************************
This email and any attachments are confidential to the intended
recipient and may also be privileged. If you are not the intended
recipient please delete it from your system and notify the sender.
You should not copy it or use it for any purpose nor disclose or
distribute its contents to any other person.
********************************************************************

JY

unread,
Jun 22, 2017, 7:40:57 AM6/22/17
to fltk.general, ian.ma...@leonardocompany.com
>You have downloaded a tarball for fltk-1.3.4-1, and built it for OSX using some version of Xcode (which one? something recent, I assume; more recent than Xcode 4, anyway?) 
.....
>Are these correct statements? 

I am using xcode 8.3.3. And yes, all the rest of assumption are all correct. 

>Similarly, the lib files ought to be in "/Users/name/fltk/fltk-1.3.4/lib" after a successful build.

Although my build is successful for demo, /Users/name/fltk/fltk-1.3.4/lib is empty. It only contains a readme file. 
---------------------
Update: So i make the file without xcode. Basically, I followed part 2 of install guide, except the last part, which I do not quite understand. Anyway, all seems good. 

And then I setup my xcode like "https://stackoverflow.com/questions/25879961/setup-xcode-and-fltk" suggested. It seems xcode now can find all relevant header file, but there is a one more problem: 

Do you have any idea what causes it?

Thank you a lot. 

MacArthur, Ian (Leonardo, UK)

unread,
Jun 22, 2017, 7:41:41 AM6/22/17
to fltkg...@googlegroups.com

> It seems xcode now can find all relevant header file, but there is a
> one more problem:

<screenshot removed>

> Do you have any idea what causes it?


No, not from that screenshot.

What that shows is that the linker pass failed (it says that "ld" failed) but you have not grabbed the part of the build output that shows the actual error, so it is impossible to say what went wrong.

In future, please don't post screenshots of errors like that, they aren't all that helpful (as they aren't searchable or etc.) They are also unnecessarily large...

Just find the relevant part of the output message that says where the error occurred and cut'n'paste that text into your message; that is likely to be more informative. And probably a lot smaller!

JY

unread,
Jun 27, 2017, 11:26:44 AM6/27/17
to fltk.general, ian.ma...@leonardocompany.com
Hi,
Thanks for the response. I have given up on xcode as well. Now I am simply using vc and fltk 1.3.3 and follow the video https://www.youtube.com/watch?v=0eSOPWQ1n6U

And everything works! 

Ian MacArthur

unread,
Jun 27, 2017, 2:58:27 PM6/27/17
to fltkg...@googlegroups.com
On Tue Jun 27 2017 16:14:07, JY wrote:
Hi,
Thanks for the response. I have given up on xcode as well. Now I am simply using vc


Hmm, using VC implies you have also given up on OSX? Seems like a step to far to me; I like OSX, I just don’t get on with Xcode.
I don’t get on with VS either, FWIW.
Though both Xcode and VS come with pretty decent compilers, which you can call from the command line...




and fltk 1.3.3 and follow the video https://www.youtube.com/watch?v=0eSOPWQ1n6U


OK, hmm, I’m not sure I’d do it that way... (That is, I'm sure I would not do it the way...)

See Greg’s recent posts on the subject, but some of the advice in that video might be somewhat outdated.

Also, 1.3.3 is a bit old now, 1.3.4-1 is preferred.




Reply all
Reply to author
Forward
0 new messages