I have a problem with code for a dll originally written in VC++ 6. It compiles fine in VC++ 6, but I want to port it to C in order to get away from .NET. The culprit seems to be this piece of code:
#define PLUGINAPI extern "C" __declspec(dllexport)
I get the following warnings and errors:
warning #2099: Missing type specifier.
error #2014: Empty declaration.
error: expected ';' but found 'string constant'.
error #2156: Unrecognized declaration.
I have tried many different solution but I just cannot get it to work ???. Anyone?
There is no extern C in C, extern C is only valid for C++.
Well it seems like sometimes you are staring at the problem so hard that you cannot see what is infront of you!
Thanks!
Now another problem popped up which I have no idea what it is:
POLINK: error: Unresolved external symbol '__imp__VirtualFree'.
POLINK: error: Unresolved external symbol '__imp__HeapCreate'.
etc... all 26 of them in total
What is POLINK and what kind of errors are they? They are not related to the code I have though, so it must be something else.
Seems there is one .LIB file missing from the project properties, where those two external functions are included.
It now compiles - it was due to some settings in the Project Options.
:( Unfortunately the API doesn't load the dll. It has no problems with the dll compiled with VC++ 6. Any ideas?