为 Windows Mobile 编译时找不到引用的程序集

发布于 2024-08-19 10:41:03 字数 668 浏览 10 评论 0原文

我决定为我的 Windows Mobile 6 项目使用 tessnet2 库。不幸的是,当我尝试编译它时,它抛出一个错误:

  1. “tessnet2.Tesseract.GetThresholdedImage(System.Drawing.Bitmap, System.Drawing.Rectangle)”的最佳重载方法匹配有一些无效参数

  2. 类型“System.Drawing.Rectangle”是在未引用的程序集中定义的。您必须添加对程序集“System.Drawing,Version=2.0.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a”的引用

好的,我知道。添加对程序集的引用。问题是,我做到了。我通过解决方案资源管理器 (System.Drawing) 中的“添加引用”添加引用,甚至将其声明为“使用 System.Drawing”。

智能感知工作没有任何问题。当我写“矩形”时,它会自动显示顶部带有“矩形”结构的列表。

问题是什么?程序集已添加,即使智能感知看到它,为什么编译器看不到?

I decided to use tessnet2 library for my Windows Mobile 6 project. Unfortunetly while I am trying to compile it, it throws an error:

  1. The best overloaded method match for 'tessnet2.Tesseract.GetThresholdedImage(System.Drawing.Bitmap, System.Drawing.Rectangle)' has some invalid arguments

  2. The type 'System.Drawing.Rectangle' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'

OK, I know. Add reference to the assembly. The problem is, that I did it. I add reference by 'Add Reference' in Solution Explorer (System.Drawing), and I even have it declared as 'using System.Drawing'.

Intellisense works without any problem. When i write 'rect' it automaticlly shows me the list with 'Rectangle' structure on top.

What is the problem? The assembly is added, even intellisense sees it, why doesn't the compiler?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

如若梦似彩虹 2024-08-26 10:41:03

看看它,这在 Compact Framework 中是不可能工作的。首先该网站明确表示

Tessnet2.dll 需要 Visual C++ 2008 运行时

那么,这意味着它是为桌面构建的。由于多种原因,它无法在 WinMo 设备上运行,但足以说明您必须为正确的处理器并使用正确的运行时重新编译它。如果它使用诸如内联汇编器之类的东西,这将使移植变得非常非常具有挑战性。

如果您构建了 tessract 库,您仍然无法使用 tessnet2 托管库。

这是一个 Visual Studio 2008 C++/CLI 项目

这意味着它是一个托管 C++ 项目。 COCompact Framework 不支持托管 C++。因此,您必须将其移植到 C# 或编写一个单独的 P/Invoke 包装器来调用 tessract 库函数。

Just looking at it, there's no way this is going to work in the Compact Framework. First off the site explicitly says

Tessnet2.dll needs Visual C++ 2008 Runtime

Well, that means it was built for the desktop. It's not going to work on a WinMo device for many reasons, but suffice it to say that you would have to recompile it for the right processor and using the right runtimes. If it uses anything like inline assembler this is going to make porting it really, really challenging.

If you get the tessract library built, you still can't use the tessnet2 managed library.

It's a Visual Studio 2008 C++/CLI project

This means it's a managed C++ project. Managed C++ is not supported by the COmpact Framework. So you'd have to port that to C# or write a separate P/Invoke wrapper that calls the tessract library functions.

£噩梦荏苒 2024-08-26 10:41:03

紧凑框架和标准框架是公开相似 API 的 2 个不同的代码库。这就是为什么智能感知“有效”但编译器“抱怨”的原因。

您的第 3 方 OCR 框架需要引用 CompactFramework。下载 Tessnet2 的源代码。将引用的框架程序集替换为紧凑框架程序集。您必须浏览它们并在“C:\Program Files\Microsoft.NET\SDK\CompactFramework\v3.5\WindowsCE”中找到它们。

The compact framework and standard framework are 2 different code bases that exposes a similar API. That is why intellisense 'worked' but the compiler 'complained'.

Your 3rd party OCR framework needs to reference the CompactFramework. Download the source for Tessnet2. Replace the referenced framework assemblies with compact framework assemblies. You'll have to browse for them and find them in "C:\Program Files\Microsoft.NET\SDK\CompactFramework\v3.5\WindowsCE".

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文