vs2010使用python.h封装python代码报错缺失in

2022-08-02  本文已影响0人  AD_wang

原因:懒得写,直接引用别人的分析原因
https://blog.csdn.net/baidu_16886827/article/details/38350299

解决方法步骤

1、定位到报错文件:如果也是使用python.h出现的问题,报错的地方应该是pyport.h报错。

2、修改方法:直接改pyport.h(不能保证所有人用此方法都能解决问题,所以一定要备份pyport.h),注释掉包含语句//#include <inttypes.h>,改成如下代码

#if defined(WIN32) && !defined(__MINGW32__) && !defined(__CYGWIN__)

#define  CONFIG_WIN32     

#endif     

#if defined(WIN32) && !defined(__MINGW32__)  && !defined(__CYGWIN__) && !defined(EMULATE_INTTYPES)     

#define EMULATE_INTTYPES     

#endif     

#ifndef EMULATE_INTTYPES     

#include  <inttypes.h>   

#else

typedef signed char int8_t;     

typedef  signed short int16_t;     

    typedef signed int  int32_t;     

    typedef  unsigned char  uint8_t;     

    typedef unsigned short uint16_t;     

    typedef  unsigned int  uint32_t;     

#ifdef CONFIG_WIN32     

        typedef signed  __int64  int64_t;     

        typedef unsigned __int64 uint64_t;     

#else /*  other OS */     

        typedef signed long long  int64_t;     

        typedef  unsigned long long uint64_t;     

#endif /* other OS */     

#endif /*  EMULATE_INTTYPES */

#ifndef INT64_C

#define INT64_C(c)  (c##LL)

#define UINT64_C(c)  (c##ULL)

#endif

引用文章

https://blog.csdn.net/silyvin/article/details/49226859

上一篇 下一篇

猜你喜欢

热点阅读