Mono and MongoDB on Raspbian - linux

I've written and tested a c# application in visual studio.
..but now need to cross compile it with Mono on a Raspberry PI (set up as a headless server).
I'm having trouble with the MongoDB Driver -- it's not available as default in the build.
I'm including this .. which works fine on windows
using MongoDB.Bson;
using MongoDB.Driver;
But in Linux on the RasPi This is the error:
error CS0246: The type or namespace name `MongoDB' could not be
found. Are you missing an assembly reference?
Can I install the MongodB driver using apt-get?
or .. this repo should help me... If I can compile it..
https://github.com/mongodb/mongo-csharp-driver
how do I go about doing that? clone the repo and run the build.sh ?
Once I do that is this the command that will include it in my build?
Something like: "mcs pkg:mongodb.pkg myapp.cs"
Any advice would be appreciated

The mono documentation talks about how to include packages, towards the bottom of the page. From what I can tell you need something like mcs -pkg:mongodb myapp.cs.

Related

How to Cross Compile Alsa library for Windows Eclipse

I would like to know how could it be possible to cross compile the Alsa library in Windows for my linux host.
I am using an iMX8X with a Linux image, made by Yocto, and I need to implement the Alsa library in my Eclipse to be able to use the functions it gives. I have tried to,
CC=aarch64-linux-gnu-gcc(in my case) ./configure host=arm-linux
It goes by properly but when I do make with cygwin it fails and I cannot figure it out.
Anyone know how to approach the cross-compilation of a library for Windows Eclipse?
Thanks in advance!
There is no point on compiling Alsa on Windows, this library works with Linux Core in order to work. There is no actual way, for what I found, to compile it on Windows. Best approach has been to make a Virtual Box machine with Ubuntu 20.04, install Eclipse and compile and add Alsa library in the Ubuntu machine. For more information, just ask me about it, glad to help.

Where to get Bluetooth/Bluetooth.h for Raspberry Pi?

This is a stupid question. But I cannot find a solution to it. I am trying to build a BLE application with reference to this tutorial https://people.csail.mit.edu/albert/bluez-intro/c404.html. I am cross-compiling for Raspberry Pi3 from my Windows pc wsl. I have downloaded the toolchain from https://github.com/raspberrypi/tools. And I have verified the toolchain by compiling a simple HelloWorld application and ran it from RaspberryPi. Now when I try to compile the above code I am getting the error
/mnt/c/Study/RaspberryPi/main.c:5:33: fatal error: bluetooth/bluetooth.h: No such file or directory
#include <bluetooth/bluetooth.h>
I understand that Bluetooth.h is not my system. My question is where can I get it? So that I can cross-compile from windows. Do I have to download sdk for it? if needed where can I get it?
I found the answer from another forum. I am sharing the link here so that it can be useful if anyone has the same question.
https://raspberrypi.stackexchange.com/a/119201/115617

Building Node.js Binary with `pkg` for ARMv7 / Ubuntu 14 fails when running output with libstdc++.so.6 Error

Cross compile? I have a device my company still manufacturers and deploys world-wide, running Ubuntu 14.04.3 ... on an ARMv7 Processor. I have a node app I'm creating for the product family, and I'd like to run it on this device as well. Tried going the whole nvm route to install-and-run node directly on it, but gyphy fails to build some deps from the project locally on the device. I'd really much rather use pkg to build a binary to deploy to the device.
If you aren't familiar, pkg is: https://www.npmjs.com/package/pkg
However, building the examples/express example from the pkg repo with pkg 4.4.9 like pkg . --targets node10.15.3-linux-armv7 --no-bytecode (on a linux box) and scp'ing the resulting binary over to the IOT device running the armv7 / Ubuntu 14 setup, I get the following error when trying to run the binary:
./express-example: relocation error: ./express-example: symbol
_ZTVNSt7__cxx1115basic_stringbufIcSt11char_traitsIcESaIcEEE,
version GLIBCXX_3.4.21 not defined in file libstdc++.so.6 with link time reference
(Line wraps added to break long line)
Googling the error (specifically with regards to GLIBC and libstdc++.so.6) has gotten me nowhere. I can't figure out if the libstdc++ on the device is too old or too new. Tried updating libstdc++ but it said it was already at the latest version (for that OS.) I've got no clue where to go from here... Is there some way to compile the binary via pkg with different options, or statically link the libraries it needs instead of relying on system libraries?
Also, when I try to use a newer node version (like 10.21.0, etc) - it fails with an "unable to build" message. I know I can crosscompile regular C/C++ code on that linux box for ARM (we do that currently with Jenkins in the cloud on a linux box), so is there a way to get crosscompile working at buildtime?
Here's the error for building with 10.21:
[root#decidr ~/devel/pkg/examples/express]# ./node_modules/.bin/pkg . --targets node10-linux-armv7 --no-bytecode
> pkg#4.4.9
> Fetching base Node.js binaries to PKG_CACHE_PATH
fetched-v10.21.0-linux-armv7 [ ] 0%
> Error! 404 Not Found
https://github.com/zeit/pkg-fetch/releases/download/v2.6/uploaded-v2.6-node-v10.21.0-linux-armv7
> Asset not found by direct link:
{"tag":"v2.6","name":"uploaded-v2.6-node-v10.21.0-linux-armv7"}
> Not found in GitHub releases:
{"tag":"v2.6","name":"uploaded-v2.6-node-v10.21.0-linux-armv7"}
> Building base binary from source:
built-v10.21.0-linux-armv7
> Error! Not able to build for 'armv7' here, only for 'x64'
I find myself rather stuck - can't run node directly on the device, and the device won't run the pkg-built binary, even though it builds ARMv7 code. No idea how to proceed forward - any assistance or ideas? :)

Unable to find msbuild after building Mono 6.10 on linux

Yeah there's a need for me to build MS project on Linux.
I've download Mono from their offical website and built on Ubuntu 16. But when I want to use msbuild ,I found this tool didn't exist.
After my "make && make install", the folder of msbuild in Mono is:
hololqq#hololqq-virtual-machine:/opt/mono/lib/mono/msbuild$ ls
Current
Compare to the Mono installed by using apt-get , the folder should be:
hololqq#hololqq-virtual-machine:/usr/lib/mono/msbuild$ ls
15.0 Current
It's strange because the document : https://www.mono-project.com/docs/about-mono/releases/6.10.0/ has said that they just update msbuild:
19662 - [2019-12] Bump msbuild to track mono-2019-12
So I'm confused with this situation. Is anything else I forget while building? Or just the source codes of Mono didn't contain msbuild? Appericiate for your any suggestion.
PS:I have used monodevelop and xbuild. And monodevelop isn't easy to build from source code, and xbuild has some bugs while compiling VS peojects.
Update:
Finally still has no useful way. I use xbuild instead(it has a bug that you need to run it twice, because the first build won't success).

VB.Net development in Ubuntu - Build error in Monodevelop

I want to start coding in VB.Net but I have a Linux machine ATM i don't want to switch to Windows.
I installed MonoDevelop on my Ubuntu 16.04 by following the steps from their page: http://www.monodevelop.com/download/linux/. Everything is fine until I try to run the program I get the following error:
/home/user/Projects/Project/Project/Project.vbproj: Error: Target named 'Build' not found in the project.
I searched around for a solution but didn't find any. Didn't mess with any of the settings just created the project and tried to compile. Is there anything extra i had to install/set maybe?
Thanks in advance!

Resources