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

  • SEARCH
  • Home
  • 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 3278818
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T19:31:23+00:00 2026-05-17T19:31:23+00:00

I have a C application I am trying to compile for Mac OS X

  • 0

I have a C application I am trying to compile for Mac OS X 10.6.4:

$ uname -v
Darwin Kernel Version 10.4.0: Fri Apr 23 18:28:53 PDT 2010; root:xnu-1504.7.4~1/RELEASE_I386

My gcc is as follows:

$ gcc --version
i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5664)

My Makefile is as follows:

CC=gcc
CFLAGS=-D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -O3 -Wformat -Wall -pedantic -std=gnu99

all: myApp
    rm -rf *~

myApp: myApp.o
    ${CC} ${CFLAGS} myApp.o -lbz2 -o myApp
    rm -rf *~

clean:
    rm -rf *.o myApp

The issue is that my application makes calls to fseeko64 and fopen64, and uses the off64_t type for offsets. When I compile my application I get the following warnings and errors:

$ make myApp
gcc -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -O3 -Wformat -Wall -pedantic -std=gnu99   -c -o myApp.o myApp.c
myApp.c: In function ‘extractData’:
myApp.c:119: warning: implicit declaration of function ‘fseeko64’
myApp.c:119: error: ‘off64_t’ undeclared (first use in this function)
myApp.c:119: error: (Each undeclared identifier is reported only once
myApp.c:119: error: for each function it appears in.)
myApp.c: In function ‘extractMetadata’:
myApp.c:305: warning: implicit declaration of function ‘fopen64’
myApp.c:305: warning: assignment makes pointer from integer without a cast

My code builds without errors under Linux. What changes can I make to the source code to add large file support when building under Darwin?

  • 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-17T19:31:23+00:00Added an answer on May 17, 2026 at 7:31 pm

    On Darwin file I/O is 64-bit by default (10.5 at least), just found this by grepping in /usr/include:

    sys/_types.h:typedef __int64_t  __darwin_off_t;
    
    unistd.h:typedef __darwin_off_t     off_t;
    

    So all you need to do is something like

    #ifdef __APPLE__
    #  define off64_t off_t
    #  define fopen64 fopen
    ...
    #endif
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to write a small application and have come across a compile time
I am trying to compile an application that contains CUDA code. I have a
I have been trying to compile the application.sass in my Sencha Touch project into
I am trying to install an application onto my device..I have compiled the application
I have a Spring MVC application trying to use a rich domain model, with
I'm trying to have my application read through a text file and look for
I have an application in witch I am trying to set a internationalization availability.
I have an application where I am trying to implement a safe file overwrite
I have an application in C# that I'm trying to convert to java. The
I have an application that I'm trying to build with at least a nominally

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.