NO

Author Topic: zlib dll decoration  (Read 5370 times)

czerny

  • Guest
zlib dll decoration
« on: August 19, 2009, 08:20:09 PM »
Hallo,

I would like to compile zlib as a dll.

The zlib doc says:

  * The symbols are exported by name, not by ordinal.
  * The exported names are undecorated.
  * The calling convention of functions is "C" (CDECL).
 
But I can not find a compiler-option for undecorated cdecl.

What is the right switch?

czerny

Offline Vortex

  • Member
  • *
  • Posts: 866
    • http://www.vortex.masmcode.com
Re: zlib dll decoration
« Reply #1 on: August 19, 2009, 08:34:44 PM »
Try to build your project, do you get any error messages? According to the manual, MS VC++ is supported, you should be able to use the library with Pelles C.
Code it... That's all...

czerny

  • Guest
Re: zlib dll decoration
« Reply #2 on: August 19, 2009, 10:00:39 PM »
Hmm,

what do you mean with 'use the library'? A precompiled dll?
That's not the problem. I would like to compile it myself.

czerny

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 2115
Re: zlib dll decoration
« Reply #3 on: August 20, 2009, 07:02:02 AM »
If you make static library, select from project options Calling conv: __cdecl
May the source be with you

czerny

  • Guest
Re: zlib dll decoration
« Reply #4 on: August 20, 2009, 12:56:15 PM »
If you make static library, select from project options Calling conv: __cdecl
I don't understand!
I do not want to make a static lib. I want to make a dll.
__cdecl is clear. But how to get undecorated symbols?

czerny

czerny

  • Guest
Re: zlib dll decoration
« Reply #5 on: August 20, 2009, 01:02:09 PM »
Hi,

maybe it is not clear what I want.

There is a compiler-switch /Gm and /Gn for undecorated fastcall and stdcall.
What is the equivalent switch for cdecl?

czerny

Offline Vortex

  • Member
  • *
  • Posts: 866
    • http://www.vortex.masmcode.com
Re: zlib dll decoration
« Reply #6 on: August 20, 2009, 08:17:41 PM »
Hi czerny,

The cdecl convetion does not decorate functions like stdcall. It adds only a leading underscore to the symbols.
Code it... That's all...