|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
Help interpreting load time error
I have started to customize the robot template for our team. I have sub-classed the SimpleRobot class to add some of our custom functions. Everything compiled and the code was downloaded into the cRIO fine. But when I rebooted the robot, at the end of the boot, it gave me the following output and I have no idea why TrcRobot is undefined. TrcRobot is my subclass of SimpleRobot. Simplified code construct is shown below. I am expecting to see compiler errors if I made mistakes. But the compiler didn't complain and instead I got load time error of undefined symbol. Can somebody tell me what it means? Thanks.
Code:
FRC_NetworkCommunication was compiled from SVN revision 2064 FPGA Hardware GUID: 0xAD9A5591CC64E4DF756D77D1B57A549E FPGA Software GUID: 0xAD9A5591CC64E4DF756D77D1B57A549E FPGA Hardware Version: 2010 FPGA Software Version: 2010 FPGA Hardware Revision: 1.3.0 FPGA Software Revision: 1.3.0 * Loading StartupDlls: FRC_UserProgram Warning: module 0x134c5d0 (FRC_UserProgram.out) holds reference to undefined symbol _ZTV8TrcRobot. Warning: module 0x134c5d0 (FRC_UserProgram.out) holds reference to undefined symbol _ZTI8TrcRobot. (unloading partially loaded module FRC_UserProgram.out) ...FRC_UserProgram failed to load. Code:
class TrcRobot: public SimpleRobot
{
public:
virtual void SomeCustomizedMethods();
void Autonomous()
{
//Autonomous main loop.
SomeCustomizedMethods();
}
void OperatorControl()
{
//Operator control main loop.
SomeCustomizedMethods();
}
};
class MyRobot: public TrcRobot
{
MyRobot()
{
//Instantiate other objects.
}
~MyRobot()
{
//Destroy objects created in constructor.
}
void SomeCustomizedMethods()
{
//Autonomous or Operator Control tasks.
}
}
START_ROBOT_CLASS(MyRobot);
|
|
#2
|
||||
|
||||
|
Re: Help interpreting load time error
I have a few things:
Taking a second look at it, though, I thought of this: Since the undefined symbol is "_ZTV8TrcRobot.", I'd guess this is caused by neither of the above possibilities, but something involving inheritance. Put constructors in both TrcRobot and MyRobot (you only have one in MyRobot right now). The START_ROBOT_CLASS macro instantiates the class you give it, which will call not just call the base constructor SimpleRobot::SimpleRobot() but also TrcRobot::TrcRobot() and MyRobot::MyRobot(). I'm guessing that after calling the SimpleRobot constructor it looks for the TrcRobot constructor and freaks out when there isn't one. Let me know if this fixes the problem. Last edited by slavik262 : 26-01-2010 at 11:30. |
|
#3
|
||||
|
||||
|
Re: Help interpreting load time error
Yes, I have constructors on both MyRobot and TrcRobot (sorry that I simplified too much and did not show them in my code example). I suspect about inheritance too. So if the undefined symbol means it could not find the constructor of TrcRobot, I am puzzled because it's there. I am going to cut everything non-essential out to isolate the problem tonight and see what it is really complaining.
|
|
#4
|
||||
|
||||
|
Re: Help interpreting load time error
Cool. If I can help any more, feel free to post here or PM me.
|
|
#5
|
|||
|
|||
|
Re: Help interpreting load time error
The reason the compiler (it's actually the linker that would complain) is not giving you an error is that VxWorks links at load time instead of requiring a stub library for external linkage. Any symbols that are not defined when building are simply assumed to exist in the environment that you program will load in. If that does not hold true, you get errors from the loader.
|
|
#6
|
||||
|
||||
|
Re: Help interpreting load time error
I see. That makes sense now. So according to the linker error, am I missing the constructor of TrcRobot then?
|
|
#7
|
|||
|
|||
|
Re: Help interpreting load time error
No... it's not the constructor. It's the vtable and the typeinfo.
If you run the tool C:\WindRiver\gnu\3.4.4-vxworks-6.3\x86-win32\bin\c++filtppc.exe and pass in the mangled name, it will tell you what it is in plain text. |
|
#8
|
||||
|
||||
|
Re: Help interpreting load time error
Yes, you are right, it is the typeinfo and vtable. But what does it mean if these symbols are missing? TrcRobot is the base class of MyRobot. Why would the vtable of the TrcRobot be missing?
|
|
#9
|
|||
|
|||
|
Re: Help interpreting load time error
Quote:
-Joe |
|
#10
|
||||
|
||||
|
Re: Help interpreting load time error
Yes, I found it out yesterday. I thought I had an empty destructor defined but I missed that one. Thanks for the help.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Resolve load conflict error ? | ferc | Programming | 1 | 15-01-2010 21:16 |
| Help getting C++ program to load | tgwicklund | C/C++ | 4 | 02-02-2009 23:24 |
| **FIRST EMAIL**/Important Pit Load In and Load Out Information | Mark McLeod | FIRST E-Mail Blast Archive | 7 | 11-04-2008 08:16 |
| HELP!!!!! Taigene motor load | DPTeam270Driver | Motors | 40 | 12-02-2008 10:53 |
| 180:Error: syntax error help! | seanl | Programming | 8 | 04-02-2007 11:31 |