Go to Post TIME is the one commodity you cannot buy more of. - Andy Brockway [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 20-01-2013, 09:57
kenfox kenfox is offline
Registered User
FRC #3322 (Eagle Imperium)
Team Role: Mentor
 
Join Date: Jan 2013
Rookie Year: 2013
Location: Ann Arbor, MI
Posts: 52
kenfox is a glorious beacon of lightkenfox is a glorious beacon of lightkenfox is a glorious beacon of lightkenfox is a glorious beacon of lightkenfox is a glorious beacon of light
No Robot Code may be caused by link error

We had a problem running C++ code on the robot. The project built and deployed without errors. We could FTP to the cRIO and verify the out file matched what we deployed. The driver station had communication, but did not have robot code.

The problem was a declared but undefined static class variable that prevented VxWorks from loading the out file. Link errors don't appear to be logged anywhere. I couldn't see the error in Net Console.

We found the problem by setting up a debug target and running in debug mode. The instructions at http://wpilib.screenstepslive.com/s/...-robot-program worked great. When WindRiver tried to attach to our code, it showed an error dialog with the name of the undefined variable. It was name mangled, but pretty easy to figure out. The program "c++filtppc" will unmangle names for you if you can't figure out the C++ variable from the mangled name.

Here's an example of a static class variable declaration (in the h file):
Code:
class MyRobot: public IterativeRobot {
public:
  static MySubsystem* mySubsystem;
};
And here's the definition that we were missing (in the cpp file):
Code:
MySubsystem* MyRobot::mySubsystem = 0;
Hope this helps someone!
Reply With Quote
 


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 07:31.

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