how to enable Mono.Simd - mono

I'd like to use Simd in Mono, but the following code is highlighted as error in MonDevop
using Mono.Simd
I already installed the "Mono 2.8 for Windows", what else I need to install to enable Mono.Simd?
In this link
http://tirania.org/blog/archive/2008/Nov-03.html
It talk about the tarbal, but after download it an uncompress it (mono-Mono.Simd.Math-942e804), there are many cs file and no dll file.

Did you add the Mono.Simd.dll to the build? MonoDevelop correctly highlights the error because in the assemblies you're using there isn't any Mono.Simd namespace.
Mono.Simd.dll is included in recent Mono releases.
As for the other answer, Mono.Simd works on any operating system on x86 and amd64, not only on Linux.

Mono.Simd only works when you run your programs on Mono runtime, on a supported operating system. If I'm not mistaken, it's currenly restricted to 32 & 64 bit Linux. Even if you manage to compile it on Windows, you won't get any speed benefit from it.

MonoDevelop for Windows runs on the .Net runtime, while the Mono.Simd.dll that comes with Mono 2.8 is installed in Mono's GAC.
You will need to Add Reference in your project to the Mono.Simd.dll that came with Mono 2.8.
It should be roughly in:
C:\Program Files (x86)\Mono-2.8\lib\mono\2.0\Mono.Simd.dll.

Related

Mono: can my GTK-app be executed on Windows-64bit?

I have created an Application in Linux 64bit with MonoDevelop, GTK#2 as GTK2-Project.
I am able to make an executable, the platform-target is "AnyCPU" (I have removed Posix references and GetText()-support), but I have also tried "x64".
This executable can be executed on Linux 64bit (terminal: mono App.exe)
This executable can be executed on Windows 32bit (terminal: mono App.exe)
This executable CANNOT be run on Windows 64bit (terminal: mono App.exe)
brings error:
Unhandled Exception: System.DllNotFoundException: libglib-2.0-0.dll
I have installed the GTK+ for Windows Runtime Environment on both machines, Windows 32bit and Windows 64bit.
In fact I have found this DLL libglib-2.0-0.dll on the GTK/bin-path and also have copied it to my executable-folder, even though it is set in the PATH environment variable.
Anyway, I get the same error message, but only in Windows 64bit.
Do I have a chance of making my GTK app to be running with Windows 64bit?
Is there a different libglib-2.0-0.dll for Windows x64 and how can I obtain this?
It's certainly possible to run a Gtk# 2 application on 64-bit windows, but it requires a bit of work. It appears you've already obtained the necessary .Net assemblies, and the native Win64 Gtk+ DLLs that are needed, but you also need an additional set of 64-bit native "glue" DLLs. I have not yet found a good source for these in pre-compiled form in any of my searches, but it is possible to build them from the gtk-sharp source.

DLLNotFoundException - Unity3D Plugin

I'm getting a DLLNotFoundException in standalone builds on some windows machines, others work perfectly. Dll file is definitely in the plugins folder, copied it to the projectName_Data folder too but no difference.
Also attempted to add dll to streaming assets folder and set new path (Environment.SetEnvironmentVariable) as above but that didn't work either.
Using Unity 4.5.5 btw
Any help at all would be greatly appreciated!!!
What I found is that the error DllNotFoundException is, in some circumstances, very misleading. Unity is not to blame for this because when something goes wrong with dll loading, Unity simply doesn't have that dll in memory and tells you so.
As Keysosaurus says, Visual C++ Redistributable must be installed for your standalone version to work and in most cases this solves the trouble but there can be other reasons like third party dependencies.
In case you are using third party libraries then you must also copy all the needed DLLs or SOs to your executable's folder.
For example I am working with OpenNI 2 and when I build I immediately copy all files from C:\Program Files (x86)\OpenNI2\Redist folder to the folder that contains the .exe. Not doing this results in DllNotFoundException.
Also don't forget that DLLs (and SOs) must match the architecture you are targeting so if you are targeting x64 (64 bit) then your DLL must be x64 too and if you try to use a x86 (32 bit) DLL Unity will be confused and will not load that giving you the same error.
As a side note bear in mind that Unity 5 comes both in 32 and 64 bit versions. In order to run your game in Unity Editor, all third party libraries must be present in both x86 and x64 (in Unity's conventional folders) or at least the one that matches you Unity Editor's architecture.
I discovered that the problem was that players needed Visual C++ redistributable installed, which can be downloaded here:
https://www.microsoft.com/en-gb/download/details.aspx?id=40784

How to create Cygwin compatible library files from native Windows .dll and/or .lib files

I have downloaded both a .dll and a .lib file compatible for 32-bit Windows from libspotify. The project I am working on requires me to use other libraries that does not work on Windows, but compile and work using Cygwin. I therefore need a way to get the .dll and/or .lib file "converted" into a compatible Cygwin format. Is that possible?
The .dll file does not contain symbols, so the suggested method described in the bottom of the Cygwin doc did not work.
The other libraries that I have, generated the following files:
/usr/local/lib/{libname.la, libname.dll.a and sometimes libname.a}
/usr/local/bin/cyglibname.dll
Where libname is the name of the library correctly compiled and installed. How do I get these files from the native 32-bit Windows .dll and .lib files?
Update:
I tried to include the full path to the .dll file instead of using -l and -L as I am used to linking libraries, and I got the following message:
/usr/bin/ld: i386 architecture of input file `/usr/local/test/libspotify.dll' is
incompatible with i386:x86-64 output
It seems like the problem is the 32-bit vs 64-bit. Anyone know how to fix that?
Another update:
It worked by adding -m32 to CFLAGS and LDFLAGS. I now got a different error that I believe is irrelevant for the original question.
It seems like the problem is the 32-bit vs 64-bit. Anyone know how to fix that?
Yes; use 32 bit Cygwin for a project that depends on third party DLL's only available in 32 bit form. Do not use 64 bit Cygwin.
Cygwin and Cygwin-64 can be installed side by side, by the way. (And it's possible to share the same home folder between them, so you don't have to duplicate your .bashrc and whatnot.)
This is not a Cygwin problem. If you build a 64 bit executable with, say, Microsoft Visual Studio, it also will not load the 32 bit libspotify DLL.

Can Windows Store apps be compiled as x86 instead of AnyCPU?

I have some .NET code that I am looking into porting into being a Windows Store app.
This code does a few different things and one of the things it does has a dependency on being compiled as x86 instead of AnyCPU.
Is this going to be a problem? Can a Metro app be compiled as x86 and still be distributed on the Windows Store? Is being compiled as x86 going to stop it from being able to run in Windows RT? Would I have to come up with a version without this subset of functionality to run in Windows RT? If I can get the code into its own assembly can I just have the Windows RT version not use it? (so, the main executable is AnyCPU and this one assembly is x86).
Can a Metro app be compiled as x86 and still be distributed on the Windows Store?
Yes. However, it would only be installable for x86 installations.
Is being compiled as x86 going to stop it from being able to run in Windows RT?
Since Windows RT is designed to run only on ARM CPUs, compiling for x86 will stop it from being able to run on Windows RT.
Would I have to come up with a version without this subset of functionality to run in Windows RT? If I can get the code into its own assembly can I just have the Windows RT version not use it?
You could use conditional compilation symbols to include/exclude functionality as required in your code. https://stackoverflow.com/a/6587823/61385 shows an example of how to do this.
Just compile whatever libs you need and when you upload to app store just upload the one you want to. Check your apppackages folder and look for the .appxupload files.

How to compile Mono with vb.net support

I've downloaded latest source from mono project, compiled it and everything works (c# projects, mod_mono, xsp) except vb.net. Vbnc, mono's vb.net compiler does not exist after compiling mono from source.
This is on CentOS 5, on Ubuntu 10.04 I installed mono packages via apt-get and vb.net just works.
What am I missing, or how to get vb.net support?
Mono's VB.Net support is in a separate module.
Either download the 'mono-basic' tarball:
http://ftp.novell.com/pub/mono/sources-stable/
or get it directly from SVN:
http://anonsvn.mono-project.com/viewvc/trunk/mono-basic/
or you can simply copy over what you need from a working system, like vbnc.exe and Microsoft.VisualBasic.dll.
All information about VB.NET on Mono is available at http://www.mono-project.com/Language_BASIC
Precompiled VB.NET assemblies can just be run with Mono.
The Mono VB.NET compiler is called vbnc.
If you need further help, can you please specify what exactly doesn't work? Does the compiler executable not exist, will VB.NET programs not run, or are you referring to MonoDevelop support?
(If the latter, make sure you have the latest MonoDevelop...)