Snekgame unresolved externals
Snekgame unresolved externals
Why these bugs?
10k you
10k you
- Attachments
-
- snekgame.zip
- (603.53 KiB) Downloaded 162 times
Re: Snekgame unresolved externals
I'll check this later, but what do you mean with "10k you"?
Re: Snekgame unresolved externals
read it fast
Re: Snekgame unresolved externals
Code: Select all
Snake.obj : error LNK2019: unresolved external symbol "public: __cdecl Snake::Segment::Segment(void)" (??0Segment@Snake@@QEAA@XZ) referenced in function "public: __cdecl Snake::Snake(struct Location const &)" (??0Snake@@QEAA@AEBULocation@@@Z)
1>Snake.obj : error LNK2019: unresolved external symbol "public: void __cdecl Snake::Segment::InitHead(struct Location const &)" (?InitHead@Segment@Snake@@QEAAXAEBULocation@@@Z) referenced in function "public: __cdecl Snake::Snake(struct Location const &)" (??0Snake@@QEAA@AEBULocation@@@Z)
1>Snake.obj : error LNK2019: unresolved external symbol "public: void __cdecl Snake::Segment::Follow(class Snake::Segment const &)" (?Follow@Segment@Snake@@QEAAXAEBV12@@Z) referenced in function "public: void __cdecl Snake::MoveBy(struct Location const &)" (?MoveBy@Snake@@QEAAXAEBULocation@@@Z)
1>Snake.obj : error LNK2019: unresolved external symbol "public: void __cdecl Snake::Segment::Draw(class Board &)" (?Draw@Segment@Snake@@QEAAXAEAVBoard@@@Z) referenced in function "public: void __cdecl Snake::Draw(class Board &)" (?Draw@Snake@@QEAAXAEAVBoard@@@Z)
Chili
Re: Snekgame unresolved externals
Ok.
Do you know why Visual Studio underlines the brace in the picture I added?
misterchi
Do you know why Visual Studio underlines the brace in the picture I added?
misterchi
- Attachments
-
- underlined brace.PNG (4.9 KiB) Viewed 3429 times
Re: Snekgame unresolved externals
If you put your cursor on the underlined part it will tell you.
My guess is you have some embedded object with no default constructor and it cannot instantiate it.
My guess is you have some embedded object with no default constructor and it cannot instantiate it.
Chili
Re: Snekgame unresolved externals
Hi,
it says: the default constructor of "Snake::Segment" cannot be referenced-- it is a deleted function
What should I do? I programmed the same like you did in the Tutorial 14a.
it says: the default constructor of "Snake::Segment" cannot be referenced-- it is a deleted function
What should I do? I programmed the same like you did in the Tutorial 14a.
-
- Posts: 4373
- Joined: February 28th, 2013, 3:23 am
- Location: Oklahoma, United States
Re: Snekgame unresolved externals
Do you have a line in class Snake::Segment like
Snake::Segment() = default;
Snake::Segment() = default;
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: Snekgame unresolved externals
No, I don't have that line. But when I add a constructor the red underline disappears. The odd thing is that I did it like Chili did and his program works.
Re: Snekgame unresolved externals
I can 100% guarantee that you didn't do it like me
If you wanna know what you missed, post your full code (the non working stuff) and I'll take a look at it.
If you wanna know what you missed, post your full code (the non working stuff) and I'll take a look at it.
Chili