Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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<windows.h>
#include<stdlib.h>
#include<cstdlib>
#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;
    }
    print("FUNCTION!!!!!!!!!");;
    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.

1 Answer 1

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! –  CPP_Person Feb 2 '13 at 11:01
2  
ohhhhh sorry thats the problem!!!!! –  CPP_Person Feb 2 '13 at 11:03

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