[ODE] "False" already defined???

Engin Cilasun engin at vividimage.co.uk
Thu Oct 2 16:54:42 MST 2003


Thanks,

I've solved the problem and am giving the log below, in case someone else has the same/similar problem:

- I have to use Visual C 7.x for the "other" platform I'm targeting towards, so I can't change to mingw etc
- I have compiler warning level 4 enabled, which is a big "must" for the project at hand

so

- I removed all ode and opcode code into another project with warning lvl1 set to 1
- The other project compiles fine without error (?? surprise, not a single warning!)
- I then linked the code back into the first project (two versions, debug&release builds)

This increased the code size because I can't do "whole program" optimizations anymore.

The problem is, I really really really need that warning level set back to 4, else the project goes to oblivion :))

BTW, thanks for the code snippet, I think I'll fix using your code or remove the internal warnings.

Engin Cilasun
engin at vividimage.co.uk

PS: those "false(xx)" are my manual replacement for SetIceError to show how the preprocessor behaves in this case...

  ----- Original Message ----- 
  From: Pierre Terdiman 
  To: ode 
  Sent: Thursday, October 02, 2003 3:03 PM
  Subject: Re: [ODE] "False" already defined???


  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__)




------------------------------------------------------------------------------


  _______________________________________________
  ODE mailing list
  ODE at q12.org
  http://q12.org/mailman/listinfo/ode
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://webserver.computershop.calgary.ab.ca/pipermail/ode/attachments/20031002/3fef7552/attachment.htm


More information about the ODE mailing list