Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run cygwin built exe in windows without cygwin's environment

I'm trying to port a linux software in Windows. My software depends on gtk, boost and libgerbv (which I've manually compiled on cygwin) I've successfully compiled it and it works if I run it in the cygwin's terminal, but if I copy the .exe in a folder with cygwin1.dll and I run it, it terminates silently Same result if I run it within cmd.exe.
How can I "export" this executable outside the cygwin environment? I want to distribute it with just the needed shared libraries and cygwin1.dll

Thanks

like image 213
Corna Avatar asked Dec 28 '14 17:12

Corna


People also ask

How do I use Cygwin on Windows?

Go to http://cygwin.com and click on "Install Cygwin" in the left column. This will allow you to download a setup.exe file and choose "Install from Internet." Click "Next." Choose your settings. For most users, it is fine to leave the default installation directory, which is "c:\cygwin\ and the other default settings.

How do I add a environment variable in Cygwin?

From the Start menu, select Parameters > Control Panel > System. Select the Advanced tab and click Environment variables. Edit the PATH environment variable to add the Cygwin installation directory, for example c:\cygwin\bin; and click OK.


1 Answers

"How can I "export" this executable outside the cygwin environment?"

In short: That's not possible. You'll need to have a cygwin environment installed on the target machine, and run the programs created in cygwin from a cygwin shell.

Cygwin requires a number of it's own .dll files, to bind to the underlying Windows OS. These cannot be just copied to another windows system without having a complete installation of cygwin.

Here're some more details about this: What is the difference between Cygwin and MinGW?


That's why I prefer to use MinGW to target windows systems portably. Cygwin has it's powers and right to exist, when it comes to cross compile code for different (e.g. embedded) targets running on windows as host.

like image 162
πάντα ῥεῖ Avatar answered Nov 06 '22 07:11

πάντα ῥεῖ