2

Im having trouble to use Gecode (http://www.gecode.org/download.html) framework for my project.

  1. I downloaded and installed the framework. Now it can be found under

    /Library/Frameworks/gecode.framework

  2. I created a new "Command Line Tool" project, and selected "C++" for the type.

  3. Then I opened the Target of my project and added gecode.framework in Build Phases -> Link Binary With Libraries
  4. In Build Settings for the path i added following path for "Header Search Path" : /Library/Frameworks/gecode.framework
  5. Now i tried to build a sample code with following includes:

    #include <gecode/driver.hh>
    #include <gecode/int.hh>
    #include <gecode/minimodel.hh>
    

--> Xcode is complaining that file is not found.

I tried to compile in terminal with g++ and llvm-g++, it compiles without any warnings or errors

2
  • did you tried with #include "gecode/driver.hh"? Commented Jun 13, 2013 at 12:19
  • yes i tried, but it is not on local path. The problem is that, then xcode drops error in driver.hh, that it cant find other <gecode/xxx.hh> Commented Jun 13, 2013 at 14:56

2 Answers 2

2

To make GeCode or any other framework work in Xcode you need to do the following.

  1. Install the framework (Obviously!! GeCode Link here)
  2. Open the project in Xcode
  3. Select the project file from the project navigator on the left side of the project window.

Xcode Project window

  1. Under Linked Frameworks and Libraries, click the + sign.

  2. Select the framework from the list display or else click on Add Other if your framework is not found in the list.

  3. Press Command+Shift+G and enter the path directly. In my case for gecode it was /Library/Frameworks/ and then select the desired framework you want to include in your project and then press open.

Framework path in Xcode

  1. Go back to you project file and press Command + r and Voila!! it should work.

Cheers!!

Sign up to request clarification or add additional context in comments.

Comments

1

Well, i don't have the full solution, but part of it: add the path of your frameworks (e.g. /Library/Frameworks) to the "Framework search path" of your projects.

After that, the compiler does not complain anymore, and autocompletion works fine. But the linker still complains about some symbols not found, when linking.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.