By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,954 Members | 1,248 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,954 IT Pros & Developers. It's quick & easy.

g++: Creating DLL from .a files

P: n/a
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
Share this Question
Share on Google+
4 Replies


P: n/a
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

P: n/a
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

P: n/a

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

P: n/a
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.