This is the mail archive of the
java-discuss@sources.redhat.com
mailing list for the Java project.
Seg fault
- To: java-discuss at sourceware dot cygnus dot com
- Subject: Seg fault
- From: mark kimsal <chugadie dot geo at yahoo dot com>
- Date: Tue, 12 Sep 2000 15:35:59 -0400
- Reply-To: mark at tapinternet dot com
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