News:

Download Pelles C here: http://www.smorgasbordet.com/pellesc/

Main Menu

DLL

Started by BertBulaba, April 09, 2009, 03:29:26 PM

Previous topic - Next topic

BertBulaba

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?

Stefan Pendl

There is no extern C in C, extern C is only valid for C++.
---
Stefan

Proud member of the UltraDefrag Development Team

BertBulaba

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.


Stefan Pendl

Seems there is one .LIB file missing from the project properties, where those two external functions are included.
---
Stefan

Proud member of the UltraDefrag Development Team

BertBulaba

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?