Where should I put a DLL that is cross-compiled from source? - c

I really want to use the libpostal library as part of my Java application via the jpostal binding. While I can work around the fact that jpostal uses Gradle instead of Maven, I'm not sure where to proceed after I've cross compiled a libpostal DLL using a Linux machine.
According the answer to this question, the process of installing a DLL on Windows is very convoluted.
If anyone has good idea as to where I can put the DLL so that my Java application using jpostal can find it, please tell me.
P.S: My Java application will run on a CentOS machine in production but for development, testing, and demoing I'm using my laptop and desktop which run Windows. Of course if I can't get libpostal to work on Windows, then I can always go the virtual machine route.

Related

Cross-compiling Azure IoT SDK for C

I have successfully managed to cross-compile the C Azure IoT SDK for a target device running embedded Linux. The instructions are here : https://github.com/Azure/azure-iot-sdk-c/blob/master/doc/SDK_cross_compile_example.md
The next step is to get a basic application using the SDK running on the target device.
How would one go about doing this? Where are the generated libraries etc. to copy to the sysroot of the target device.
There seems to be only support for Rasberry Pi and generating a new firmware image.
I would recommend that you use the -DCMAKE_INSTALL_PREFIX=[output path] when you generate your makefiles. Once you have run cmake and make you can then run make install which will copy the generated libraries to the location you chose. You do NOT want to install them into your host's library search path since (presumably) they are built for an incompatible architecture. Having done that the /lib directory will have the libraries that you need to use to build your application. These are static libraries (unless you chose otherwise) so they only need to be linked to your application. They do not need to be on the device. Obviously you will also need to cross compile your application.
There are a couple of things you need to look out for though. Your device will need to have the same version of OpenSSL and curl that you used when you built the SDK. These are dynamic libraries so your application would likely fail at run time if you don't take care of that since there would be a version mismatch.
There is another example of cross-compiling here: https://github.com/Azure/azure-iot-sdk-c/blob/master/doc/Docker_SDK_Cross_Compile.md. This version also builds the prerequisite libraries and has suggestions about how you might also cross compile your application. It uses a Docker container to do this but, even if you don't want to use Docker, it may still help you with your process.

Portable Linux environment for applications

Is there any application (maybe a VM) that run Linux compatible compiled programs (like a web service) on other platforms (like windows) like an native application?
for example executive a C coded web service that is compiled by that application like a native linux programming but with an extra layer.
I think it have to be an x86 VM like QEMU but that is so heavy and complicated.
my problem is that I coded an application in C for linux but not I want to run it on others platforms without rebuilding that or using Cygwin.
You could look into Docker. As far as I know, it is possible to run Docker images that were built on Linux on Windows.
I found an incomplete but best match solution to my problem:
flinix
I hope more contribution to this awesome project.
Softwares like wine have been made for linux to run Windows applications. You can try http://www.andlinux.org/ to run linux apps in Windows.
You can uses VirtualBox or VMWare and run a Linux VM or use Cygwin or MinGW (similar to cygwin). Maybe try with Babun which is really easy but I'm not sure this would run a linux app...

Use Azure IoT Plugin for C within Eclipse

Very new to C, Eclipse, and basically everything else I am trying to work with in this project. I have an Arduino Feather HUZZAH (ESP8266). I have flashed the firmware with the esp_iot_sdk and installed Eclipse on to machine through the unofficial Espressif Dev Kit in order to write the code for the board.
The code I wrote is working well but now I need to find a way to send the collected data to Azure's IoT Hub. I found this plugin for talking to the Azure IoT Hub but cannot figure out how in the world to get it installed using Eclipse.
Even if someone could show me how to get a simple POST request going in C, using a library or not, that would be awesome! Thanks for your help.
So you want to run azure-iot-sdk on ESP8266 with Tensilica Xtensa LX106 MCU.
The first thing you need to do is to port azure-iot-sdk C library to Xtensa platform, using the Espressif Dev Kit toolchain.
Normally, this is officially done by Microsoft. Unfortunately, Xtensa LX106 might not be on the list(roadmap?) yet.
So I think you can do some porting work yourself, following some tutorials from Microsoft. This link works for Linux host, but given that fact that Xtensa toolchain only supports windows for now, you might end up writing some cmd, bat or generic makefile/cmake file, in which you need to have the cross-compile toolchain(aka xtensa-lx106-elf-gcc) specified.
Hopefully, it's not complicated or cumbersome.
After you have done with this, you need some static or dynamic library assembly depending on your settings, the next step is to specify the library path in your eclipse project, and don't forget to include the azure-iot-sdk header folder to your project, as the snapshot shows.
You should be good to go after the above steps.

Auto packgaing for applications in linux

It's my first time to try to get a distributed version of an application, I have a simple C application that uses GTK3 lib , when i compile this application and try to run the executable file on another Linux system that hasn't GTK lib installed of course it doesn't work !!
Is there a known and easy packaging method to get an executable file that works fine when distributed ?
Or i need to make my application installs needed libs to work and if so what is the best way to do this too ?
Note: i don't need a cross platform solution, i just want to run the application on another Linux system that hasn't GTK lib installed
In short: either you build in static or you do a package with the required dependencies.
The second solution is what I would recommend. You don't need to depend on the development files but only the library. Have a look to the documentation of your distribution in order to understand how to build a package.

Extending PythonCE to Access gsm/camera/gps Easily from PythonCE

As it seems there is no scripting language for Windows mobile devices that gives access to phone (sms, mms, make a call, take photo). I wonder how complex it would be to make a Python library that would enable that (write something in C, compile, and import in PythonCE).
Question: Where shall start to understand how to compile a PythonCE module that will give additional functionality to Python on Windows mobile. Also, what is the required toolkit. Is it at all possible on Mac (Leopard)?
As the first step, you should try to create executable programs that invoke the functions you want. For example, to send SMS, it appears you need to call MailSwitchToAccount, passing "SMS", and so on - familiarize yourself with the C API on the platform.
To create executables, you need Visual Studio, and the Windows Mobile SDK. Those run on Windows. For cross-compilation, there is CeGCC (http://cegcc.sourceforge.net/docs/using.html), but using it probably makes things more complicated than using the Microsoft tools.
When you have executables that perform the functions you desire, creating Python extension modules out of them should be easy. Just follow the extending-and-embedding tutorials.
MSDN has plenty of samples for C++ development on Windows Mobile, and the SDK comes with several sample application. Unfortunately VS Express editions (the free ones) do not come with compilers for Smart Devices. The only free option is the older eMbedded Visual C++ (eVC), which is now something like 8 years old and not supported (though it can still create apps for devices at least up through CE 5.0).
just tried establishing an environment to get pythonce modules compiled (http://pythonce.sourceforge.net/Wikka/SConsBuild) but seems that I can only use 2003 PPC SDK and it has no recent functions available. Even when I followed all the steps in tutorial, sample spammodule.c does not compile :(
Is there any good tutorial I can utilize to startup C (C++) programming for Windows Mobile?
Also is it possible using free version of VisualStudio (Express version)?

Resources