• 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 to include a .c file in a loadable bundle?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to include a .c file in a loadable bundle?


  • Subject: Re: How to include a .c file in a loadable bundle?
  • From: Jason Coco <email@hidden>
  • Date: Wed, 13 Aug 2008 13:48:43 -0400

You can't use Foundation in a C file... it's an Objective-C framework. Use CoreFoundation instead... you're getting these errors because Foundation/Foundation.h includes many Object-C statements which won't compile in C.

HTH, Jason

On Aug 13, 2008, at 13:05 , Jesse Grosjean wrote:

Feeling pretty dumb here, but I can't seem to include a .c file in my loadable bundle target. I get a ton of errors. Is there some trick that I'm missing. Here's what I'm doing.

1. Create new Xcode "Cocoa Application" project.
2. Create new loadable bundle in that project.
3. Add new Carbon C file to the application. Compile. It works.
4. Add new Carbon C file to the bundle. Compile. And I get 1495 errors starting with:


Building target “MyBundle” of project “TestApp” with configuration “Debug” — (1495 errors)
cd /Users/jesse/Desktop/TestApp
/Developer/usr/bin/gcc-4.0 -x c-header -arch i386 -fmessage- length=0 -pipe -std=c99 -Wno-trigraphs -fpascal-strings -fasm-blocks -O0 -Wreturn-type -Wunused-variable -isysroot /Developer/SDKs/ MacOSX10.5.sdk -mfix-and-continue -mmacosx-version-min=10.5 - gdwarf-2 -iquote /Users/jesse/Desktop/TestApp/../builds/ TestApp.build/Debug/MyBundle.build/MyBundle-generated-files.hmap -I/ Users/jesse/Desktop/TestApp/../builds/TestApp.build/Debug/ MyBundle.build/MyBundle-own-target-headers.hmap -I/Users/jesse/ Desktop/TestApp/../builds/TestApp.build/Debug/MyBundle.build/ MyBundle-all-target-headers.hmap -iquote /Users/jesse/Desktop/ TestApp/../builds/TestApp.build/Debug/MyBundle.build/MyBundle- project-headers.hmap -F/Users/jesse/Desktop/TestApp/../builds/Debug - I/Users/jesse/Desktop/TestApp/../builds/Debug/include -I/Users/jesse/ Desktop/TestApp/../builds/TestApp.build/Debug/MyBundle.build/ DerivedSources -c /Developer/SDKs/MacOSX10.5.sdk/System/Library/ Frameworks/AppKit.framework/Headers/AppKit.h -o /var/folders/DI/ DIMbvaZQFpGmNuaJM2eybk+++TI/-Caches-/com.apple.Xcode.501/ SharedPrecompiledHeaders/AppKit-bawztsadvnkohkggpdwhgbqjwsmp/ AppKit.h.gch
In file included from /Developer/SDKs/MacOSX10.5.sdk/System/Library/ Frameworks/Foundation.framework/Headers/Foundation.h:12,
from /Developer/SDKs/MacOSX10.5.sdk/System/Library/ Frameworks/AppKit.framework/Headers/AppKit.h:10:
/Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks/ Foundation.framework/Headers/NSObjCRuntime.h:124: error: syntax error before '@' token
/Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks/ Foundation.framework/Headers/NSObjCRuntime.h:126: error: syntax error before '*' token
/Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks/ Foundation.framework/Headers/NSObjCRuntime.h:127: error: syntax error before '*' token
...


Does anyone know what I should do if I want to use code from a .c file in my bundle?

Thanks,
Jesse_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
@gmail.com


This email sent to email@hidden

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >How to include a .c file in a loadable bundle? (From: Jesse Grosjean <email@hidden>)

  • Prev by Date: Re: How to include a .c file in a loadable bundle?
  • Next by Date: NSCollectionView and bindings to text fields in tab view
  • Previous by thread: Re: How to include a .c file in a loadable bundle?
  • Next by thread: NSCollectionView and bindings to text fields in tab view
  • Index(es):
    • Date
    • Thread