如何在c+中使用枕头库+;程序 我试图创建一个基于TunSoFrad的C++程序,并用C语言编写了枕形图像处理库。不是opencv

如何在c+中使用枕头库+;程序 我试图创建一个基于TunSoFrad的C++程序,并用C语言编写了枕形图像处理库。不是opencv,c++,c,visual-studio-2017,python-imaging-library,C++,C,Visual Studio 2017,Python Imaging Library,想要使用Pillow的原因是使用Pillow的python tensorflow项目创建相同的库环境。 具体来说,就是opencv和pillow之间的difference resize()函数的结果 这样,当我在C++代码中包含IMPION .H头文件时,编译器会产生如下错误。 甚至包括在“extern c”循环中的头文件 下面是imaging.h文件中ImagingMemoryArena结构代码的链接 我认为C代码可以用C++代码编译。所以在.C和.CPP文件中都尝试了下面的代码。 但只能在

想要使用Pillow的原因是使用Pillow的python tensorflow项目创建相同的库环境。 具体来说,就是opencv和pillow之间的difference resize()函数的结果

这样,当我在C++代码中包含IMPION .H头文件时,编译器会产生如下错误。 甚至包括在“extern c”循环中的头文件

下面是imaging.h文件中ImagingMemoryArena结构代码的链接

我认为C代码可以用C++代码编译。所以在.C和.CPP文件中都尝试了下面的代码。 但只能在C文件中编译,不能在CPP中编译

<编译环境在Visual Studio 2017 C++项目中。

#if defined(__cplusplus)
extern "C" {
#endif

    typedef struct ImagingMemoryArena {
        int alignment;        /* Alignment in memory of each line of an image */
        int block_size;       /* Preferred block size, bytes */
        int blocks_max;       /* Maximum number of cached blocks */
        int blocks_cached;    /* Current number of blocks not associated with images */
        int stats_new_count;           /* Number of new allocated images */
        int stats_allocated_blocks;    /* Number of allocated blocks */
        int stats_reused_blocks;       /* Number of blocks which were retrieved from a pool */
        int stats_reallocated_blocks;  /* Number of blocks which were actually reallocated after retrieving */
        int stats_freed_blocks;        /* Number of freed blocks */
    } *ImagingMemoryArena;

#if defined(__cplusplus)
}
#endif
我想知道为什么C++编译器会对上述代码产生错误,甚至包括“ExtEngC.”。
谢谢。< /P>请点击<代码>编辑<代码>,并添加您使用的命令来编译。我在Visual Studio 2017,VisualC++中编译了代码。请单击<代码> Edg> <代码>,并添加您使用的命令来编译此代码。我在VisualStudio 2017、VisualC++中编译了代码。
#if defined(__cplusplus)
extern "C" {
#endif

    typedef struct ImagingMemoryArena {
        int alignment;        /* Alignment in memory of each line of an image */
        int block_size;       /* Preferred block size, bytes */
        int blocks_max;       /* Maximum number of cached blocks */
        int blocks_cached;    /* Current number of blocks not associated with images */
        int stats_new_count;           /* Number of new allocated images */
        int stats_allocated_blocks;    /* Number of allocated blocks */
        int stats_reused_blocks;       /* Number of blocks which were retrieved from a pool */
        int stats_reallocated_blocks;  /* Number of blocks which were actually reallocated after retrieving */
        int stats_freed_blocks;        /* Number of freed blocks */
    } *ImagingMemoryArena;

#if defined(__cplusplus)
}
#endif