The Type <Type> exists in both dll's

Oct 31, 2010 at 8:53 AM
Edited Oct 31, 2010 at 9:06 AM

First off sorry for my newbishness.. I've done quite a bit of programming the past couple of months but I'm not knowledgeable in everything that's going on under the hood yet (well or even everything on the hood :P )

I'm aware this isn't a Farseer problem but most likely due to me just doing something wrong but since it involves farseer I thought I'd ask here to get a directfix.. For the record I have used farseer 3.xx while in beta but I wasn't using the library "version". Anyways...

I downloaded the farseer class library and compiled it to be used in my current project.

It seems though as if something doesn't like the fact that I'm referencing something twice.. Due to it being part of both vanilla XNA and farseeer using it (?).. I also tried just adding the class project (As seems to be the case in the hello world example) But I get the same error.

I checked the hello world example and nothing is immediately evident to me.. As far as I can tell I'm doing the same thing (Other then using another engine which should be unrelated).

Do I need to do something to the library before building it or do I need to reference things differently in my main project? Sorry I have no clue what *exactly* is going on.

 

edit: Just for clarification I'm getting the error right away when creating the world instance and setting the Vector2 (gravity) argument. The exact error is:

Error 3 The type 'Microsoft.Xna.Framework.Vector2' exists in both 'c:\Program Files (x86)\Microsoft XNA\XNA Game Studio\v3.1\References\Windows\x86\Microsoft.Xna.Framework.dll' and 'c:\FlatRedBallProjects\Darkside\Darkside\Libraries\Farseer\FarseerPhysics3.dll' C:\FlatRedBallProjects\Darkside\Darkside\Setup\FarseerSetup.cs 15 42 Darkside

 

Oct 31, 2010 at 9:39 AM

Sorry for double post but:

I discovered the "copies" of Vector2, Vector3 and Matrix in the farseer class library.. I deleted them and added a reference to Microsoft.XNA.Framework to the project instead.. Recompiled and now it works. 

But still.. Was this necessary or am I going to regret it down the line ^^

Nov 22, 2010 at 7:58 PM
Edited Nov 22, 2010 at 8:05 PM

I've got this problem too. It happened because I'd downloaded the Farseer Physics Engine 3.1 Classlibrary and used it with a project on XNA. As far as I undestood with XNA we should use the Farseer Physics Engine 3.1 XNA package. 

Coordinator
Nov 22, 2010 at 8:05 PM

That is correct. Use the XNA version for XNA projects. I will add a check that makes sure that even if you download the class library and use it in an XNA project, it will still work.

Coordinator
Nov 22, 2010 at 8:11 PM

Looks like I can't do that anymore. The default XNA Game project template in Visual Studio does not contain other conditional compiler symbols than "WINDOWS". It used to contain "XNA" too.

The only thing I can do now is to tell you that you have to use the XNA version of the library for XNA projects.