C#< – >

C# <--> VB.NET DLL Conversion

今天我发生了一件非常可怕或奇怪的事情。我是一个vb.net开发人员,我试图使用这个名为raw input sharp(http://www.jstookey.com/arcade/rawmouse/)的库,它允许我同时接收来自多个鼠标的原始数据。该库最初是用C语言编写的,但由于我使用了.NET,所以它与原始语言无关。

我引用了它,并得到一个错误,说lib有多个同名的定义。我说,"哦,那太好了",经过几个小时的挣扎,我意识到在C语言中我们区分大小写,而在VB中则相反。例如,结构rawmouse与类rawmouse一致。

我现在到底该怎么办?


重命名结构或将其放在其他命名空间中。


Hans Passant已经在https://stackoverflow.com/a/2302109/292411中提供了答案。

For two identifiers to be considered distinct, they must differ by more than just their case.

因此,不幸的是,如果不遇到这个问题,您就不能以当前的形式使用这个库。