NO

Author Topic: DLL  (Read 3022 times)

BertBulaba

  • Guest
DLL
« on: April 09, 2009, 03:29:26 PM »
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?

Offline Stefan Pendl

  • Global Moderator
  • Member
  • *****
  • Posts: 582
    • Homepage
Re: DLL
« Reply #1 on: April 09, 2009, 03:59:47 PM »
There is no extern C in C, extern C is only valid for C++.
---
Stefan

Proud member of the UltraDefrag Development Team

BertBulaba

  • Guest
Re: DLL
« Reply #2 on: April 09, 2009, 04:49:55 PM »
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.


Offline Stefan Pendl

  • Global Moderator
  • Member
  • *****
  • Posts: 582
    • Homepage
Re: DLL
« Reply #3 on: April 09, 2009, 05:20:20 PM »
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

  • Guest
Re: DLL
« Reply #4 on: April 09, 2009, 05:42:06 PM »
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?