Skip to main content
Brainiac
September 16, 2013
Question

Warning treated as error in VS2012. Any idea to fix?

  • September 16, 2013
  • 1 reply
  • 1352 views

When I build, I'm seeing some errors popup and they are all on lines where I am setting up checkbox parameters.  The compiler is throwing the following errors:

error C2220: warning treated as error - no 'object' file generated

warning C4244: '=' : conversion from 'PF_ParamValue' to 'PF_Boolean', possible loss of data

These are being thrown on any line where I have the following:

PF_ADD_CHECKBOXX(STR(StrID_Input_Required), true, PF_ParamFlag_CANNOT_TIME_VARY, PLG_REQUIRED);

I could turn off the error by removing the /WX flag during compiling, but do I really want to do that?  It seems like all would be okay if I did, but thought I'd post here to see if anybody had a suggestion as to why the `possible loss of data` error ocurrs.  Any ideas?

Thanks,

Arie

This topic has been closed for replies.

1 reply

Inspiring
September 17, 2013

Is this the AE CS6 SDK for Windows by chance?  I am still very new to AE plugin development, but I recall a few months ago back when I started messing around with this stuff I was getting the same kind of error when trying to add a checkbox parameter to my plugin.  Since I was starting fresh and using CS5 did not cost me any functionality I just rolled back, and thus far have not really had too many SDK related issues with the CS5 SDK, just issues with my own code and trying to get used to AE development

Fair warning, I tried figuring this out from the link below months ago and I never got it working right, so I just rolled back my SDK version I was building against from CS6 to CS5 and my checkboxes started working without any issues.

I also have compiled against the CS5 SDK on MacOS without any issues if you were to end up going that route, though it could simply be my inexperience talking here...but here are my findings

Google translate will be your friend on this one by the way...

Shortened Link: http://bit.ly/UbIxkz

Original Link: http://ae-users.com/jp/tutorials/2012/12/after-effects%E3%83%A6%E3%83%BC%E3%82%B6%E3%83%BC%E3%81%AE%E3%81%9F%E3%82%81%E3%81%AE%E3%80%81%E3%83%97%E3%83%AD%E3%82%B0%E3%83%A9%E3%83%9F%E3%83%B3%E3%82%B0%E5%85%A5%E9%96%80%E3%80%80%E3%81%9D-19/

The breakdown of what I assumed to be a CS6 SDK bug when I got started was proposed from the site to be the following:

Error 1:

PR_Public.h on approx line number 5 is a character that needs to come out, right before "2005 by Adobe Systems Inc." is an imporperly encoded character

Error 2:

Param_Utils.h on about line 116 is a functions called PF_ADD_CHECKBOX is the one you are likely looking for

The proposed solution was to replace the following on approx line 123

Bad Line: def.u.bd.dephault = def.u.bd.value; \

Good Line: def.u.bd.dephault = (PF_Boolean) def.u.bd.value; \

so it would end up looking like this:

#define PF_ADD_CHECKBOX(NAME_A, NAME_B, DFLT, FLAGS, ID)\

do {\

   PF_Err priv_err = PF_Err_NONE; \

           def.param_type = PF_Param_CHECKBOX; \

           PF_STRCPY(def.name, NAME_A); \

           def.u.bd.u.nameptr  = (NAME_B); \

           def.u.bd.value                    = (DFLT); \

           def.u.bd.dephault = (PF_Boolean)def.u.bd.value; \

           def.flags                              |= (FLAGS); \

           def.uu.id = (ID); \

           if ((priv_err = PF_ADD_PARAM(in_data, -1, &def)) != PF_Err_NONE) return priv_err; \

    } while (0)

Brainiac
September 18, 2013

Yes, this is with the CS6 SDK.  Nice debugging!  I just turned off the /WX switch, and didn't worry about the warning.  Warnings usually do not bother me unless something breaks, and the plugin code was building fine.  In your solution, it looks like you are explicitly casting the value to a PF_Boolean which probably would supress the warning.  I'll give it a go next time I build.

Thanks!

--Arie