Loading DLL on OSX - visual-studio

A repository has a C project in Visual Studio. The project is going to run on a mobile device. I am on OSX and would like to compile and contribute to the project. (Assume parallels is not an options, that I do not have a Windows license or a Visual Studio license) Just downloading the C files would be enough except they are also using DLL which are also windows only.
Is there any way I can reconstruct this in an OSX compiler so I can build the files?

It looks like you need a cross-compiler that produces a Windows binary on Mac OS X.
Have a look at the MinGW compilers for Mac OS X available here. You won't be able to use the existing Visual Studio project but MinGW should be sufficient to compile the C files and link to the provided DLLs.

You can download and install Wine using MacPorts or you can just use WineSkin which is a GUI Wrapper for Wine on MacOS X. Go and grab Visual Studio 2010 Express Edition ISO image and install the application on Wine. Then you can open the VS project and try compiling it.

Based on your comments I think you need to run Windows DLLs on OSX without using a Windows VM. Assuming that you can't recompile the DLLs to target OSX, I think that your only realistic solution is to use Wine.

Related

how to run a windows application developed using Visual Studio 2010 in MAC?

A windows applicatio is developed in Visual Studio 2010 and teh database used was MS Access. Can i run it directly in MAC. i.e. using the EXE or do i have to do some setting or is it not possible at all.
You cannot run windows application directly in MAC OS at all! But there is such a enviropment like - mono, which allows to compile the C# and .NET platform solutions for other OS. Feel free to use google with query - Mono develop.
From my experience - Mono isn't stable and didn't work as fine as Visual studio.
No you can not.
EXE is a windows executable file format and thus don't work on OS X, linux or any other Unix based OS. As mentioned you can use parallels wich cost money. There is a free alternative called VirtualBox. This does not provide the same features, but you have to decide for yourself.
https://www.virtualbox.org/wiki/Downloads
http://www.parallels.com/eu/
Here is a guide to how you set up VirtualBox on your MAC -> http://www.makeuseof.com/tag/virtualbox-running-windows-on-a-mac-for-free-sort-of/

Installing Qt4 on Windows - do I need to fully install MinGW or just have local copies

That is, can I get away with DLLs in the install directory or does the installer need to ensure that MingW is fully installed?
If you install the Qt SDK, it will actually install its own MinGW tree.
This does not directly answer your question, but generally speaking, to ensure I have all the right dependencies when creating an installer, I do the following:
Use Depends, a Microsoft tool that shows what DLLs a Windows executable (.exe or another .dll) depends on. This will not show dynamically loaded DLLs though, such as QT plugins. I believe Depends is part of the Platform SDK (it used to be, anyway), which you should be able to download. See here for example.
Use a virtualization tool (like VirtualBox or VMWare) to install a fresh copy of Windows and your application. If it complains of missing DLLs on startup, you missed something in the install package.
You should be aware of any dependencies on the Visual C++ run-time. There are many different versions out there, and if your app depends on them, you need to install the correct version to the Windows\WinSxS directory. Microsoft provides a redistributable for each version of Visual C++ (including the express edition, which you can get for free). I only mention this because I noticed when installing Qt SDK that the VC++ redistributable was getting installed, so the Qt DLLs may have a dependency on the VC++ run-time.

Is it possible to run applications compiled by Visual Studio 2008 on Linux?

Is it possible to run applications compiled by Visual Studio 2008 on Linux? Is there plugin that can convert my project exe to a Linux runnable file?
As far as I know, there is no software that allows Visual Studio to generate non-Windows executables.
If it's a native executable (not .NET) you can try running it under WINE and see if that works. If it doesn't I'd guess the options are either to make it work with WINE or see if you can build it as a native Linux application. The latter will be rather painful if it's a GUI application, obviously, and I'd question if it is worth it. Porting a command line app might be doable but don't underestimate the work involved.
if you use dot net there is a MONO library that enables running some dot net application on linux.
but it not fully compatible.
Otherwise you can do it, (maybe using silverlite you would...)
Mono Project

Is it possible to compile Windows binaries on a Linux machine?

At my work, all of the project data resides on an NFS that is accessible from both Linux and Windows machines (using Samba). All of the work is done on Linux, but I'm toying with the idea of compiling some of tools for Windows so that I can debug with Visual Studio.
I already have a nice makefile that can build the code for both 32-bit or 64-bit Linux using different targets. Assuming I have Windows versions of all the external libraries somewhere on the NFS, and assuming the code is clean enough to compile under Windows, is it possible to compile and link my program for Windows using the existing makefile, on Linux? Ideally I'd like to call the makefile once and have it build all three of 32-bit Linux, 64-bit Linux and Windows.
An added plus would be the option to compile it with any Visual Studio metadata to make it easy to debug.
Yes, you can achieve that with MinGW for example.
However, you will probably have to adapt one or two options in your makefile.
There are a number of possibilities I can think of:
You might try running Visual Studio under Wine. If Visual Studio does not run, you may still be able to run the command-line tools.
Run a full installation of Windows in a Virtual Machine. I have done this with Linux on Windows, but not the other way around, but I am certain that it is possible.
Use VNC to access a separate Windows PC from the Linux PC
Use a cross-build of GCC instead of Visual Studio
You need a cross-compilation package. You can also use the Wine lib.

What is the best way to build open source libraries DLLs for Windows developers to use?

I have several C free software/open source libraries that I develop on Linux and OSX with the GNU toolchain (automake, conf, flex, bison, gcc, ...) but I occasionally get requests to provide Windows DLLs. I'd like to be able to provide those without having to spend a lot of time and money with Windows Visual Studio development. I do have a Windows XP virtual machine available and I also know the software is portable as occasionally I get patches to make it build in on windows.
What approaches or tools should I be using? Cross compiling on Linux? using Visual Studio Express or something else? I would prefer something that is fully automated from a SVN repository. I do not count cygwin as a solution since that does not seem to provide what Windows developers need, as far I understand the issues - linking and DLLs.
You can try Mingw with MSYS, Visual Studio (Express) with SUA (subsystem for unix application) or Cygwin to compile programs that are automake/autoconf based (./configure && make to build under linux).
Unfortunately usually the lib file they create is not compatible with other compilers, so if you want your library to work with an application that is developed using Visual Studio, then you should use the VSC++ approach. Usually a lot of GNU projects (check gnuwin32) actually have VC compatible build scripts too, than can be compiled using "nmake"
You could use MinGW or install the MSVC command line tools from Visual Studio Express.
Either of those can be driven by command line scripts.
I imagine a cross compile from Linux would also work, but I have no idea how easy (or painful) that might be to get going.
This short article shows a simple cross compile of a Windows application & running that app under Wine:
http://www.linuxjournal.com/node/1005753
The Windows Software Development Kit includes Microsoft's C/C++ compiler (command line only with no visual tools), so you don't even need Visual C++ Express Edition. The Windows SDK is a free download from Microsoft.
If you're using http://www.cmake.org/, cmake can create the Makefile (for Unix) and project file (for Visual Studio). This is what for example the KDE project is using.
Visual Studio's compiler can be started from a Windows command line with 'devenv /build debug project.csproj' on the cmake generated file. This does however require a Windows (possibly in a VM) with a (potentialy free) Visual Studio installed.

Resources