| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
On Apr 29, 2004, at 6:05 PM, email@hidden wrote:_______________________________________________
Unsurprisingly, all the standard Cocoa headers (NSWhatever.h) use Objective-C syntax. However, if the compiler thinks it's compiling a vanilla C file, all the Objective-Cisms will cause exactly the problems you're seeing.
Try naming the file "MacRipperjnilib.m" (as opposed to ".c"), to tell the compiler that you're including Objective-C code.
you can use the following C compiler flag too (and preserve your "dear" .c extension :-) )
-x objective-c++ (if you want to use c++ construction inside)
or
-x objective-c (plain ObjC)
man gcc
and look for -x switch
you'll find:
-x language
Specify explicitly the language for the following input files
(rather than letting the compiler choose a default based on the
file name suffix). This option applies to all following input
files until the next -x option. Possible values for language are:
c c-header cpp-output
c++ c++-header c++-cpp-output
objective-c objective-c-header objc-cpp-output
objective-c++ (APPLE ONLY) objective-c++-header (APPLE ONLY)
assembler assembler-with-cpp
ada
f77 f77-cpp-input ratfor
java
treelang
here is a copy of one of my jnilib target settings
DYLIB_COMPATIBILITY_VERSION = 1
DYLIB_CURRENT_VERSION = 1
HEADER_SEARCH_PATHS += "\"$(SYSTEM_LIBRARY_DIR)/Frameworks/Carbon.framework/Versions/A/ Headers\" \"$(SYSTEM_LIBRARY_DIR)/Frameworks/Cocoa.framework/Versions/A/ Headers\" \"$(SYSTEM_LIBRARY_DIR)/Frameworks/JavaVM.framework/Versions/A/ Headers\" \"${OBJROOT}/Headers\""
LIBRARY_STYLE = BUNDLE
OTHER_CFLAGS = "-x objective-c++"
PRODUCT_NAME = libjawtdrawercocoa.jnilib
REZ_EXECUTABLE = YES
WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas"
Dmitry Markman
_______________________________________________
java-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/java-dev
Do not post admin requests to the list. They will be ignored.
| References: | |
| >adding an Existing Framework to a JNI library (From: Ken Hawkins <email@hidden>) | |
| >Re: adding an Existing Framework to a JNI library (From: Dmitry Markman <email@hidden>) |
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.