Unknown type name ‘off64_t’

后端 未结 7 1852
你的背包
你的背包 2021-02-12 17:52

I have a problem using Apache Portable Runtime on Ubuntu with GCC 4.8.1

The problem is that the off64_t from is not availab

7条回答
  •  南旧
    南旧 (楼主)
    2021-02-12 18:36

    You should define $C_INCLUDE_PATH to point to linux headers, something like

    export C_INCLUDE_PATH=/usr/include/x86_64-linux-gnu
    

    To install linux header, use

    sudo apt-get install linux-headers-`uname -r`
    

    P.S.

    $ cat 1.c
    #include 
    off64_t a_variable;
    int main(){return 0;}
    
    $ gcc --version
    gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
    
    $ echo $C_INCLUDE_PATH
    /usr/include/x86_64-linux-gnu
    
    $ grep off64_t /usr/include/x86_64-linux-gnu/sys/types.h 
    typedef __off64_t off_t;
    #if defined __USE_LARGEFILE64 && !defined __off64_t_defined
    typedef __off64_t off64_t;
    # define __off64_t_defined
    

提交回复
热议问题