User forums > Using Code::Blocks

GetProcAddress

(1/1)

Berion:
I made a simple test dll with on exported function.

LoadLibrary worked, but I couldn't load the function with GetProcAddress().

I searched in this forum and found that I should use the name of the function in the .def file.

Now it works, but the function is called something like _Z4Testv instead of Test.

Now I have some questions:

Is there a way to use the real name?
Will the name change?

thomas:
Makes me wonder how that is related to Code::Blocks... this is actually a Win32 specific programming question.

Anyway, GetProcAddress() failing is most often due to name mangling, i.e. a forgotten extern "C" in your code.

Berion:
thanks

I posted it here because the last time I worked with it was with vc++ and there it worked. Not the same code.

Navigation

[0] Message Index

Go to full version