468,734 Members | 2,363 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,734 developers. It's quick & easy.

g++: Creating DLL from .a files

Hi everybody:

I have a project with a lot of source files.
Every logical set of source files is compiled and archived in .a files
(using mingw toolchain):
* library.data.a
* library.ui.a
* library.service.a

Now, I want to create a library.dll file from my .a files; how can I do
that?

I have seen that I can create DLLs from .o files, but I did not see any
example about creating DLLs from .a

Thanks in advance

ernesto

Jul 23 '05 #1
4 2606
ernesto wrote:
Hi everybody:

I have a project with a lot of source files.
Every logical set of source files is compiled and archived in .a files
(using mingw toolchain):
* library.data.a
* library.ui.a
* library.service.a

Now, I want to create a library.dll file from my .a files; how can I do
that?

I have seen that I can create DLLs from .o files, but I did not see any
example about creating DLLs from .a

Thanks in advance

ernesto


Platform and implementation specific questions are off topic here.

That said, on most platforms static libraries can be linked to in the
same way as object files. Example :
g++ -o program_name file1.o file2.o library1.a library2.a

So if you already have your problem solved for object files, it
shouldn't be too hard to extend it to libraries.

-Alan
Jul 23 '05 #2
ernesto wrote:
Hi everybody:

I have a project with a lot of source files.
Every logical set of source files is compiled and archived in .a files
(using mingw toolchain):
* library.data.a
* library.ui.a
* library.service.a

Now, I want to create a library.dll file from my .a files; how can I do
that?

I have seen that I can create DLLs from .o files, but I did not see any
example about creating DLLs from .a


If you know how to do it with the .o files, why don't you just extract them
from the archive?

Jul 23 '05 #3

Rolf Magnus wrote:

If you know how to do it with the .o files, why don't you just extract
them
from the archive?
Hi:

I create several .a files with different Makefiles, now, I want to
combine them and create an only DLL file.

Jul 23 '05 #4
On 2005-06-25, ernesto <eb******@gmail.com> wrote:
Hi everybody:

I have a project with a lot of source files.
Every logical set of source files is compiled and archived in .a files
(using mingw toolchain):
* library.data.a
* library.ui.a
* library.service.a

Now, I want to create a library.dll file from my .a files; how can I do
that?

I have seen that I can create DLLs from .o files, but I did not see any
example about creating DLLs from .a

Thanks in advance


Just use the same compile line on the .a files. e.g.
g++ -shared -o libfoo.so x1.a x2.a ...

Cheers,
--
Donovan Rebbechi
http://pegasus.rutgers.edu/~elflord/
Jul 23 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Angelos Karantzalis | last post: by
2 posts views Thread by George Marsaglia | last post: by
9 posts views Thread by Maziar Aflatoun | last post: by
4 posts views Thread by mslyh | last post: by
12 posts views Thread by Mats Lycken | last post: by
15 posts views Thread by David Thielen | last post: by
1 post views Thread by Remote_User | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.