Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3601270
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T20:36:01+00:00 2026-05-18T20:36:01+00:00

I cannot get James Taylor’s excellent little seek-bzip2 to compile under Windows? It can

  • 0

I cannot get James Taylor’s excellent little “seek-bzip2” to compile under Windows? It can index a bzip2 archive and then use that index to provide random access to the individual blocks of the archive.

It’s written in C and requires 64 bit long longs and is available here: http://bitbucket.org/james_taylor/seek-bzip2

I am unable to get it to compile on any free Windows C compiler.

  • Borland doesn’t have some required header files.
  • lcc compiles it but it fails with “unexpected EOF” on any bzip2 file.
  • mingw will compile it if you remove the “-m64” flag but it will fail in the same way as lcc above.

The free compilers don’t seem to have very good debugging support and MS Visual Studio refuses to install on my removable hard drive and my netbook’s C and D drives lack sufficient space.


EDIT I’ve reworded this question since I was asking somebody to port it for me but I’m happy to try to port it myself. I just don’t know where to begin. I haven’t touched C since before 64-bit types became common.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T20:36:02+00:00Added an answer on May 18, 2026 at 8:36 pm

    By default stdin and stdout will work in text mode, translating 0A -> 0D 0A. You need to modify seek-bunzip’s main to _setmode stdin and stdout as binary before uncompressblock:

    int main( int argc, char *argv[] )
    {
        unsigned long pos = atol( argv[1] );
        int status;
        _setmode(0, _O_BINARY);
        _setmode(1, _O_BINARY);
        status = uncompressblock( 0, pos );
        if ( status )
            fprintf( stderr, "\n%s\n", bunzip_errors[-status] );
    }
    

    That does the trick for me with MSVC++10. You may need to lose leading underscores from _setmode and _O_BINARY on other compilers – I’m not sure. Other than that I needed to:

    • remove unistd.h includes
    • add includes:
      • micro-bunzip.h: sys/types.h
      • micro-bunzip.c: sys/types.h
      • seek-bunzip.c: sys/types.h, io.h, fnctl.h
    • forward-declare get_bits, read_bunzip and start_bunzip from micro-bunzip.c in micro-bunzip.h
    • change write and lseek to _write and _lseek (again might be MSVC only)

    Then it worked for me, after I realised that the command-line parameter was a bit offset (i.e. 32 for first block) not a byte offset.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I cannot get James Taylor's excellent little seek-bzip2 to compile under Windows? It can
I cannot get a VS 2008 solution to compile on a clients' laptop with
Cannot get wpf project to reconise FolderBrowserDialog using System.Windows.Forms.Integration; using System.Windows.Forms; private void Button_Click_1(object
I cannot get this simple piece of code to compile without including the TestClass.cpp
I cannot get current row value. How can i do? bindingSource1.DataSource = LData; (LData
I cannot get my Wordpress theme to randomise the posts I'm displaying in the
I cannot get my Spring web app to find my scripts. I have the
I cannot get this function to fire off... I'm thinking I need a fresh
I cannot get my SID working ... <?php session_start(); // Or maybe pass along
I cannot get Bindable LINQ to work with VB.NET for the life of me.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.