E2404, LNK 2019, LNK 1120 when compiling Tutorial 9 code

The Partridge Family were neither partridges nor a family. Discuss.
Post Reply
ItsSter
Posts: 2
Joined: July 28th, 2017, 9:54 am

E2404, LNK 2019, LNK 1120 when compiling Tutorial 9 code

Post by ItsSter » July 30th, 2017, 7:15 am

Hello,

watching chilis beginners C++ game programming tutorial I had to download the tutorial 9 code from the website. When I compile it sometimes I am getting some strange errors:

ten times this one:
E2404 function call must have a constant value in a constant expression value exceeds the range of "int"

and:
Error LNK2019 unresolved external symbol "public: void __cdecl Poo::Update(void)" (?Update@Poo@@QEAAXXZ)

and:
Error LNK1120 1 unresolved externals

I hope you can help me.

Thanks. :D

PS:I won't attach the file because it's downloadable from the tutorial section.

albinopapa
Posts: 4373
Joined: February 28th, 2013, 3:23 am
Location: Oklahoma, United States

Re: E2404, LNK 2019, LNK 1120 when compiling Tutorial 9 code

Post by albinopapa » July 30th, 2017, 9:25 am

The first error I've seen when you compile using Visual Studio 2017. In the Colors::MakeRGB function, chili uses unsigned char for the three parameters, but when doing the calculations, the value will exceed 255 on some of the colors, hence the error message. To remove these errors, replace the unsigned char with unsigned int.

The second error means you have Poo::Poo() declared, but no Poo::Poo() is defined. To define it, either add = default; to the end of Poo() or {}.
Poo() = default;
or
Poo(){}
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com

ItsSter
Posts: 2
Joined: July 28th, 2017, 9:54 am

Re: E2404, LNK 2019, LNK 1120 when compiling Tutorial 9 code

Post by ItsSter » July 30th, 2017, 12:42 pm

Thanks, It worked :D

albinopapa
Posts: 4373
Joined: February 28th, 2013, 3:23 am
Location: Oklahoma, United States

Re: E2404, LNK 2019, LNK 1120 when compiling Tutorial 9 code

Post by albinopapa » July 30th, 2017, 7:32 pm

Lol, I made the reply in haste, but I'm glad yo figured it out. I didn't see that it was Poo::Update that needed the definition and not Poo::Poo.
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com

Post Reply