Menu

Compiling for Windows/dos

Help
Jay2
2006-07-07
2016-09-09
  • Jay2

    Jay2 - 2006-07-07

    Hi!

    I would desesperatly like to compile bbe under a windows 2000 environnement. Has anyone ever done so? Is there and easy way with djgpp?

    Thanks,
    Jerome Marchand

     
  • pif

    pif - 2015-10-15

    I had the same question today and solved it by compiling the code with mingw :
    from a cygwin console, with mingw64-i686-gcc-core package installed, I ran
    ./configure CC=/usr/bin/i686-w64-mingw32-gcc.exe
    Compilation works fine, and resulting exe is ok under Windows XP and Seven, but under Windows 2000, "r" commands do nothing.
    After some tests, it seems off_t type is weirdly defined thus in bbe.h line 52, I removed #ifdef and force define to be :

    #define off_t long int
    

    Seems enough at least for the small usage i'm concerned with.

     

    Last edit: pif 2015-10-15
  • Timo Savinen

    Timo Savinen - 2015-10-21

    Yes, it is a typo, I have probably ment something like:

    typedef long int off_t;

    Timo

     
  • Alexey Anisimov

    Alexey Anisimov - 2016-09-09

    Hi,

    I had it compiled on windows, with the help of http://www.mingw.org/
    I have to enable binary file mode explicitly, otherwise it stops on first 0x1A (EOF) character.
    In addition to bbe.h line 52 i've also changed:

    buffer.c

    1. line 56
      from out_stream.fd = open(file,O_WRONLY | O_CREAT | O_TRUNC,S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH);
      to out_stream.fd = open(file,O_WRONLY | O_CREAT | O_TRUNC | O_BINARY,S_IRUSR | S_IWUSR);
    2. line 100
      from new->fd = open(file,O_RDONLY);
      to new->fd = open(file,O_RDONLY | O_BINARY);

    execute.c

    1. line 420 from fseeko to fseeko64
    2. line 550 from c->fd = fopen(file,"w"); to c->fd = fopen(file,"wb");
    3. line 584 from c->fd = fopen(c->s1,"w"); to c->fd = fopen(c->s1,"wb");
    4. line 602 from c->fd = fopen(c->s1,"r"); to c->fd = fopen(c->s1,"rb");
    5. line 616 frim c->fd = fopen(c->s1,"r"); to c->fd = fopen(c->s1,"rb");

    then it compiles fine and works well. thanks!

     

    Last edit: Alexey Anisimov 2016-09-09

Log in to post a comment.

MongoDB Logo MongoDB