I download a autotrace library to use in my java project but it contains only (libautotrace.a, libautotrace.la, libautotrace.dll.a and header)
my question: is it possible to convert libautotrace.dll.a to dll library?
You can not.
The dot-a files you have were compiled for a Unix system, and can not be directly converted to a Windows format.
You will need to find a windows-native build or the source code to build it yourself.
Related
Let's say I want to build a simple windows exe that does HTTP requests with curl.
( See example: https://github.com/JetBrains/kotlin-native/tree/master/samples/curl ).
The example above works, but in order for the exe to run, it needs to find libcurl-4.dll, either in the local dir, or e.g. in the installation dir ( e.g. C:\msys64\mingw64\lib ).
I would like to ship just the exe file, without having to provide the dll files separately. Is it possible to build the exe file with all the things it uses from the library (and transitive dependencies...) bundled into the exe file?
(This question is about if I can do this with a Kotlin 1.3.61 Native project, and how.)
I'm studying Kotlin too and it took many hours until I realize how to handle def file, includes and static library.
I made an example of how to use static library (curl with gzip and SSL support compiled with mingw) on kotlin-native. This way you dont need to dll files to be supplied with your app
https://github.com/carlosrafp/Libcurl-Kotlin-Native-standalone
On libcurl.def file you can see:
headers = curl/curl.h // path to curl header
libraryPaths = src/nativeInterop/cinterop // path to your static library
staticLibraries = libcurl.a // the static library
linkerOpts.mingw = -lws2_32 -lwldap32 // linking dependences
I based on the nice post of jonnyzzz:
https://jonnyzzz.com/blog/2018/10/29/kn-libcurl-windows/
You need to build the static libraries using mingw (libcurl, gzip) and msys2/mingw(openssl) to use with kotlin-native compiler
You can definitely do this for a static library(see this), but not for the .dll. About the shared library bundling, I would just recommend you to see this question. It's about the same but a bit generalized.
I want to use the ctfconvert and ctfmerge in CMake. I went through couple of links below.
https://java.net/projects/solaris/sources/on-src/content/usr/src/tools/scripts/nightly.sh
http://lethargy.org/~jesus/writes/mdb-ctf-dwarf-and-other-angelic-things/#.V-JUFPl97X4
The source in links states that we need to create object file of the source and then apply ctfmerge and ctfconvert over that. I came to know that there is a facility to create OBJECT library in CMake. But I am not getting how to apply these ctfconvert and ctfmerge on OBJECT libraries as $<"TARGET_OBJECTS:objlib> can only be used in add_library() or add_executable().
How to solve this issue?
We need to install onbld package on Solaris 11 or need to build Solaris 10 source code to get onbld package to install ctf binaries.
Then ultimately need to call ctf binaries in CMakeList.txt to run. We need to create a object file from ctfconvert binary and then need to use ctfmerge when we create an executable/shared library to merge the obhect file containing ctf header information to newly created executable/shared library.
If we need to create static library, we just need to use ctfconvert over the file to create the object file containing ctf header which will put those files in archive. When we use this static library in creation of executable/shared library, at that time, we need to use ctfmerge over each object file from static library.
i did a build in vb.net and got one exe file
however, when a user runs the file, it says it is missing one of the libraries (itextsharp).
so the question is, if there is actually a build option in vb.net, why does it not include the library in the same exe file?
You can distribute the iTextSharp DLL with your application. The easiest way to do this is to simply include it in the same folder as your EXE. The DLL should be output to your Project's Debug/Release folder each time you build assuming you've added it as a Reference in your project and the Reference's 'Copy Local' property is set to True.
If you want to distribute one EXE and include the iTextSharp in that, you can use the ILMerge tool (or alternately Gilma from SourceForge) after you build your EXE.
in the properties for the reference set the Copy To Output to Always
ITextSharp is not a library linked in your project output; it's an assembly referenced by your project output. And while VB.Net builds one executable from your source code, the CLR still needs all the referenced assemblies in the same folder as your executable.
To make everything work, you can distribute ITextSharp assemblies along with your app. Alternatively, if you indeed need only one file, you can use ILMerge on your project output and the assemblies you want included. However, you might need to determine all the correct assemblies you need merged. I wouldn't revommend using this tool, unless you understand how it works.
Note: If you want to use ILMerge with .Net v4.0, read this page.
Our application is distributed as a zip file, with a small bat/shell script that the user runs after extracting the archive to install the application. This zip file is currently created via mavens assembly plugin.
The zip file we distribute contains a lib folder with an executable jar, as well as all the files we need as part off the deployment off the actual application.
What we want is a self extracting zip-file that executes that contained bat file after the zip file has been extracted. And this should be created as a part off the build process.
I have read creating-a-self-extracting-zip-archive-on-a-linux-box, and can do that. But I don't see anywhere how to also execute a bat file within the extracted archive when it's done.
I have found winzip self-extractor, but I would prefer something that can be run on any platform. The build server and some developers use linux. I also found some VB code which leads me to believe that there might be some autorun properties on zip files.
Did you consider using IzPack (and the IzPack Maven Plugin) to generate a cross-platform installer?
The previous replier suggested lzpack, it's documentation contains the following pointer:
""The 7-Zip project (see http://www.7-zip.org/) provides a so-called SFX for installers, i.e., an image that can be use to create self-extracting Windows executables. Once its content has been extracted, such a self-extracting executable can launch an executable or a file. In the later case, it is assumed that there exists an association between a file extension and a software component.""
7-zip is cross platform, although I haven't tried whether you can build sfx files for windows on linux.
The 7zip manpage says you can do this.
EXAMPLE 2
7z a -sfx archive.exe dir1
add all files from directory "dir1" to SFX archive
archive.exe (Remark : SFX archive MUST end with
".exe")
While it's a bit late:
We just released a Maven plugin that can do this (docs at https://zephyr.sunshower.io/site/). It's free, open-source, and permissively licensed.
We bundle a JRE with our application using this plugin, then launch an IzPack installer with that JRE. It also supports code-signing, which we expect to have documented within the week.
I'm trying to use a open source library from a Windows application, and the only pre-built version I can find comes as a file called "lib.dll.a"
What format is this, and can I convert it to a normal dll file?
Naming the output file libjvm.dll.a will allow gcc to recognize it as a
library named jvm. The .dll.a suffix indicates (by convention) that it is
an import library, rather than a static library (which would simply be named
libjvm.a, again by convention).