Dwight
Member
|
i-value issues with latest update VS2019
Hi all,
When rebuilding the MMO source code, I get the following errors on the following 2 lines after the latest VS2019 update 16.8.2:
Code:
if(region)region.virtualSize(&Vec2(0, y));
ctrl.create(Capsule(0.3, h), &Vec(0, -h/2, 0)).actor.kinematic(true).collision(false).obj(this);
Error: error C2102: '&' requires l-value.
I know that the address-of operator ( & ) must have an l-value as operand. [Microsoft doc: https://docs.microsoft.com/en-us/cpp/err...w=msvc-160 ]
What would be the easiest way of fixing this? Create a new variable, assign it and voila? Or is there something else under the hood going on here?
|
|
11-23-2020 06:17 PM |
|
Tottel
Member
|
RE: i-value issues with latest update VS2019
You're passing a r-value by sending
as an argument. Without testing, I believe the fix would be to make it an l-value, so declare it as a variable on the line above:
Code:
Vec2 size = Vec2(0, y);
region.virtualSize(&size);
I think that would fix it. I am not sure why we'd have to pass the argument as a const pointer. To me, it makes more sense to use a const reference, but perhaps Esenthel could explain the reasoning.
|
|
11-23-2020 06:40 PM |
|
Dwight
Member
|
RE: i-value issues with latest update VS2019
(11-23-2020 06:40 PM)Tottel Wrote: You're passing a r-value by sending
as an argument. Without testing, I believe the fix would be to make it an l-value, so declare it as a variable on the line above:
Code:
Vec2 size = Vec2(0, y);
region.virtualSize(&size);
I think that would fix it. I am not sure why we'd have to pass the argument as a const pointer. To me, it makes more sense to use a const reference, but perhaps Esenthel could explain the reasoning.
Hi Tottel,
Great to see you get active more here!
That indeed solved it, so it must be a new update in the language! "Create a new variable, assign it and voila?"
|
|
11-23-2020 06:48 PM |
|
Tottel
Member
|
RE: i-value issues with latest update VS2019
Glad to hear that solved it
I've never stopped lurking here and I was still working on Esenthel projects. Sadly, the PBR update broke all of the assets I had made over the years, and I realized I had NO SOURCE FILES WHATSOEVER anymore. I couldn't fix the texture issues. So yeah, that was a bummer and I gave up on those projects..
|
|
11-23-2020 09:07 PM |
|
Esenthel
Administrator
|
RE: i-value issues with latest update VS2019
@Dwight: Thank you for reporting this! I will investigate once I finish my current tasks.
@Tottel: Sorry to hear that, I recommend using OneDrive, Google Drive, Mega, DropBox to store various asset source files for backup.
|
|
11-25-2020 05:20 AM |
|
Dwight
Member
|
RE: i-value issues with latest update VS2019
(11-23-2020 09:07 PM)Tottel Wrote: Glad to hear that solved it
I've never stopped lurking here and I was still working on Esenthel projects. Sadly, the PBR update broke all of the assets I had made over the years, and I realized I had NO SOURCE FILES WHATSOEVER anymore. I couldn't fix the texture issues. So yeah, that was a bummer and I gave up on those projects..
No reason to not start over. If there's 1 thing I learned this year with all the things going on, it's that with the increase in free time I get to spend more time studying and enjoying working on my project. Finally having the time to spend 2 hours a day learning how to code is such a game changer, and that is something none can take away from you.
Now go code those projects. I expect more nice projects in the Esenthel store from you to digest and learn from. Use placeholder assets!
And #SubscribeToEsenthel.
(This post was last modified: 11-25-2020 12:26 PM by Dwight.)
|
|
11-25-2020 12:26 PM |
|
Esenthel
Administrator
|
RE: i-value issues with latest update VS2019
Another way to solve this is to do:
region.virtualSize(&NoTemp(Vec2(0, y)));
I've reported the problem to Microsoft and will see what they reply.
|
|
11-29-2020 08:30 AM |
|
Esenthel
Administrator
|
RE: i-value issues with latest update VS2019
|
|
12-07-2020 02:17 PM |
|