Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

So I'm attempting to fix a OpenGL in Java problem by making a DLL in C++ and then call it from Java but I've ran into an issue. So I'm testing a basic DLL in C++ and I got this error: "error: 'hGetProcDLL' was not declared in this scope|" This is my code:

#include <iostream>

using namespace std;

typedef void (*f_print)(string);

    int main()
    //The DLL Is Called OpenGL But I'm Making A Basic Print Function In It To Test It
    HINSTANCE DLLI = LoadLibrary("C:\\OpenGL.dll");
    if (DLLI == NULL)
        cout << "Error loading DLL" << endl;
        return 1;

    f_print print = (f_print)GetProcAddress(hGetProcIDDLL, "print");
    if (!print)
        cout << "Invalid function!" << endl;
        return 1;
    return 0;

Any idea what's happening?

share|improve this question

closed as too localized by sam hocevar, Byte56, Maik Semder, Josh Petrie, Sean Middleditch Feb 4 '13 at 4:49

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

up vote 2 down vote accepted

It’s just that you call your variable DLLI then try to use it as hGetProcIDDLL.

share|improve this answer
That's not the problem! – LiquidFeline Feb 2 '13 at 11:01
ohhhhh sorry thats the problem!!!!! – LiquidFeline Feb 2 '13 at 11:03

Not the answer you're looking for? Browse other questions tagged or ask your own question.