g++: Creating DLL from .a files

E

ernesto

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
 
A

Alan Johnson

ernesto said:
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
 
R

Rolf Magnus

ernesto said:
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?
 
E

ernesto

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.
 
D

Donovan Rebbechi

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,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top