Go to Post You do realize that you all started jumping to conclusions without asking first which JVN he was talking about. - Jay H 237 [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 06-02-2017, 16:35
dr8giblekri dr8giblekri is offline
Registered User
FRC #5920
Team Role: Programmer
 
Join Date: Jan 2017
Rookie Year: 2016
Location: Palouse, WA
Posts: 9
dr8giblekri is an unknown quantity at this point
Post C++ programming help

so, Ive searched and searched and cant find anything about an error im having (I'm probably not searching in the right places or using the right keywords). the error says:


undefined reference to `vtable for Robot'


it occurs in two places:
here: class Robot: public SampleRobot
and then at the end closing bracket from when i define the encoders.

any help is appreciated .
Reply With Quote
  #2   Spotlight this post!  
Unread 06-02-2017, 16:41
gerthworm's Avatar
gerthworm gerthworm is offline
Making the 1's and 0's
FRC #1736 (Robot Casserole)
Team Role: Mentor
 
Join Date: Jan 2015
Rookie Year: 2015
Location: Peoria, IL
Posts: 80
gerthworm has a spectacular aura aboutgerthworm has a spectacular aura about
Re: C++ programming help

I'd need full code to know for sure, but I suspect this is due to something which should be commented out, but isn't?

Search your codebase for the string "vtable for Robot" and see if you're either missing comments, quotes, etc.

FYI, "undefined reference to" is usually the linker saying "I see you have some code object name defined, but I can't figure out where it's declared"... I find it weird that it would pick up a whole string like that, so I might be off in the weeds here....

Last edited by gerthworm : 06-02-2017 at 16:43.
Reply With Quote
  #3   Spotlight this post!  
Unread 06-02-2017, 17:04
SoftwareBug2.0's Avatar
SoftwareBug2.0 SoftwareBug2.0 is offline
Registered User
AKA: Eric
FRC #1425 (Error Code Xero)
Team Role: Mentor
 
Join Date: Aug 2004
Rookie Year: 2004
Location: Tigard, Oregon
Posts: 488
SoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant futureSoftwareBug2.0 has a brilliant future
Re: C++ programming help

Quote:
Originally Posted by gerthworm View Post
Search your codebase for the string "vtable for Robot" and see if you're either missing comments, quotes, etc.
This is not likely to be something named "vtable" in their code. A vtable is used by the compiler to keep track of all the virtual (that's where the "v" in "vtable" comes from) functions and related parts that make up a class.
Reply With Quote
  #4   Spotlight this post!  
Unread 06-02-2017, 17:27
gerthworm's Avatar
gerthworm gerthworm is offline
Making the 1's and 0's
FRC #1736 (Robot Casserole)
Team Role: Mentor
 
Join Date: Jan 2015
Rookie Year: 2015
Location: Peoria, IL
Posts: 80
gerthworm has a spectacular aura aboutgerthworm has a spectacular aura about
Re: C++ programming help

Hmmm, it appears I was off in the weeds myself. I suppose that's what happens when I attempt to answer a C++ question when it's not my first language...

http://stackoverflow.com/questions/3...ence-to-vtable and the linked https://gcc.gnu.org/faq.html#vtables have some info, but it's not stuff I'm super familiar with....
Reply With Quote
  #5   Spotlight this post!  
Unread 06-02-2017, 18:28
dr8giblekri dr8giblekri is offline
Registered User
FRC #5920
Team Role: Programmer
 
Join Date: Jan 2017
Rookie Year: 2016
Location: Palouse, WA
Posts: 9
dr8giblekri is an unknown quantity at this point
Re: C++ programming help

thanks for the help guys. i'll keep looking around then i'll share what i find with you guys for future references.
Reply With Quote
  #6   Spotlight this post!  
Unread 06-02-2017, 20:14
alst alst is offline
Programming Mentor
AKA: Alan
FRC #0830 (RatPack)
Team Role: Mentor
 
Join Date: Jul 2015
Rookie Year: 1830
Location: MI
Posts: 11
alst is an unknown quantity at this point
Re: C++ programming help

This error often shows up when you've forgotten to define virtual methods. In this case, since your Robot class inherits from SampleRobot, you should have definitions for at least one of RobotInit(), Disabled(), Autonomous(), OperatorControl(), Test(), or RobotMain(). If you've defined some of these, make sure they're spelled/capitalized correctly and are defined inside the robot class (or qualified, e.g. with "void Robot::Autonomous(){...}").

If that doesn't help, it would be helpful if you could post your code somewhere (or at least a portion that reproduces the issue).
Reply With Quote
  #7   Spotlight this post!  
Unread 07-02-2017, 10:52
dr8giblekri dr8giblekri is offline
Registered User
FRC #5920
Team Role: Programmer
 
Join Date: Jan 2017
Rookie Year: 2016
Location: Palouse, WA
Posts: 9
dr8giblekri is an unknown quantity at this point
Re: C++ programming help

i've figured out the error...well...one of the mentors did...

the problem was that something was remmed out and it was still reading as if that code was there, which was duplicating the code we had above it.

thanks for all your help!!
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 18:29.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi