相关疑难解决方法(0)

你会如何声明DLL导入签名?

这是使用.NET的pHash的后续帖子

您如何在.NET中声明以下C++声明?

int ph_dct_imagehash(const char* file,ulong64 &hash);
Run Code Online (Sandbox Code Playgroud)

到目前为止我有

[DllImport(@"pHash.dll")]
public static extern int ph_dct_imagehash(string file, ref ulong hash);
Run Code Online (Sandbox Code Playgroud)

但我现在得到以下错误

ulong hash1 = 0, hash2 = 0;
string firstImage = @"C:\Users\dance2die\Pictures\2011-01-23\177.JPG";
string secondImage = @"C:\Users\dance2die\Pictures\2011-01-23\176.JPG";
ph_dct_imagehash(firstImage, ref hash1);
ph_dct_imagehash(secondImage, ref hash2);
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述

它基本上说我的ph_dtc_imagehash声明是错误的.
我在这做错了什么?

.net c# c++ dllimport

6
推荐指数
1
解决办法
7320
查看次数

使用CImg加载PNG

我无法使用CImg加载PNG.我听说你需要让libpng/zlib先上班,但我不确定如何设置它.我在Ubuntu上.我的来源:

#include <cmath>
#include <cstdio>
#include <string>
#include <assert.h>
#include <stdarg.h>

#define cimg_using_png
#include "CImg.h"
using namespace cimg_library;
#include "png.h"

int main(int argc, char** argv)
{
    CImg<unsigned char> img2("test.png");
    img2.display();
    return 0;
}
Run Code Online (Sandbox Code Playgroud)

png zlib cimg libpng

5
推荐指数
1
解决办法
3839
查看次数

标签 统计

.net ×1

c# ×1

c++ ×1

cimg ×1

dllimport ×1

libpng ×1

png ×1

zlib ×1