473,385 Members | 1,736 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Creating DLL from .a files

9GB
How can I convert a static library ".a" file to a DLL file?
I am using it with JNI. Writing methods in java and implementing in C
and then converting it back to a DLL but i cant find out how to make
dlls in GCC.

Jul 8 '07 #1
6 3664
In article <11**********************@q75g2000hsh.googlegroups .com>,
9GB <pl*******@gmail.comwrote:
>I'm using MinGW version of GCC... your help would be really
appreciated.
Off topic. Not portable. Cant discuss it here. Blah, blah, blah.

Useful clc-related links:

http://en.wikipedia.org/wiki/Aspergers
http://en.wikipedia.org/wiki/Clique
http://en.wikipedia.org/wiki/C_programming_language

Jul 8 '07 #2
9GB wrote:
How can I convert a static library ".a" file to a DLL file?
I am using it with JNI. Writing methods in java and implementing in C
and then converting it back to a DLL but i cant find out how to make
dlls in GCC.
This is very easy

1) Extract all object files from the .a archive
2) use those files to build a dll.

You will have to add some files like an entry point
to build a dll but those can be empty.
Jul 8 '07 #3
9GB wrote:
I'm using MinGW version of GCC... your help would be really
appreciated.
It's off-topic here. Find a newsgroup for MinGW (Google Groups search
may help) or perhaps a forum or mailing list for that system.

Also:

Please don't top-post. Your replies belong following or interspersed
with properly trimmed quotes. See the majority of other posts in the
newsgroup, or:
<http://www.caliburn.nl/topposting.html>

Brian
Jul 8 '07 #4
On Sun, 08 Jul 2007 20:27:21 +0200, in comp.lang.c , jacob navia
<ja***@jacob.remcomp.frwrote:
>9GB wrote:
>How can I convert a static library ".a" file to a DLL file?

This is very easy

1) Extract all object files from the .a archive
2) use those files to build a dll.

You will have to add some files like an entry point
to build a dll but those can be empty.
I'm not sure whether this is a joke answer or not.

If you have a .a file from linux or unix, I doubt you can trivially
convert it into a Windows DLL by simply packaging the objects up with
some wrapper code. If you have a .a file from a windows compiler, why
not simply write a DLL in the first place? If you have a 3rd party
library in .a format you want to use as a DLL, then ask the 3rd party.
Either way, this is wildly offtopic here. Comp,unix.programmer for
the .a file format (possibly) and a windows group for the rest.

--
Mark McIntyre

"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan
Jul 8 '07 #5
In article <e8********************************@4ax.com>,
Mark McIntyre <ma**********@spamcop.netwrote:
>On Sun, 08 Jul 2007 20:27:21 +0200, in comp.lang.c , jacob navia
<ja***@jacob.remcomp.frwrote:
>>9GB wrote:
>>How can I convert a static library ".a" file to a DLL file?

This is very easy

1) Extract all object files from the .a archive
2) use those files to build a dll.

You will have to add some files like an entry point
to build a dll but those can be empty.

I'm not sure whether this is a joke answer or not.
It is not a joke (though it is of course wildly off-topic and for the
reasons often quoted here - which is that no one here can adequately
peer-review it, since they are all Unix bigots).

But here's the deal:
1) Since OP mentioned both .a files and DLLs, which are,
classically, creatures from different worlds, you have to
assume, as Jacob has done, that he (OP) is talking about
using a Unixy compiler in the Windows world. And, this
usually means either MinGW or Cygwin. Said Unixy compilers
end up speaking both the language of Unix (.a and .o files)
as well as the language of Windows (.EXEs and .DLLs).
2) Given the above, and, of course, assuming no access to source
(since that would make it trivial to simply re-compile from
scratch), the advice that Jacob gives is, modulo a detail
here or there (said details being, of course, in the dreaded
category known as "off topic"), correct.

Jul 8 '07 #6
On Jul 9, 10:31 am, Mark McIntyre <markmcint...@spamcop.netwrote:
<j...@jacob.remcomp.frwrote:
1) Extract all object files from the .a archive
2) use those files to build a dll.

If you have a .a file from linux or unix, I doubt
you can trivially convert it into a Windows DLL
However you can semi-trivially convert it if it
is a .a file from Windows. The specification of
..a files says nothing about which ABI is used
for the object files it contains. In fact, the
files in a .a do not even have to be object files.

(BTW, that has to be one of the most bizarre
sequences I've ever written: "it if it is a a")
If you have a .a file from a windows compiler, why
not simply write a DLL in the first place?
It might be source code that's designed to be used
on multiple platforms.
Jul 8 '07 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: dave | last post by:
I first started using HCW.exe to compile .rtf filew created with MS Word a couple of weeks ago. I used the file | new menu then selected New project in the dialog box and everything worked as...
0
by: Angelos Karantzalis | last post by:
Hi y'all, only recently, I've delved into creating installers with VS.NET. So far, I'd created a Deployment Solution, added a couple of Merge Modules to it & everything worked fine. Today, I...
4
by: ernesto | last post by:
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 *...
2
by: George Marsaglia | last post by:
I have a set of, say, 2000 points in the 8-dimensional simplex S={(x_1,x_2,...,x_8),x_1+x_2+...+x_8=1, x's>=0}. To help analyze that 8-dimensional set, I wish to project the set of points onto...
9
by: Maziar Aflatoun | last post by:
Hi everyone, I like to export some data from the database and allow my users to store this file to their harddrive as a .txt file. Does anyone know how I would go about doing that? (without...
4
by: mslyh | last post by:
Is there a way to instantiate a page object in code and redirect the response to it? I know that this is how the actual ASP.NET engine ultimately does it under the covers. However, is this available...
12
by: Mats Lycken | last post by:
Hi, I'm creating a CMS that I would like to be plug-in based with different plugins handling different kinds of content. What I really want is to be able to load/unload plugins on the fly without...
15
by: David Thielen | last post by:
Hi; My ASP.NET app (C# calling J# under .net 2.0) creates a png file in a subdirectory to display as part of the created page. However, the bitmap will not display due to a security violation. ...
1
by: Remote_User | last post by:
Hi All, .NET 1.1 doesn't support creating symbolic links to files, like in Linux? Can i use C# to make a file point to another file? Thanks.
5
by: Aryan | last post by:
Hi, I am using C# with framework 2.0 and creating PDF files on-fly, along with this I am using Windows 2003 Server. I am using Byte to take the data input and then save into pdf format on...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.