Seg fault

mark kimsal chugadie.geo@yahoo.com
Tue Sep 12 12:35:00 GMT 2000


Hello all,

I got GCJ installed on my system recently, thanks be to the recent
RPMs.  I am trying my first hand at CNI by linking to a small program I
made with SDL (libsdl.org).  I'm on Caldera OpenLinux, x86 chip.  I can
get the SDL program written in C++ to compile and execute by itself, but
when I wrap a function around it and call it from my java program, i get
a segmentation fault.  The program seems to compile and link okay (no
errors).  Is there anyway to get more information about the seg fault?
Are there any clairvoiant people who can diagnose my problem based only
on the error "Segmentation fault"? (that would be the optimal solution)
Here's kind of what I did

-----C++ program-------
#include stuff
#include SDL.h
#include cni.h

void sample::MyNative() {
//initialize SDL lib
//open a window;

}

-----Java program-----
class sample {

    public native MyNative();

    public static void main(String args[]) {
        sample s = new sample();
        s.MyNative();
    }
}

then i
    compiled the java
    compiled the .class output
    made a .h of the java
    compiled the .c
    linked the .os to an executable
    ran it
    became dissatisfied



More information about the Java mailing list