Create DLL with .a linking library

General questions regarding the usage of CodeLite
evstevemd
CodeLite Guru
Posts: 350
Joined: Sun Nov 29, 2009 7:36 pm
Genuine User: Yes
IDE Question: C++
Contact:

Create DLL with .a linking library

Post 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?

CodeLite 15.x
CodeLite is awesome, I just Love it!

User avatar
eranif
CodeLite Plugin
Posts: 6372
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Create DLL with .a linking library

Post 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
Make sure you have read the HOW TO POST thread
evstevemd
CodeLite Guru
Posts: 350
Joined: Sun Nov 29, 2009 7:36 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Create DLL with .a linking library

Post by evstevemd »

Big thanks, Sir!

CodeLite 15.x
CodeLite is awesome, I just Love it!

evstevemd
CodeLite Guru
Posts: 350
Joined: Sun Nov 29, 2009 7:36 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Create DLL with .a linking library

Post by evstevemd »

What about Linux?
I mostly develop in Linux now days!
I am searching for dlltool alternative for Linux

CodeLite 15.x
CodeLite is awesome, I just Love it!

josee
CodeLite Enthusiast
Posts: 37
Joined: Fri Feb 05, 2010 10:57 am
Genuine User: Yes
IDE Question: C++
Contact:

Re: Create DLL with .a linking library

Post 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.
evstevemd
CodeLite Guru
Posts: 350
Joined: Sun Nov 29, 2009 7:36 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Create DLL with .a linking library

Post by evstevemd »

Thanks Josee,
I wonder why always things in M$ are complicated :shock:

CodeLite 15.x
CodeLite is awesome, I just Love it!

frank_frl
CodeLite Expert
Posts: 176
Joined: Sun Aug 17, 2008 2:45 pm
Contact:

Re: Create DLL with .a linking library

Post 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
evstevemd
CodeLite Guru
Posts: 350
Joined: Sun Nov 29, 2009 7:36 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Create DLL with .a linking library

Post by evstevemd »

That's cool!

CodeLite 15.x
CodeLite is awesome, I just Love it!

Post Reply