[ODE] "False" already defined???

Pierre Terdiman pierre.terdiman at novodex.com
Thu Oct 2 14:03:46 MST 2003


collision_trimesh_box.obj : error LNK2005: "bool __cdecl __False__(void)" (?__False__@@YA_NXZ) already defined in collision_trimesh.obj

Upon searching the file contents, I found a suitable candidate in file Opcode.h:

Those candidates have nothing to do with this error (note the different spellings).

__False()__ prevents a VC++ Level4 warning from appearing when you use the redefined "for" (which is here to make the code ANSI-compliant, see a previous thread).

The SetIceError stuff however, is redefined to junk code because I didn't want to ship Opcode with all the completely irrelevant code from my framework (in this particular case, error handling). I think I already explained this on the list.

CHECKALLOC(x) if(!x) return false("Out of memory.", EC_OUTOUFMEMORY);

during compile, and by this bit of code in OPC_Model.cpp:

if(!(create.Rules&SPLIT_COMPLETE)) return false("OPCODE WARNING: supports blah blah\n"); 


Hmm, nice... 

"return false(something)" is new to me. It wasn't like this in Opcode. I assume someone changed it in the ODE version, for some reason.

The best thing to do is to let the original code unchanged, and redefine SetIceError so that it uses ODE's error reporting code (if such a thing exists).

For the records, here's how it's defined in my engine.

Pierre

 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 /**
  * Sets an error message.
  * \relates IceError
  * \fn   SetIceError_(const char* error, const char* error_code, bool update_log)
  * \param  error  [in] the error message string
  * \param  error_code [in] a possible user-defined error code.
  * \param  update_log [in] error message is reported on the log file as well, if update_log is true
  * \param  file  [in] source file's name (in which the error occured)
  * \param  line  [in] source file's line (in which the error occured)
  * \return  false, so that you can do "return SetIceError()" in one line.
  */
 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 FUNCTION ICECORE_API bool  SetIceError_(const char* error, const char* error_code=null, bool update_log=true, const char* file=null, udword line=0);


 //! This macro automatically completes error message with file & line information
 #define SetIceError(error, error_code) SetIceError_(error, error_code, true, THIS_FILE, __LINE__)


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://webserver.computershop.calgary.ab.ca/pipermail/ode/attachments/20031002/02bbf5aa/attachment.htm


More information about the ODE mailing list