sun jna library with support for arm 64 - jna

Where can I get a JNA library with support for ARM64? The com.sun.jna_4.jar includes the native libjnidispatch.so library for ARM, but not for ARM64.
I'm getting an exception saying:
UnsatisfiedLinkError: Native library
(com/sun/jna/linux-aarch64/libjnidispatch.so) not found in resource path.

Download the android-aarch64.aar file from below link,
https://github.com/java-native-access/jna/tree/master/lib/native
Unzip it, you will get libjnidispatch.so.
In your App jniLibs folder, create a folder /arm64-v8a and put the .so file there.
jniLibs/arm64-v8a/libjnidispatch.so

Related

How do I build native C source code to create a library for Unity, to be used for iOs Platform?

I want to import a library from native C source code to be used Unity, for iOs. I expect to require the .a binaries and the .h header (and any other file required if I'm missing any), but I cannot find any guide around about how to build it.
I tried to build the source code directly on Xcode, but I was not able to create a library from that. XCode accepts native C only with command line project, while I need a library.
Then I tried to run this CMake command on mac terminal:
cmake . -DCMAKE_SYSTEM_NAME=iOS "-DCMAKE_OSX_ARCHITECTURES=arm64;arm64e" -DCMAKE_OSX_DEPLOYMENT_TARGET=9.3 -DENET_STATIC=1 -DENET_LZ4=1 -GXcode
This creates an Xcode project, I build it for generic IOS but the code does not work on unity when I deploy it on the device.
A good place to start is the Bonjour example from the Unity Manual. This at least gives you a working iOS plugin as a starting point.
You include the files in your Unity project, and build for iOS. You will notice that the files under Plugins/iOS are automatically included in the generated Xcode project. They will only be compiled when you build/run your Xcode project.
Careful, an iOS plugin is not the same as a MacOS plugin. For a MacOS plugin, you will need to create the bundle and include this into your UnityProject. The DllImport decorator will also be different on your C# code. For iOS it is "__Internal", but for MacOS it is the name of the bundle.
If you are trying to interface with a third party library, you may need to manually modify the library search paths of your Xcode project to correctly locate your .a and .h files when building and linking.
As a side note, when including a third party .a binary, verify that it conforms to the iOS architecture requirements, otherwise your app may be rejected when submitting to the app-store.

How to package .json files for use in an ANE for iOS

I am creating an Adobe Native Extension (ANE) for use with iOS. The native code in the main .a library file used for the ANE depends on 3rd party frameworks which themselves depend on the definitions of JSON objects defined in several .json files. I can package the 3rd party frameworks with the ANE just fine - it's the .json files that I'm having difficulties with.
I've tried packaging the .json files into the main .a library file, although I don't know if I did it the right way.
Please help.
You should try to package the files into the ANE rather than the library file. Try putting them in the same directory as the library (a) file when you're creating your ANE.

Can a set of .c files be compiled into a library for Xamarin import?

I am writing a mono touch application on Xamarin platform.
The Google Speech to Text API is implemented for iOS in this library.
For me, a .net/Xamarin dev(noob) this is just a set of .c files and the list of dependencies in README (those dependencies are .deb files).
How should I compile this in XCode into a Xamarin importable format? An answer in the form of:
Create new project in XCode.
Add .c files
Add .deb files
would be best. I just need a high level guidance.

How do I add this C library to my iOS Xcode 4 project?

I'm trying to add the openjpeg library to my XCode 4 project so that I can compress images taken by the iPhone's camera to jpeg2000.
I built the static library (libopenjpeg.a) using Cmake on OS/X. (I'm guessing this may have been the first error, that it needs to be built by XCode so it's built for iPhone architecture and not OS X).
I have the library added in the Link Binary with Libraries of my target.
The project builds successfully but I can't seem to import any of the headers from the library into any of my Objective-C classes. I've tried manually adding the folder that contains the libopenjpeg header files to the User Header Search Path but that did not seem to do anything.
Any suggestions?
for the simplest solution
Import the head files to you project's source.
You can still build it on the command-line with CMake, you'd just have to modify the CMakeLists.txt file so the right flags are passed when compiling.
However as Gavin indicates, it may be simpler just to drag the header and source files from the library into your Xcode project, and forego the building of a static library.

integrating cvblobslib in opencv

here I have just started my fyp and ints gona be in opencv.
I needed to vectorize the image and in order to do that I chose to use cvblobslib.
I downloaded it and it was build successfully but when I use it in my project there's a link error saying that "could not open cvblobslib.obj"
the exact string is pasted below
fatal error LNK1104: cannot open file 'E:\Faizan\myWork\moCap\blobslib\Debug\cvblobslib.obj'
of the solutions which I found on net and tried on my project are to remove any spaces in path, build in release mode rather than in debug mode, but problem was not solved.
the thing is that the stated file does not get built with other files when cvblobslib is built, i.e it is not there in the stated folder.
any body please give a solution
What exactly are you trying to use the cvblobslib for? I also tried using this with no luck. I found that openCV has a lot of the same capabilities. For example, you can use cvCountours to detect "blobs" and filter them by area.
(ps. i tried leaving this as a comment. do you need certain amount of rep to do that?)
cvBlobsLib has been developed using Microsoft Visual C++ (6.0) and can also be used in .NET. A Linux version could be downloaded here.
cvBlobsLib is distributed in a static library (.lib). To use it, it is requred that you build the .lib file and later use that lib file in the desired project. To build the .lib file, simply open the MSVC++ project and build it (debug or release version).
To build the project where the library is to be used follow this steps (MSVC++ 6.0):
In Project/Settings/C++/Preprocessor/Additional Include directories add the directory where the blob library is stored
In Project/Settings/Link/Input/Additional library path add the directory where the blob library is stored and in Object/Library modules add the cvblobslib.lib file
Include the file BlobResult.h where you want to use blob variables.
In Project/Settings/C++/Precompiled Headers select Not use precompiled headers
NOTE: Verify that in the project where the cvblobslib.lib is used, the MFC Runtime Libraries are not mixed:
Check in Project->Settings->C/C++->Code Generation->Use run-time library of your project and set it to
Debug Multithreaded DLL (debug version) or to Multithreaded DLL ( release version ).
Check in "Project->Settings->General" how it uses the MFC. It should be "Use MFC in a shared DLL".
NOTE: The library can be compiled and used in .NET using this steps, but the menu options may differ a little
NOTE 2: In the .NET version, the character sets must be equal in the .lib and in the project. [OpenCV yahoo group: Msg 35500]
NOTE 3: cvBlobsLib might give errors when building with OpenCV v2.2 onwards. Try commenting out this line in file BlobLibraryConfiguration.h:
#define _SHOW_ERRORS
NOTE 4: If you are using the new cv::Mat for your images instead of the old IplImage, you can easily convert between them, such as by following the OpenCV C++ Cheatsheet.

Resources