设置Xcode和FLTK [英] Setup Xcode and FLTK

查看:1195
本文介绍了设置Xcode和FLTK的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试在此页上创建以下是我所做的:


  1. 更改版本设置:



    标题搜索路径: -I / usr / local / include



    图书馆搜索路径: / usr / local / lib



  1. 转到终端并输入 fltk-config --ldflags



    你得到一行标志,我的是
    -L / usr / local / Cellar / fltk / 1.3.2_1 / lib -lfltk -lpthread -framework Cocoa



    在Xcode Build设置中,粘贴到其他链接器标记


>


  1. 在这些步骤之后,Xcode成功编译文件。


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.

解决方案

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

  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

  1. After these steps Xcode compiled the file successfully.

这篇关于设置Xcode和FLTK的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆