-
January 17th, 2019, 04:19 AM
#1
Library File Format questions.
I am happily and successfully running
Windows 10 64 bit Home Edition
TDM 64 bit C++ 5.2 compiler.
I have found that when it comes to libraries, sometimes the windows library file
(not the associated headers) are occasionally named *.a and *.lib.
As a TDM programmer, I have learned that both names and formats will work.
-On Windows, within 64 bit, what is the difference between the *.a format
and the *.lib format?
-If I am not able to use Visual Studio, or any Microsoft C++ compiler,
and cannot use MinGW, is there separate public domain program I can run
to successfully convert *.a files into *.lib files so that the library/ies
can continue to be linked and accessed to and will function just the same,
even with the old/original headers?
-
January 17th, 2019, 07:09 AM
#2
Re: Library File Format questions.
Both .a and .lib files are static libraries.
Usually on Windows you use .lib, while on Linux/Unix you use .a files.
This might be an interesting read: https://stackoverflow.com/questions/...-and-def-files
Why are you not able to use Visual Studio? There is a Visual Studio Community Edition which is free (for up to small teams) and which contains everything you need. It's not crippled like the older Express editions.
-
January 17th, 2019, 11:03 PM
#3
Re: Library File Format questions.
We don't use Visual Studio due to business and reliance reasons. The express version is only for community software,
as far as we see. In an employment and programming scenario, and a software product retail (whatsoever) the license
rules change, and so, legally, does the license price, as far as we see.
-Are there any appreciable differences, on Windows and within 64 bit, between *.lib and *.a files? What is the format difference?
-Without Visual Studio, and without MinGW only programs, is there a native Windows public domain utility the (other) people
can use to convert *.a files to *.lib files, so that they can be linked to and run, with the same headers, as before then?
-Can you build folders or directories into *.lib or *.a files?
-How can you use one header to tell between two different classes that have the same
name, variables and method signatures and return types, but have different internal implementations? Is this a situation
that can even happen, due to compiler restrictions?
Last edited by Zachary1234; January 17th, 2019 at 11:07 PM.
-
January 17th, 2019, 11:35 PM
#4
Re: Library File Format questions.
Originally Posted by Zachary1234
We don't use Visual Studio due to business and reliance reasons. The express version is only for community software,
as far as we see.
The express edition no longer exists. The Community edition replaces the express edition as Marc mentioned. The community edition is not for community software only. Read more: https://visualstudio.microsoft.com/vs/compare/
-
January 18th, 2019, 12:20 AM
#5
Re: Library File Format questions.
Well, fair enough I suppose. However the particulars of my other questions remain. Is someone else maybe able to answer them?
-
January 18th, 2019, 02:49 AM
#6
Re: Library File Format questions.
The question of converting .a to .lib has been asked a lot.
A quick search on Google reveals quite a few hits: https://www.google.com/search?client...ert+.a+to+.lib
I don't have the time to read those resources, but in my mind, I think it will be difficult to convert. When you are using static libraries, those static libraries should normally be build with the same compiler and compiler settings as the compiler and compiler settings you are using to build the application that wants to link with the static libraries. This is especially important if your static libraries are using C++ and not only C.
-
January 18th, 2019, 03:02 AM
#7
Re: Library File Format questions.
-What about the header/class linking question? Can you have subdirectories and classes in a .lib or .a file, on Windows?
-
January 18th, 2019, 03:15 AM
#8
Re: Library File Format questions.
I don't think you understand the concept of .lib and .a files.
These are compiled binaries. They consist of compiled functions, classes, and so on. They do not have some kind of "filesystem" in them with subdirectories and files.
Maybe this is an interesting read: https://docs.microsoft.com/en-us/cpp...p?view=vs-2017
Also, if you are talking about embedding resources (files, binary data, images, ...) in a static library .lib file, then that's not really possible. Such resources are added in .exe or .dll files, see also: https://stackoverflow.com/questions/...static-library
-
January 18th, 2019, 03:49 AM
#9
Re: Library File Format questions.
In C++, it is possible, with the correct assistance, to build your own .lib or .a files.
-Is it forbidden within those formats to submit directories to be included inside either
of those two formats, or not?
-
January 18th, 2019, 04:34 AM
#10
Re: Library File Format questions.
What exactly are you trying to achieve?
What is your use-case?
The format of Windows .lib files is explained here: https://docs.microsoft.com/en-us/win...ry-file-format
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|