[Solved] Critter: Context does not allow for disambig...

dirkmitt

12-08-2011 18:43:42

First of all, I should express my many thanks to Betajaen for all the work he has put into NxOGRE.

I must admit, that when there are certain bumps in the road, I can get quite nervous, but now that those issues have been resolved, I'm settling back down to compiling some code, with VisualStudio 8 (2005).

I'm thankful that Betajaen has provided the BuggySwires branch of NxOGRE as well as Critter, because that branch at least offers us the correct, older VisualStudio 8 solution files.

What I have done was to compile NxOGRE (now that I have the PhysX SDK), namely the BuggySwires branch, and the compile process indicated success. Next, I set my NXOGRE_DIR environment variable, just as I had set PHYSX_DIR before, and tried to compile Critter (of the same branch/build: BuggySwires/Circuit). But as can often be expected when compiling code, there were some error messages, and I'm seeking advice on what to do about these. Here is the message which popped up several time in a row:


c:\program files (x86)\critter\build\source\CritterAnimatedCharacter.h(54) : error C2888: 'T *NxOgre::GC::safe_new5(const A1 &,const A2 &,const A3 &,const A4 &,const A5 &,const char *,int)' : symbol cannot be defined within namespace 'Critter'
c:\program files (x86)\critter\build\source\CritterRenderSystem.cpp(88) : error C2440: 'initializing' : cannot convert from 'T *(__cdecl *)(const A1 &,const A2 &,const A3 &,const A4 &,const char *,int)' to 'Critter::Body *'
Context does not allow for disambiguation of overloaded function


Now my C++ and understanding of templates is somewhat rudimentary, for which reason I can't quite decipher it.
One observation which I did make however from an earlier inspection of the header files, is that the Critter version and the NxOGRE version need to match. I thought I had seen an explicit test for that.

What now? :)

Dirk

[Edit]: What I suspect, is that my old Visual Studio Edition might not be advanced enough to understand the way in which the C++ templates are phrased, which would make this an ICE: An Internal Compiler Error? If that should be the case, is there a feature within Critter which I might be able to disable in the header or source files, which will make this go away? And also, should I expect to see this error when and if I compile my own applications to use NxOGRE?

Further, I forgot to post an error message which might be important, which does not look as much like an ICE to me, but which actually precedes the error message above:


c:\program files (x86)\critter\build\source\CritterCharacterBase.h(54) : error C2888: 'T *NxOgre::GC::safe_new5(const A1 &,const A2 &,const A3 &,const A4 &,const A5 &,const char *,int)' : symbol cannot be defined within namespace 'Critter'
c:\program files (x86)\critter\build\source\CritterCharacterBase.h(55) : error C2888: 'void NxOgre::GC::safe_delete(T *,const char *,int)' : symbol cannot be defined within namespace 'Critter'


What seems to be triggering this, is the use of the following macros within the header files of Critter:


NXOGRE_GC_FRIEND_NEW4
NXOGRE_GC_FRIEND_NEW5
NXOGRE_GC_FRIEND_DELETE


However unfortunately, these are all macros defined within NxOGRE itself, which compiled fine on my setup, but whose header-file declarations are supposed to be available to other NxOGRE applications as well...

dirkmitt

12-08-2011 22:59:34

I found that this exact error occurred to another user of Visual Studio 8 (2005), and was covered in this earlier posting:

http://www.ogre3d.org/addonforums/viewtopic.php?f=6&t=13022

Fortunately, the same suggestion which worked for the other guy, also worked for me! I also just get 2 warnings now, or some such thing, when I build critter! :D

Dirk