You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Xcode 7.3.1编译报错‘Unknown type name 'size_t'’,求助适配Mac OS X 10.11

Fixing 'Unknown type name 'size_t'' When Compiling for Mac OS X 10.11 (El Capitan) with Xcode 7.3.1

Hey there, let's work through this frustrating error you're facing while building your app for El Capitan. I've dealt with similar issues targeting older macOS versions, so here are actionable steps to resolve the Unknown type name 'size_t' error:

  • Check required header includes
    size_t is a standard C type defined in headers like <stddef.h>, <stdint.h>, or <stdlib.h>. The most common cause of this error is a missing include in the file where the error occurs. Start by adding #include <stddef.h> at the top of the problematic source file—this is often the quick fix.

  • Verify Xcode SDK and command line tool configuration
    Make sure your Xcode setup is properly aligned for El Capitan:

    1. Open Xcode Preferences → Locations → Command Line Tools, and confirm it's set to Xcode 7.3.1.
    2. In your project's Build Settings, check that Base SDK is set to OS X 10.11 (not a newer SDK like Sierra or High Sierra). A mismatched SDK can break standard type definitions.
  • Audit custom preprocessor macros
    Sometimes project-specific preprocessor macros can interfere with standard header parsing. Temporarily clear all custom macros in Build Settings → Preprocessor Macros, then recompile. If the error goes away, add your macros back one by one to identify which one is causing the conflict.

  • Confirm C language standard setting
    size_t is part of the C99 standard and later. In Build Settings → C Language Dialect, ensure you're using GNU99, C99, or a newer standard. Avoid older standards like C89, which don't include size_t as a standard type.

  • Clean project caches
    Corrupted build caches can cause odd compilation errors. Try:

    • Using the shortcut Cmd+Shift+Option+K to clean the build folder.
    • Deleting the Derived Data folder (find its path in Xcode Preferences → Locations) and restarting Xcode before rebuilding.

Since you're already compiling on El Capitan with the correct Xcode version (smart move for 10.11 compatibility!), focusing on these configuration and header issues should get you past this error.

内容的提问来源于stack exchange,提问作者Mike Crawford

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.25 08:13:53