Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (499)
Games in Android Showcase (118)
games submitted by our members
Games in WIP (568)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  missing libraries in makefile  (Read 598 times)
0 Members and 1 Guest are viewing this topic.
Offline dbrayford@sci.utah.edu

Junior Newbie





« Posted 2010-05-18 20:44:19 »

I get the following error message, yet don't seem able to get past it. I am probably missing something in the link line of the makefile but can't see what library I am missing. I've written a simple JNI Hello World and simple OpenGL program using a very similar makefile (modified to produce an executable rather than a shared lib for the OpenGL program), which both run without a problem.

Exception in thread "main" java.lang.UnsatisfiedLinkError: /uufs/chpc.utah.edu/common/home/u0544384/Desktop/OpengL_Test/libMyWindow.so: /uufs/chpc.utah.edu/common/home/u0544384/Desktop/OpengL_Test/libMyWindow.so: undefined symbol: JAWT_GetAWT
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1803)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1728)
at java.lang.Runtime.loadLibrary0(Runtime.java:823)
at java.lang.System.loadLibrary(System.java:1028)
at MyWindow.<clinit>(MyWindow.java:14)
Could not find the main class: MyWindow. Program will exit.


1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
42  
43  
44  
45  
46  
47  
48  
49  
50  
51  
52  
53  
54  
55  
56  
57  
58  
59  
60  
61  
62  
63  
64  
65  
66  
67  
68  
69  
70  
71  
72  
73  
74  
75  
76  
77  
78  
79  
80  
81  
82  
83  
84  
85  
86  
87  
88  
89  
90  
91  
92  
93  
94  
95  
96  
97  
98  
99  
100  
101  
102  
103  
104  
105  
106  
107  
108  
109  
110  
111  
112  
113  
114  
115  
116  
117  
118  
119  
120  
121  
122  
123  
124  
125  
126  
127  
128  
129  
import java.awt.Frame;
 
import java.awt.BorderLayout;
 
import java.awt.Canvas;
 
import java.awt.Label;
 
import java.awt.event.ActionListener;
 
import java.awt.event.ActionEvent;
 
import java.awt.Graphics;
 
import javax.swing.Timer;
 
 
 
public class MyWindow extends Canvas implements ActionListener
 
{
 
    static {
 
        System.out.println( "java.library.path := " + System.getProperty("java.library.path") );
 
        System.loadLibrary("MyWindow");
 
    }
 
   
 
    public final static int TIMER_SECONDS = 100;
 
 
 
    public static void main( String[] argv )
 
    {
 
        Frame f = new Frame();
 
        f.setSize(300,400);
 
        f.setLayout(new BorderLayout());
 
        f.setTitle("OpenGL from Java");
 
       
 
        MyWindow w = new MyWindow();
 
        f.add(w,BorderLayout.CENTER);
 
        f.add(new Label("test"),BorderLayout.SOUTH);
 
        f.setBounds(300,300,300,300);
 
        f.setVisible(true);
 
    }
 
 
 
    private boolean bInitOpenGL = false;
 
    public void actionPerformed(ActionEvent evt)
 
    {
 
        if(bInitOpenGL == false)
 
        {
 
            bInitOpenGL = true;
 
            initializeOpenGL();
 
        }
 
        paintOpenGL();
 
    }  
 
 
 
    public void addNotify()
 
    {
 
        super.addNotify();
 
        javax.swing.Timer timer = new Timer(TIMER_SECONDS,this);
 
        timer.start();
 
    }
 
 
 
    public void removeNotify()
 
    {
 
        super.removeNotify();
 
        cleanupOpenGL();
 
    }
 
 
 
    // native entry point for Painting

    public native void paintOpenGL();
 
 
 
    // native entry point for enabling OpenGL calls.

    public native void initializeOpenGL();
 
 
 
    // native entry point for disabling OpenGL calls.

    public native void cleanupOpenGL();
 
}


1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
CC = gcc -pedantic -ansi -shared
 
SRC = MyWindow.cpp
 
all:
   $(CC) $(SRC) -o libMyWindow.so -L/usr/X11R6/lib -lGL -lGLU -lXxf86vm -lstdc++
 
clean:
   @echo Cleaning up...
   @rm -f *.so *.o
   @echo Done.
 
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Pippogeek (40 views)
2014-09-24 16:13:29

Pippogeek (31 views)
2014-09-24 16:12:22

Pippogeek (21 views)
2014-09-24 16:12:06

Grunnt (47 views)
2014-09-23 14:38:19

radar3301 (29 views)
2014-09-21 23:33:17

BurntPizza (65 views)
2014-09-21 02:42:18

BurntPizza (37 views)
2014-09-21 01:30:30

moogie (44 views)
2014-09-21 00:26:15

UprightPath (53 views)
2014-09-20 20:14:06

BurntPizza (55 views)
2014-09-19 03:14:18
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!