#33 minidlna port on Windows w/Cygwin


This is a port minidlna on Windows using Cygwin.

detail is described in "How to port minidlna to Windows.txt"



<< < 1 2 (Page 2 of 2)
  • Patrick Cartwright

    I have compiled from source, but the inotify event does not seem to be working on soft links. I first tried to compile in Cygwin x64 which was missing dependencies. I then compiled using 32 bit with the old dependencies with static libraries and minidlna works fine except for the database does not remove files when they are deleted or added. I recompiled from clean source and will be testing tonight.

    Last edit: Patrick Cartwright 2014-03-12
  • HMA

    HMA - 2014-03-14

    CCLD minidlnad.exe
    /usr/lib/gcc/i686-pc-cygwin/4.8.2/../../../../i686-pc-cygwin/bin/ld: cannot find -lFLAC
    /usr/lib/gcc/i686-pc-cygwin/4.8.2/../../../../i686-pc-cygwin/bin/ld: cannot find -lvorbis
    /usr/lib/gcc/i686-pc-cygwin/4.8.2/../../../../i686-pc-cygwin/bin/ld: cannot find -logg
    collect2: Fehler: ld gab 1 als Ende-Status zurück
    Makefile:480: recipe for target 'minidlnad.exe' failed
    make[2]: [minidlnad.exe] Error 1
    make[2]: Leaving directory '/home/mischoener/minidlna-1.1.1'
    Makefile:586: recipe for target 'all-recursive' failed
    [all-recursive] Error 1
    make[1]: Leaving directory '/home/mischoener/minidlna-1.1.1'
    Makefile:383: recipe for target 'all' failed
    make: *** [all] Error 2

    ... allways get this error ... can anybody explain what is wrong?

    • hiero

      hiero - 2014-03-15

      Try to install older version of libogg, libFLAC and libvorbis as folows:

      libogg 1.3.1-1
      libFLAC 1.3.0-1
      libvorbis 1.3.3-1

      Latest version of above libraries do not include static libraries.

  • Fred Lefévère-Laoide


    I'm trying to compile minidlan 1.1.1 on cygwin (1.7.29 64bits on Win 7 64).
    It compiles fine.
    But when run, all the socket() calls return -1 with an errno of 17 : File exists ...
    Any idea ?

    • hiero

      hiero - 2014-05-05

      It seems that linking and using "IP Helper API" of windows makes problem on Cygwin64.

      "IP Helper API" is used only for "Don't require a configured network interface to start up, and add network interface monitoring support" functionality.

      Workaround is as follows.

      1. Not to link "IP Helper API":
        comment out LIBS="$LIBS -lws2_32 -liphlpapi" in configure.ac.

      2. Not to use "IP Helper API":
        replace "#elif defined(CYGWIN)" with "#elif defined(CYGWIN) && !defined(__x86_64)" in getifaddr.c.

      There are two above lines.

      Anyway I think it is easier to use 32 bit version of Cygwin.

  • Jenks Crayton

    Jenks Crayton - 2014-06-10

    After the latest Cygwin update I had to back off three libraries to these versions:

    sqlite3 3.7.17-4
    flac 1.2.1-2
    libvorbis 1.3.3-1

    Last edit: Jenks Crayton 2014-06-12
  • hiero

    hiero - 2014-07-05

    minidlna(1.1.3) port on Windows w/Cygwin

    add "--disable-static" option to configure
    add workaround for cygwin64 ("Don't require a configured network interface to start up, and add network interface monitoring support" is not supported)

    building missing static libraries is described in "How to build on Cygwin -1.1.3.txt"


  • nymous

    nymous - 2014-08-10

    First of all, thanks for your great work, I had no problems compiling and running the port.

    But it has a bug serving external subtitles to Samsung and LG players.
    The problem is withing the following block in upnphttp.c, near line 1926.

        if( h->reqflags & FLAG_CAPTION )
            if( sql_get_int_field(db, "SELECT ID from CAPTIONS where ID = '%lld'", id) > 0 )
                strcatf(&str, "CaptionInfo.sec: http://%s:%d/Captions/%lld.srt\r\n",
                              lan_addr[h->iface].str, runtime_vars.port, id);

    This code is running after process fork and seems to unable to connect to database to run: it writes to logs "SQL logic error or missing database". So, code won't send correct headers and TV won't see any external subtitles. Not sure if it works in vanila minidlna on linux.
    This can be easily fixed by checking database before forking.

    Last edit: nymous 2014-08-10
    • hiero

      hiero - 2014-08-12

      It seems inherited database handle does not work in child process.
      This might be bug or restriction of cygwin, because this issue does not occur on other OSs.

      Following workaround works.

      if( h->reqflags & FLAG_CAPTION )
              char path[PATH_MAX];
              snprintf(path, sizeof(path), "%s/files.db", db_path);
              if (sqlite3_open_v2(path, &db, SQLITE_OPEN_READONLY, NULL) != SQLITE_OK)
                  DPRINTF(E_DEBUG, L_HTTP, "Failed to open sqlite database!\n");
              if( sql_get_int_field(db, "SELECT ID from CAPTIONS where ID = '%lld'", (long long)id) > 0 )
                  strcatf(&str, "CaptionInfo.sec: http://%s:%d/Captions/%lld.srt\r\n",
                                lan_addr[h->iface].str, runtime_vars.port, (long long)id);
  • nymous

    nymous - 2014-08-15

    I've fixed it without reopening database. Just run the query before fork and save it's returning value for later check.

  • hiero

    hiero - 2014-09-07

    minidlna(1.1.4) port on Windows w/Cygwin


    • nymous

      nymous - 2015-04-06

      The following piece should be outside if, or subtitles support is broken on Samsung TVs.

      +#ifdef __CYGWIN__
      +       if( h->reqflags & FLAG_CAPTION )
      +           last_file.caption_exist = sql_get_int_field(db, "SELECT ID from CAPTIONS where ID = '%lld'", (long long)id);
      +#endif  // __CYGWIN__

      Move it 1 line down, just before #if USE_FORK

      Last edit: nymous 2015-04-06
  • Andrey Skvortsov

    Here is the build guys 1.1.4. Enjoy!

  • hiero

    hiero - 2015-04-19

    minidlna(1.1.4) port on Windows w/Cygwin

    - fixed compile error on latest cygwin32
    - fixed subtitle issue on Samsung TVs (thanks to nymous)
    - build-static-libraries-for-minidlna.sh for latest cygwin libraries


  • nymous

    nymous - 2016-05-24

    Hello folks.
    I've updated patch to 1.1.5. I've made it compatible with cygport infrastructure. I don't have a script to build all prereqs this time (sorry, no time to make it). But hiero's manual for 1.1.4 should work too.

    To actually build the port, after you have installed prerequisites and compiled ffmpeg, installed cygport utility, extract the archive to your /usr/src/ directory, go there and execute:

    cygport minidlna.cygport fetch prep compile install package

    This would fetch actual sources of minidlna, patch them, compile and package into mere cygwin package which you can reuse. It would be in dist subfolder.

    To act like a normal cygwin app, dynamic build with cygwin config locations (/etc/minidlna.conf) is built by default.

    To build hiero's like version, use minidlna_static_winprofile.cygport instead of minidlna.cygport.

    If you do not like windows logo icon, remove the corresponding patch from cygport file.
    To add another patches, simply place them in that folders and add them to the list in cygport file.

    - updated to 1.1.5
    - cygport script
    - dynamic build by default
    - proper client MAC addresses on status page

    Prerequisites build manual next time, sorry.

    Last edit: nymous 2016-05-24
  • nymous

    nymous - 2016-05-29

    Ok, here are build scripts for automatic build of minidlna and all dependencies.
    Build scripts tested with Cygwin 2.5.1(0.297/5/3) 2016-04-21 22:14 x86_64.
    Library versions at the time of writing:


    All you need is to install base Cygwin system, unpack the following archive to a folder and run one of the following scripts.
    - build.sh - Builds standard cygwin shared binary, which has many dll dependencies.
    - build_static.sh - Builds static versions of dependencies and static minidlna. The binary would need only cygwin1.dll from the base system.

    All dependencies are fetched and built automatically using apt-cyg and cygports.
    Everything is built in /usr/src/ folder, you might rebuild by yourself manually using cygports.

    If you want to build hiero's like build which uses %APPDATA% folder as default location for database and media cache, use winprofile cygport.

    Last edit: nymous 2016-05-29
<< < 1 2 (Page 2 of 2)

Log in to post a comment.