1

Well I am currently working on a project kind of like JOGL just I want to remake it so I can do the same with DirectX. I came across this error right in the begining and have been researching this for about 2 days now.

Here is the full error: Error 1 error LNK2019: unresolved external symbol _imp_JAWT_GetAWT@8 referenced in function "public: __thiscall JAWT_Info::JAWT_Info(struct JNIEnv_ *,class _jobject *)" (??0JAWT_Info@@QAE@PAUJNIEnv_@@PAV_jobject@@@Z) C:\Users\Michael\documents\visual studio 2013\Projects\BezerkGL\BezerkGL\redgl.obj BezerkGL

Here is the header that I am using:

#ifndef INFO_H
#define JAWT_INFO_H

// Helper class for accessing JAWT Information.
class JAWT_Info
{
private:
    JAWT awt;
    JAWT_DrawingSurface* ds;
    JAWT_DrawingSurfaceInfo* dsi;
    JAWT_Win32DrawingSurfaceInfo* dsi_win;

public:
    JAWT_Info(JNIEnv *env, jobject panel)
    {
        jboolean result;
        jint lock;

        // Get the AWT
        awt.version = JAWT_VERSION_1_3;
        result = JAWT_GetAWT(env, &awt);
        assert(result != JNI_FALSE);
        // Get the drawing surface
        ds = awt.GetDrawingSurface(env, panel);
        if (ds == NULL)
            return;
        // Lock the drawing surface
        lock = ds->Lock(ds);
        assert((lock & JAWT_LOCK_ERROR) == 0);

        // Get the drawing surface info
        dsi = ds->GetDrawingSurfaceInfo(ds);

        // Get the platform-specific drawing info
        dsi_win = (JAWT_Win32DrawingSurfaceInfo*)dsi->platformInfo;
    }

    HWND getHWND()
    {
        if (dsi_win == NULL)
            return NULL;
        return dsi_win->hwnd;
    }

    HDC getHDC()
    {
        if (dsi_win == NULL)
            return NULL;
        return dsi_win->hdc;
    }

    virtual ~JAWT_Info()
    {
        if (ds != NULL)
        {
            // Free the drawing surface info
            ds->FreeDrawingSurfaceInfo(dsi);
            // Unlock the drawing surface
            ds->Unlock(ds);
            // Free the drawing surface
            awt.FreeDrawingSurface(ds);
        }
    }
};

#endifJAWT_

And I am pretty sure that is all required info.

1 Answers1

0

A bit late but may be useful for somebody. It seems like JNI part of application was compiled with Java in different architecture (probably 64 bit) comparing to C part (probably 32 bit). I used to have such error an that was the reason. I've switched configuration to Java 32 bit and that solved problem.

Marek Podyma
  • 913
  • 10
  • 12