• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How do I include Python.framework?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How do I include Python.framework?


  • Subject: Re: How do I include Python.framework?
  • From: Cem Karan <email@hidden>
  • Date: Tue, 31 Jul 2007 16:05:04 -0400

On Jul 31, 2007, at 3:43 PM, Shawn Erickson wrote:
On 7/31/07, Cem Karan <email@hidden> wrote:
I'm having trouble getting Xcode to understand that I want to include
the Python framework (and only that framework) in my project.  I have
done the following:

You didn't say how it is failing.

Apologies, frayed nerves aren't conducive to rational thought.

XCode gives me a compile error, where it first fails to find the file Python.h, and then chokes on every definition thereafter that depends on anything defined within Python.h. The relevant include line is:

#include <Python.h>

I have also tried the following:

#include <python2.5/Python.h>
#include "Python.h"

The code that I'm working on is pure C99 code, generating what should be a command line target. In theory, this is the most plain vanilla form of C project possible, with the only interesting part being the addition of the Python framework.

- Included the framework in my project via the 'Add Existing
Frameworks' contextual menu item

Did you add it to the target that needs it? (look under the targets link phase to see if it is listed)

It is listed in my target under the phase titled 'Link Binary With Libraries'


- Added the line '-F/System/Library/Frameworks' to my frameworks
search paths

Not needed unless you have some strange project/target type... which you did outline so we can only guess.

Again, apologies. The project/target is whatever Xcode generates when you create a Standard Tool. The changes I made include the following:


I'm using the 10.4u SDK - the default on my system
DWARF
C99
Level of Debug Symbols = full
Optimization Level = None (-O0)
Turned on all warnings + added the flags '-Wall -Wextra -pedantic'

I added in my own files, which, when I comment out the parts that try to access Python, do compile correctly, and mostly cleanly (my excessive warning levels mean I get warnings for things like not using argv and argc).

- Made sure that both the framework search line and the framework I
added reference the same framework

Again no need to do that....

Removed and tried again... no luck.

The only thing that I have not done is directly added the header files from the framework into my project (I added the entire framework, but didn't copy the framework headers anywhere). I don't think this is necessary from what I've seen when I use the Cocoa framework, but I'm not sure at this point.

Thanks,
Cem Karan

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: How do I include Python.framework?
      • From: Philip Wasson <email@hidden>
References: 
 >How do I include Python.framework? (From: Cem Karan <email@hidden>)
 >Re: How do I include Python.framework? (From: "Shawn Erickson" <email@hidden>)

  • Prev by Date: Re: How do I include Python.framework?
  • Next by Date: Derivative Cocoa apps (resource/localization issues)?
  • Previous by thread: Re: How do I include Python.framework?
  • Next by thread: Re: How do I include Python.framework?
  • Index(es):
    • Date
    • Thread