• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

JNI + X11 questionss

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey All,
I am running xorg-x11 for my X server. I am using C for the native calls. I am quite certain that the C-code that I have written works just fine on it's own but when I compile to a shared library and use it with java, I get this:

Exception in thread "main" java.lang.UnsatisfiedLinkError: /home/scoon/Desktop/JNI/X11/libcX11.so: /home/scoon/Desktop/JNI/X11/libcX11.so: undefined symbol: XOpenDisplay
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1560)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1485)
at java.lang.Runtime.loadLibrary0(Runtime.java:788)
at java.lang.System.loadLibrary(System.java:834)
at jX11.<clinit>(jX11.java:4)


I compile my shared library using these 2 steps:

gcc -I$JAVAHOME/include -I$JAVAHOME/include/linux -I/usr/X11R6/include -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/X11R6/include -L/usr/X11R6/lib X11_Imp.c -c -o libcX11.o

ld -shared -o libcX11.so libcX11.o


I think this is an include problem, so I am wondering if anyone has had any experience w/ this?

Thanks in advance,
scoon
 
My favorite is a chocolate cupcake with white frosting and tiny ad sprinkles.
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic