Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
General
GeneralPortable MacsHardwareNetworking
Applications
Mac ApplicationsEudoraFirefox / MozillaInternet ExplorerOutlook ExpressMS OfficeEntourageExcelPowerPointWordVirtual PCMedia PlayerOther MS Products
Programming
Mac ProgrammingCodeWarriorPerl
Country Specific
Australian Mac GroupUK Mac Group

Mac Forum / Applications / Firefox / Mozilla / May 2005



Tip: Looking for answers? Try searching our database.

Webclient 2.0 under MacosX

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
edburns - 10 May 2005 02:04 GMT
I'm trying to get webclient working on MacOSX!  The last time we ran
Webclient on the Mac, MacOSX didn't even exist.  I have it building,
and I need to write a little bit of Objective C for the native window
and event loop handling, but first I want to at least load the JNI lib.
I found that I had to make the library be called libwebclient.jnilib
instead of libwebclient.dylib.  When I do this, the
System.loadLibrary() call starts to run, but ultimately fails with:

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

I read something somewhere that Java has trouble loading dependent
libraries under MacOSX so how can I fix this?

Any help would be greatly appreciated.

Ed
edburns - 10 May 2005 17:47 GMT
Doing this fixed my problem:

export MOZILLA_FIVE_HOME=$MOZ_SRC/mozilla/dist/bin
export
DYLD_LIBRARY_PATH=$MOZILLA_FIVE_HOME:$MOZILLA_FIVE_HOME/components
edburns - 11 May 2005 05:54 GMT
Ok, I've run into another problem.

I have a need to manually run the event loop occasionally.  In Win32, I
do

   if (::PeekMessage(&msg, nsnull, 0, 0, PM_NOREMOVE)) {
       if (::GetMessage(&msg, nsnull, 0, 0)) {
           wasHandled = PR_FALSE;
           ::NS_HandleEmbeddingEvent(msg, wasHandled);
           if (!wasHandled) {
               ::TranslateMessage(&msg);
               ::DispatchMessage(&msg);
           }
       }
   }

and in Unix I do

   while(gtk_events_pending()) {
       gtk_main_iteration();
   }

So I was thinking in Mac, I could do:

   NSEvent *currentEvent = [NSApp currentEvent];
   [NSApp sendEvent: currentEvent];

So I defined this function prototype in a .h, and implemented it in a
.mm file:

#ifdef __cplusplus
extern "C" {
#endif

JNIEXPORT void JNICALL cocoaProcessEventLoop(void);

#ifdef __cplusplus
}
#endif

The JNIEXPORT and JNICALL things are just macros that expand out
to properly mark the function as an export.

And the function has this simple implementation:

JNIEXPORT void JNICALL cocoaProcessEventLoop(void) {
   NSEvent *currentEvent = [NSApp currentEvent];
   [NSApp sendEvent: currentEvent];
}

However, when I try to link the library containing the C++ and .mm
files I get this error:

ld: cocoa/CocoaBrowserControlCanvas.o illegal reference to symbol:
_NSApp defined in indirectly referenced dynamic library
/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit
ld: cocoa/CocoaBrowserControlCanvas.o illegal reference to symbol:
_objc_msgSend defined in indirectly referenced dynamic library
/usr/lib/libobjc.A.dylib
ld: warning multiple definitions of symbol _finite
/System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Libraries/libjava.jnilib(single
module) definition of _finite
/usr/lib/libpthread.dylib(finite.o) definition of _finite
ld: warning multiple definitions of symbol _ldexp
/System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Libraries/libjava.jnilib(single
module) definition of _ldexp
/usr/lib/libpthread.dylib(frexpldexp.o) definition of _ldexp
ld: warning multiple definitions of symbol _frexp
/System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Libraries/libjava.jnilib(single
module) definition of _frexp
/usr/lib/libpthread.dylib(frexpldexp.o) definition of _frexp
ld: warning multiple definitions of symbol _isnan
/System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Libraries/libjava.jnilib(single
module) definition of _isnan
/usr/lib/libpthread.dylib(isnan.So) definition of _isnan
/usr/bin/libtool: internal link edit command failed

Can someone please help with this error?

I'm very new to Cocoa so I'm probably doing something simple.
edburns - 12 May 2005 04:46 GMT
For the record, I was told by smfr that this approach will probably not
work and that I should look into using nsIEventQueueService instead.

Ed
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.