Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: adding an Existing Framework to a JNI library



thanks all. i do have one more possibly two questions...

dyld: /System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Commands/ java can't open library: @executable_path/../Frameworks/BroadjamCD.framework/Versions/A/ BroadjamCD (No such file or directory, errno = 2)

looks like it can't see my framework when i run it

i am only used to the obj C style of copying files as part of the build process however i can't seem to add a copy process to the jnilib and add the BroadjamCD.framework.

i have changed my library style to BUNDLE thinking that might help but no. i added the framework relative the project since it is not production ready.

what am i missing here?

thanks,
ken;
On Apr 29, 2004, at 3:26 PM, Dmitry Markman wrote:

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.
_______________________________________________
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>)



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.