How to use .def file in ecere IDE

General help with the core C language of which eC is a superset, integrating eC with other languages such as C++ at the C level, using C libraries in eC, etc.
Post Reply
fedor_bel
Posts: 21
Joined: Sun Mar 14, 2010 4:46 pm

How to use .def file in ecere IDE

Post by fedor_bel »

Hello,

So the question is in the title. How to use Module-Definition files in ecere IDE?

I need to build a DLL. How can I make use of .def file to list the exported function names, so that I do not have to figure out the decorated (mangled) names (like function1@8)?
jerome
Site Admin
Posts: 603
Joined: Sat Jan 16, 2010 11:16 pm

Re: How to use .def file in ecere IDE

Post by jerome »

Hi,

Sorry I sort of didn't originally see this post. Although the IDE doesn't realy have special functionality for it, you should be able to specify a .def file by adding it to the 'Additional Libraries' box under the 'Linker' tab of the Project Settings dialogs (under Build tab).

See: http://www.redhat.com/docs/manuals/ente ... win32.html

This should simply add the .def file to the GCC output line:

gcc -o <output> <objectfiles> <dll name>.def

This link also seems resourceful:

http://www.willus.com/mingw/yongweiwu_stdcall.html

And http://lmgtfy.com/?q=exporting+symbols+.def+mingw

Cheers,

Jerome
santy
Posts: 4
Joined: Fri Mar 19, 2010 10:02 am

Re: How to use .def file in ecere IDE

Post by santy »

Hello
I use pexports.exe utility for creating .def file and after that I create import library.
For example bat file:

pexports %1.dll >%1.def
dlltool -D %1.dll -d %1.def -l lib%1.a
fedor_bel
Posts: 21
Joined: Sun Mar 14, 2010 4:46 pm

Re: How to use .def file in ecere IDE

Post by fedor_bel »

Thank you guys for your answers.

That helps. And thank you, jerome, for learning links - it great to acquire new knowledge on the topic.

One more comment - it would be nice to have a special field in ecere IDE to provide a .def file or at least some hints and explanation, so that people having the same problem would not have to search for a solution so long. Oh, doh, the C/C++ programming is still for geeks. It would be so nice to make it simple for mere mortals by providing easy solutions to the most common configuration issues, like a wizard or something with good explanation on all those small extra options, keys and switches that need to be set or used to achieve some simple goal.

Cheers.
jerome
Site Admin
Posts: 603
Joined: Sat Jan 16, 2010 11:16 pm

Re: How to use .def file in ecere IDE

Post by jerome »

It would indeed be a nice to have. I suggest you add a 'feature' request for it on Mantis.
However since we generally use Ecere for writing cross-platform software, we usually do not come across these Windows specific issues of integrating with other MS software. Furthermore there are (sadly) more important bugs to whip in the IDE.

May this forum post however make it easier for mere mortals who shall come across this issue in the future :)

Cheers,

Jerome
Post Reply