About Store Forum Documentation Contact



Post Reply 
Warning and Error on new version
Author Message
SamNainocard Offline
Member

Post: #1
Warning and Error on new version
I recently update Engine and VS 2015, but there're weird warning and error all over the place once I rebuild.

Something about 'destructor was implicitly defined as deleted because a base class destructor is inaccessible or deleted' and UNION 'attempting to reference a deleted function' stuff.

Tutorial and Bloody Massacre build fine though.


Attached File(s)
.txt  Output.txt (Size: 17.04 KB / Downloads: 9)
(This post was last modified: 10-14-2015 01:36 PM by SamNainocard.)
10-14-2015 01:35 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
RE: Warning and Error on new version
Hi,

VS 2015 has a new compiler with some changes, you may want to read this:
https://msdn.microsoft.com/en-us/library....140).aspx

If you still have issues, you will have to post some code.

I've noticed that if you use unions on objects with constructors, you may need to add an empty constructor, something like that:
Code:
struct CalcValue // Calculator Value
{
   CVAL_TYPE type; // value type
   UNION
   (
      UNION_ELM(Long  i ;) // CVAL_INT
      UNION_ELM(Dbl   r ;) // CVAL_REAL
      UNION_ELM(VecD2 v2;) // CVAL_VEC2
      UNION_ELM(VecD  v ;) // CVAL_VEC
      UNION_ELM(VecD4 v4;) // CVAL_VEC4
   )

   CalcValue() {} // needed because of union
};
10-14-2015 09:41 PM
Find all posts by this user Quote this message in a reply
SamNainocard Offline
Member

Post: #3
RE: Warning and Error on new version
Thank you, I able to fix all error now, however there's still few warning about union deleted destructor.

warning C4624: 'SkillMod::<unnamed-tag>': destructor was implicitly defined as deleted because a base class destructor is inaccessible or deleted
Code:
class SkillMod
{
   mutable UID  id;  
   int mod_inx;
  
   void operator=(C SkillMod &c){Copy(T, c);}

   SkillMod() {}
   SkillMod(C SkillMod& c) {T=c;}
   SkillMod(UID id, int mod) {T.id=id; T.mod_inx=mod;}
  ~SkillMod() {}
private:
   UNION
   (
      UNION_ELM(mutable AbilityParamPtr _abilityParam;)
      UNION_ELM(mutable PerkParamPtr    _perkParam;)
   )
}

Adding destructor to union stop this warning, but not sure if it's worth to fix all those warning, doesn't seem to have effect in-game though.
Code:
union U
{
      UNION_ELM(mutable AbilityParamPtr _abilityParam;)
      UNION_ELM(mutable PerkParamPtr    _perkParam;)
   ~U(){}
}
(This post was last modified: 10-15-2015 05:25 AM by SamNainocard.)
10-15-2015 05:25 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #4
RE: Warning and Error on new version
Are AbilityParamPtr and PerkParamPtr pointers to counted cache elements?
If so, then you shouldn't put them into an union.
10-15-2015 07:48 AM
Find all posts by this user Quote this message in a reply
SamNainocard Offline
Member

Post: #5
RE: Warning and Error on new version
Yes they are, guess I have to separate them then.
10-15-2015 12:03 PM
Find all posts by this user Quote this message in a reply
Post Reply