News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

Using DEF Files with DLL Creation

Started by BigAngryDog, March 13, 2006, 10:04:35 AM

Previous topic - Next topic

BigAngryDog

How does one link in a def file when creating a DLL?

Currently, my def file doesn't seem to have any effect. I particularly want to use it to remove function name decoration.

For example:


LIBRARY test.dll

EXPORTS
    get_url = get_url@12
    get_urlW = get_urlW@12


Any help appreciated. :)
[url="//bigangrydog.com"]BigAngryDog.com[/url]

Michael

Hello,

It would be useful if you say which compiler you are using and which C::B version :). Anyway, this link could be useful.

Best wishes,
Michael
[url="http://img207.imageshack.us/img207/9728/411948picture4em.png"]http://img207.imageshack.us/img207/9728/411948picture4em.png[/url]

BigAngryDog

Version 1.0 RC2.

Thanks for the reply. However, it doesn't seem that the link has the info I need. It talks of a "dlltool" for creating import libraries. However, it isn't an import library I need. I specifically want to remove the name decoration with the __stdcall calling convention.

I understand that I can do it by adding aliases to a def file. So that:

get_url = get_url@12

But how do I "link in" the def file so that the aliases appear in the export table of the DLL?

I'm not an expert with MingGW from the command line. Is there any way I can add the option to C::B?
[url="//bigangrydog.com"]BigAngryDog.com[/url]

mandrav

#3
Try adding the following in your target's other linker options:

--def test.def
EDIT: if the above doesn't work, try -Wl,--def=test.def

(replacing "test.def" with your def's filename)
Be patient!
This bug will be fixed soon...

Michael

Quote from: BigAngryDog on March 13, 2006, 10:58:50 AM
Version 1.0 RC2.

You would might be give a try to a nightly build :).

Quote from: BigAngryDog on March 13, 2006, 10:58:50 AM
Thanks for the reply. However, it doesn't seem that the link has the info I need. It talks of a "dlltool" for creating import libraries. However, it isn't an import library I need. I specifically want to remove the name decoration with the __stdcall calling convention.

I understand that I can do it by adding aliases to a def file. So that:

get_url = get_url@12

But how do I "link in" the def file so that the aliases appear in the export table of the DLL?

I'm not an expert with MingGW from the command line. Is there any way I can add the option to C::B?

I am not an expert too, but may be this link could help.

Best wishes,
Michael
[url="http://img207.imageshack.us/img207/9728/411948picture4em.png"]http://img207.imageshack.us/img207/9728/411948picture4em.png[/url]

BigAngryDog

>You would might be give a try to a nightly build

I just have. Thanks!


>Try adding the following in your target's other linker options:

>--def test.def
>EDIT: if the above doesn't work, try -Wl,--def=test.def

Will do. Thanks!
[url="//bigangrydog.com"]BigAngryDog.com[/url]

BigAngryDog

>--def test.def
>EDIT: if the above doesn't work, try -Wl,--def=test.def

Didn't work, but helped me know what sort of thing to look for. Thanks.

So for anyone else looking to build a dll using the __stdcall (WINAPI) calling convention, without the name decoration MinGW (GCC) adds, then put this in CodeBlocks' "Other Linker Options":


-Wl,--kill-at
[url="//bigangrydog.com"]BigAngryDog.com[/url]

grandzebu

What a very goog information : -Wl,--kill-at is THE solution
Thank's a lot
GZ