How to Combine .so and executable in one .so file - opencv

For my project, I am using openCV library api in my source code. SO I optimized the module of opencv library (I keep only required module ie: core,imgcodecs,imgproc,highgui,ml and videoio) and I combined these modules together and I created one .so file.Now I have one .so and one executable.
My question is how to combine this .so and executable and create one .so file.
Please help me on this. Thanks in advance.

Related

Two files with same name

I have two files in my project. One file is in a third-party Objective-C library and other is in my project.
Here DSGHappiness is a third-party library.
Q: How to solve this situation?

Create .dll with Visual Studio

I want to create my own .dll file with visual studio.
The problem is, that I have included Open CV inside my program, because I'm using a method from Open CV.
My question now is, is it possible to create my own .dll file although I'm using a Open CV library? Is the Open CV lib, included inside my own .dll than, or how does it work?
Thank and best wishes,
Andi!
I think you can do this in two ways:
Statically link OpenCV into your DLL
Run-time Dynamically link OpenCV from your DLL
The first one requires you to build OpenCV as a static library (output is a large .lib file, no .dll).
In your own DLL, you specify you want to link with opencv.lib.
The second one requires you to build OpenCV as a dynamic library (output is a small .lib file, and a big .dll).
In your own DLL, you would have to add code to manually load the OpenCV library and find the addresses of the functions you need to call from OpenCV (see https://msdn.microsoft.com/en-us/library/windows/desktop/ms685090%28v=vs.85%29.aspx)

how to view content of static library in Xcode?

Thank you in advance. I have a static library, say libpics.a. I want to see its contents, such as the code of that library. My static library has one .h file and one .a file, i can see content of .h file, there is only one method, but i can't see the content of .a file. After some search i can just find that, .a file contains the coding part of or implementation of .h file's method. I am new to iOS development, the code in that .a file, i want to extract it, and use it.
I tried searching about how to open static library, but most of time i got search related to how to create static library and how to use it etc. But i just want to open static library file and just want to see the code in it's implementation file.
I read something about nm and ar tool, but i don't understand that where to apply that code.
something like this
nm -C libschnoeck.a | less
or
ar -t libsamplerate.a
after installing command line tool, i wrote
ar -x phpFramework.a
code in terminal as per suggestion by Владимир Водолазкий. i got below lines..
ar: phpFramework.a is a fat file (use libtool(1) or lipo(1) and ar(1) on it)
ar: phpFramework.a: Inappropriate file type or format
You cannot see source code inside static library, just due to there are NO source codes there. Static Library in IOS like in any other Unix-like system contains set of compiled procedures/functions/methods.
Just take a close look to the Xcode log when ordinary project is building. You can find that first, *.m files are compiled into *.o format - it is actually binary format (which is different when source file is compiled for use in Simulator or on native device). Then these *.o files are linked into application. (Please do not blame me for this simplistic explanation %-))
In fact static library is just a set of such precompiled *.o files. It is shipped by developer/owner to save your time on compilation or/and protect source code from modification. So you can only use it with the help of external calls, which are documented in .h files or you can extract separate modules (.o) from there and link it into your application "manually".
The code used to create the library is compiled into object files that are linked into the .a file. The .a file does not contain code and you can't get readable code from the .a file.
However to use the library you do not need the code, just include the library in your Xcode project as per the Xcode documentation and #import the headers into your code so that the compiler knows what is in the libraries.
During the link phase of your project the linker will look at the object code generated from your code and the find unresolved symbols which it will then look for in the library and only pull in the objects from the library that are needed. (One benefit of static over dynamic libraries)
nm will list the symbols that have been defined in the library and which your code can call.

Difference between Xcode's file adding options

I was just working with a sample project that uses Tesseract OCR library. I followed compiling and building the library as it was mentioned in the link. There the author mentioned precisely to add files one by creating groups and other by creating references. At times we need to carefully check these values or else you will fail to compile. What is actually going on? I just want to know the reasons behind choosing each particular option?
Thanks in advance
If you choose Create groups the files will actually be located in one folder, but in Xcode they will appear grouped the way you had them in the folders.
If you choose Create folder Xcode will create folders in your project directory and the structure will be like the structure of the imported folder/folders.

import existing source code as referenced library in eclipse

I have some source codes from a friend that I would like to use as referenced library in my BlackBerry project. I'm not sure about how to package the source codes into a .jar file. I tried exporting the source to a JAR file and import it as external JAR in my project, it's giving me missing stack map error. I tried to preverify the .jar file generated from the source using the provided preverification tool from BlackBerry JDE, it didn't give me any output folder.
In fact, I'm not sure if the way I export the source is correct. Can anyone provide step-by-step instructions on how to package existing source code into a valid JAR file that can be imported into my project as a referenced library?
Again, I'm using eclipse.
I fought with this issue for months...
I have two solutions for you:
A-If you plan on having this library in more than one Application:
I posted my solution at the bottom of my original question: Blackberry Apps - Importing a code-signed jar into an application project
The basic solution was to build the library as a cldc project (plus some other magic), not as a library project. I actually had to open a case with RIM support to figure this out, it was a hot mess... Our case was complicated in that more than one application would have a copy of our "Library" and our library had to be signed. Which caused weird issues when two ALX files (from two different apps) both had the same signed library file.
The nice thing about this solution is that adding the library to the Application doesn't force you to have multiple COD files.
B - If your Jar is only going to be in one Application:
Then you should follow these instructions: http://supportforums.blackberry.com/t5/Java-Development/Eclipse-1-1-can-I-add-external-3-d-party-JAR-library/m-p/486787#M98033

Resources