Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-swt-dev] Native compiling on Linux and MacOS X

Woooootttt. Got it compiled and running under Linux and I have a pretty good idea 
why it's not working under MacOS X. Thank goodness for strace. 
 
It would seem that if you have a your_jdk/src.zip as an entry in your classpath, then 
all hell breaks loose and the program segfaults. I changed this to point to 
your_jdk/dt.jar. Then it throws the UnsatisfiedLinkError. I copied the libswt-xxx.so 
to /usr/lib ran ldconfig and voila. My native application on Linux works. Helloooooo 
world. 
 
So now armed with this knowledge, I should be able to get it running on MacOS X. 
 
Cheers all. 
 
On Mon Feb 14  2:18 , <cyberdeth@xxxxxxxxxx> sent: 
 
>Okay.  
>  
>So here is what I've done to sort of getting it to work on MacOS X.  
>  
>I modified the make_carbon.mak to create a static library of the compiled files  
>instead of a bundle.  
>  
>I took the swtsrc.zip and swtpisrc.zip and extracted it. I then compiled the java file  
>in the org... directory with gcj creating a .a static lib of all the objects. I then use  
>that newly created library and use it to link against at compile time ie.  
>  
>gcj Hello.java -o Hello --main=Hello --classpath=. libswt.a libswt-carbon-3063.a  
>libswt-pi-carbon-3063.a  
>  
>where the swtsrc and swtpisrc is extracted in the current directory so that it can  
>resolve the org.eclipse... java objects etc.  
>  
>This creates a fully functional SWT self contained native application with no  
>dependancies on shared libs and stuff. I tried to compile it without the  
>libswt-carbon-xxx-.a which compiles fine but when I run it, I get an  
>UnsatisfiedLinkError Exception. I have tried to set the -Djava.library.path variable  
>with no results. I tried setting up the DYLD_PATH and LD_LIBRARY_PATH 
variables,  
>also with no results. I linked with the -Wl,-framework,JavaVM and  
>-Wl,-framework,Carbon flags and put the jnilib bundles into  
>the /Library/Frameworks..... directory. No result.  
>  
>Now the problem is that it segfault as soon as I try to register a display. I have put  
>in some debug code in the register method of the Display.java file.  
>  
>so in the for loop, where it checks wether the display is null, it finds that 
Displays[0]  
>is null. So now it tries to copy the display paramter into this Displays[0] slot. And  
>this is when it segfaults. What I know of java is, that you first have to create a new  
>Display object for array [0] before you can copy anything into it. So I did that. The  
>problem now is that it, run for like ever, almost like an infinate loop before it  
>segfaults again. At this stage I was too tired debug that. Will probably have a look  
>at it tonight.  
>  
>So the basic problem, what I can see here is that swt can't register a display.  
>  
>Any ideas on this ?  
>  
>Thanks  
>  
>Francois  
>  
>_______________________________________________ 
>platform-swt-dev mailing list 
>platform-swt-dev@xxxxxxxxxxx 
>http://dev.eclipse.org/mailman/listinfo/platform-swt-dev 
 
 


Back to the top