1.inttype.h问题
之前看说需要使用inttype.h,然后就从minGW的include文件夹中将其拷贝出来,放到自己的include下,但是运行报很多错误,后来网上看了下说需要将inttype.h的内容改下,如下:
#pragma once
#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 */
编译通过
通过后自己想深究下inttypes.h是干嘛的,查下官方说明:
添加于C99标准,
Include the standard header <inttypes.h>
to define a type, several functions, and numerous macros for fine control over the conversion of integers. Note that the definitions shown for the macros are merely representative -- they can vary among implementations.
包含一个type ,一些函数,和大量的宏定义,目的就是更好的控制不同整数集的转换。不同的实现可以不同,所以这个文件不同系统上有不用版本呀,这样理解不知道可否。
而VS2013已经支持部分C99标准,其中就包括了inttypes.h,所以如果用VS2013编译的话,是没有inttypes.h这个问题的!我又多此一举了()
-------------------------------------------------------------------------------------------
缺少pthreadGC-3.dll动态库
这个可以在minWG/bin下找到,将其放到自己的dll目录下即可