Pelles C forum
C language => Expert questions => Topic started by: czerny 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
-
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.
-
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
-
If you make static library, select from project options Calling conv: __cdecl
-
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
-
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
-
Hi czerny,
The cdecl convetion does not decorate functions like stdcall. It adds only a leading underscore to the symbols.