Results 1 to 10 of 10

Thread: how to compile open source software to Windows executables using mingw64

  1. #1
    Join Date
    Aug 2011
    Location
    India
    Posts
    249

    Default how to compile open source software to Windows executables using mingw64

    Hi I am Rupesh from India. I have installed opensuse leap 42.2 and Windows 8. I have installed mingw64 packages like gcc on opensuse and Windows 8.

    I have some open source software like ffmpeg and lame which I want to compile and create Windows executables and dlls.

    I have tried to compile in Windows by running ./configure using mingw64 compiler but I got lot of errors like option -X not found for "/usr/bin/uname -X".

    I want to compile these open source software in opensuse. When I press something like X86 in terminal I am able to see file list containing X86_64mingw64_gcc etc.,.

    You may tell that just run ./configure from the root of source code folder but I have posted this content because when I run ./configure it will consider gcc version of linux not gcc version of mingw64.

    I think that software written using gcc is better to compile in Linux than Windows. I am trying to compile these software in Windows from the past two weeks but never succeeded.

    Please suggest how to cross compile to Windows executable. When I run ./configure from terminal can you suggest how to consider gcc version of mingw64.
    Regards,
    Rupesh.

  2. #2
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    11,254
    Blog Entries
    2

    Default Re: how to compile open source software to Windows executables using mingw64

    As a rule of thumb,
    Compiling and packaging should be done on the system of your packaging target.

    So, if you're creating packages that will be installed on Windows, you should be packaging on Windows.
    And, if you're creating packages that will be installed on Linux, then you should be packaging on Linux.
    Etc.

    If you're packaging for Windows on a Linux box, then you should be running a Windows environment on Linux... but that involves some risk that the package won't be built properly to run on Windows.

    An alternative is to package for Linux, but then run in a Linux environment on Windows... like Cygwin.

    Another alternative is to build your application on a cross-platform environment... Like Mono/.NET or Java.
    Or, another popular alternative nowadays is to write your app in a cross-platform language... Practically all scripting languages are cross-platform, you have choices to run in a browser which typically supports the same on any OS(like Javascript) or a scripting language which might require some additional installation like Python and NoeJS.

    HTH,
    TSU
    Beginner Wiki Quickstart - https://en.opensuse.org/User:Tsu2/Quickstart_Wiki
    Solved a problem recently? Create a wiki page for future personal reference!
    Learn something new?
    Attended a computing event?
    Post and Share!

  3. #3
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    11,254
    Blog Entries
    2

    Default Re: how to compile open source software to Windows executables using mingw64

    Quote Originally Posted by rupeshforu3 View Post

    You may tell that just run ./configure from the root of source code folder but I have posted this content because when I run ./configure it will consider gcc version of linux not gcc version of mingw64.

    .
    If you don't know how to configure to point to a speciic gcc,
    You can create an update-alternatives to switch your entire system temporarily between different gcc.

    I wrote the following which describes how to do this so you build will use the desired gcc
    https://en.opensuse.org/User:Tsu2/gc...e-alternatives

    Since gcc is only used when actually building, it's safe to do this as long as you switch back to the original gcc when you're done with your special task.

    TSU
    Beginner Wiki Quickstart - https://en.opensuse.org/User:Tsu2/Quickstart_Wiki
    Solved a problem recently? Create a wiki page for future personal reference!
    Learn something new?
    Attended a computing event?
    Post and Share!

  4. #4
    Join Date
    Aug 2011
    Location
    India
    Posts
    249

    Default Re: how to compile open source software to Windows executables using mingw64

    If it is not feasible to create Windows executables in Linux then please suggest how to install and configure cygwin or mingw64+msys2 in Windows 8.

    From the past two weeks I am trying to configure these but never succeeded.
    Regards,
    Rupesh.

  5. #5
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    25,114

    Default Re: how to compile open source software to Windows executables using mingw64

    Quote Originally Posted by rupeshforu3 View Post
    ... in Windows 8.
    I doubt these forums are the best place to ask something about Windows.

    Many people here know not much about Windows at all (except when the newspapers talk about viruses again).
    Henk van Velden

  6. #6
    Join Date
    Aug 2011
    Location
    India
    Posts
    249

    Default Re: how to compile open source software to Windows executables using mingw64

    Ok sorry for that can you suggest how to cross compile to Windows executables
    Regards,
    Rupesh.

  7. #7
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    26,796
    Blog Entries
    15

    Default Re: how to compile open source software to Windows executables using mingw64

    Quote Originally Posted by rupeshforu3 View Post
    Hi I am Rupesh from India. I have installed opensuse leap 42.2 and Windows 8. I have installed mingw64 packages like gcc on opensuse and Windows 8.

    I have some open source software like ffmpeg and lame which I want to compile and create Windows executables and dlls.

    I have tried to compile in Windows by running ./configure using mingw64 compiler but I got lot of errors like option -X not found for "/usr/bin/uname -X".

    I want to compile these open source software in opensuse. When I press something like X86 in terminal I am able to see file list containing X86_64mingw64_gcc etc.,.

    You may tell that just run ./configure from the root of source code folder but I have posted this content because when I run ./configure it will consider gcc version of linux not gcc version of mingw64.

    I think that software written using gcc is better to compile in Linux than Windows. I am trying to compile these software in Windows from the past two weeks but never succeeded.

    Please suggest how to cross compile to Windows executable. When I run ./configure from terminal can you suggest how to consider gcc version of mingw64.
    Hi
    For ffmpeg see https://trac.ffmpeg.org/wiki/Compila...lingForWindows

    It's all in the configure options... if you are never sure, always check with;
    Code:
    ./configure --help
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  8. #8
    Join Date
    Sep 2008
    Posts
    2,997

    Default Re: how to compile open source software to Windows executables using mingw64

    try this
    https://github.com/msys2/msys2/wiki/MSYS2-installation
    they have a 32 and 64bit builds of mingw and msys for windows
    there is a windows crosscompiler for leap here
    for making 64bit win binaries
    http://download.opensuse.org/reposit...USE_Leap_42.2/
    for 32bit
    http://download.opensuse.org/reposit...USE_Leap_42.2/

    but I think your best choice is using msys2 under windows

  9. #9
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    11,254
    Blog Entries
    2

    Default Re: how to compile open source software to Windows executables using mingw64

    A link in Malcolm's post suggests how to do what you want
    https://github.com/rdp/ffmpeg-windows-build-helpers

    Instructions at that link describe how to build on Linux, and should include openSUSE.
    If you decide to run on Windows instead, then you will need to install Cygwin, ie
    https://cygwin.com/install.html

    I haven't installed Cygwin for a very long time, IIRC I was unhappy how much longer things took to run.

    HTH,
    TSU
    Beginner Wiki Quickstart - https://en.opensuse.org/User:Tsu2/Quickstart_Wiki
    Solved a problem recently? Create a wiki page for future personal reference!
    Learn something new?
    Attended a computing event?
    Post and Share!

  10. #10
    Join Date
    Sep 2008
    Posts
    2,997

    Default Re: how to compile open source software to Windows executables using mingw64

    Quote Originally Posted by tsu2 View Post
    A link in Malcolm's post suggests how to do what you want
    https://github.com/rdp/ffmpeg-windows-build-helpers

    Instructions at that link describe how to build on Linux, and should include openSUSE.
    If you decide to run on Windows instead, then you will need to install Cygwin, ie
    https://cygwin.com/install.html

    I haven't installed Cygwin for a very long time, IIRC I was unhappy how much longer things took to run.

    HTH,
    TSU
    no need for cygwin unless you need some exotic features like running X on windows
    msys2 is all you need
    http://repo.msys2.org/distrib/msys2-x86_64-latest.exe
    I recently installed it and used it to rebuild a few tools
    just one thing msys2 is a minimal system and does not include gcc after installing msys2 you'd need to start the msys conslole update it and then pull mingw from it's repo's
    to get 64bit mingw
    Code:
    pacman -Syuu
    pacman -S mingw-w64-x86_64-toolchain
    for 32 bit you'd need the i686 packages

    Code:
    pacman -Syuu
    pacman -S mingw-w64-i686-toolchain
    they've ported pacman from arch as a package manager
    if you don't want the latest mingw or are uncomfortable with pacman as a package manager you can get a mingw bundle from xhmikosr (one of the mpc-hc devs)
    http://xhmikosr.1f0.de/tools/msys/
    he's got 2 builds of 2 gcc versions gcc 6.3 and 7.1

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •