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.
PS:I won't attach the file because it's downloadable from the tutorial section.
E2404, LNK 2019, LNK 1120 when compiling Tutorial 9 code
-
- Posts: 4373
- Joined: February 28th, 2013, 3:23 am
- Location: Oklahoma, United States
Re: E2404, LNK 2019, LNK 1120 when compiling Tutorial 9 code
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(){}
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
Re: E2404, LNK 2019, LNK 1120 when compiling Tutorial 9 code
Thanks, It worked
-
- Posts: 4373
- Joined: February 28th, 2013, 3:23 am
- Location: Oklahoma, United States
Re: E2404, LNK 2019, LNK 1120 when compiling Tutorial 9 code
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