Page 1 of 1

Create DLL with .a linking library

Posted: Fri Jun 25, 2010 9:33 pm
by evstevemd
Hi,
I need to create DLL with .a library for Linking. I load dynamically. Should I create another project?
AFAIK, creating DLL should produce .a (.lib) automatically but in my case I see only .dll.
am I missing something here?

Re: Create DLL with .a linking library

Posted: Sat Jun 26, 2010 12:04 pm
by eranif
Not really a codelite issue. but more of mingw issue.

You need to create a def file and list there all the symbols that you wish to export, and then run the dlltool.exe tool on it to create the import library

To automate the process, I suggest that you use a post build action similar to:

Code: Select all

dlltool.exe -d MyDll.def -l $(IntermediateDirectory)/libMyDll.a
(assuming that your DLL is created under the $(IntermediateDirectory) directory, which is the case by default)

Read this excellent explanation about dlltool and import library:

http://oldwiki.mingw.org/index.php/Crea ... tLibraries

Eran

Re: Create DLL with .a linking library

Posted: Tue Jun 29, 2010 2:34 pm
by evstevemd
Big thanks, Sir!

Re: Create DLL with .a linking library

Posted: Tue Jun 29, 2010 3:47 pm
by evstevemd
What about Linux?
I mostly develop in Linux now days!
I am searching for dlltool alternative for Linux

Re: Create DLL with .a linking library

Posted: Tue Jun 29, 2010 8:18 pm
by josee
You do not need such a thing.
Linux automatically exports all global variables if you do not say otherwise.
The linking is done against lib<dllname>.so.

Re: Create DLL with .a linking library

Posted: Fri Jul 02, 2010 10:50 am
by evstevemd
Thanks Josee,
I wonder why always things in M$ are complicated :shock:

Re: Create DLL with .a linking library

Posted: Fri Jul 02, 2010 11:58 am
by frank_frl
evstevemd wrote:Thanks Josee,
I wonder why always things in M$ are complicated :shock:
This is my experience for years with MS, seems to be their philosophy.
'Why make things easy when we can make them so nice complicated' ;)

Frank

Re: Create DLL with .a linking library

Posted: Fri Jul 02, 2010 3:56 pm
by evstevemd
That's cool!