Go to Post Thanks everyone for being so positive- this just reaffirms why I love F.I.R.S.T. and volunteer my time to this program and the awesome students involved! - Weightmn [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

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 21-04-2013, 23:55
Toa Circuit's Avatar
Toa Circuit Toa Circuit is offline
Thaddeus Maximus
AKA: Thad Hughes
FRC #4213 (MetalCow Robotics)
Team Role: Leadership
 
Join Date: Nov 2012
Rookie Year: 2012
Location: Shirley, IL
Posts: 131
Toa Circuit is an unknown quantity at this point
Question Code failing to load (Undefined symbol)

I recently ran into a very weird... bug? glitch? Here's the rundown:

1. When trying to deploy this code: https://bitbucket.org/teammetalcow/2013offseason/src it deploys 100% okay, but after reboot, we get a "No Robot Code" on the DS, as well as a message saying it failed to load, with a NetConsole message that there was an "Undefined reference to _ZN11VectorDrive3kPyE.". I had edited the file (Subsystems/VectorDrive.h) which has the VectorDrive class in it, but only added a minus sign in line 140. I'm confused as to how that could cause this error.

2. Any other code/program works fine.

3. Reverting back to without the minus does not change anything. (I think that's all I changed.)

4. A clean build does not change anything.

5. Creating a new project and copying over source does not change anything.

6. Formatting the cRIO does not change anything.

7. Deploying straight to cRIO/Over Ethernet/over WiFi does not change anything.

I'm extremely baffled. I would be overhauling the code I changed tomorrow anyways, I will see if that fixes my problems. But this is an extremely confusing problem. Has anyone ever had such an issue before?

EDIT:
Fixed it by overhauling the code that was changed.
I'm still baffled over this, though.
__________________

2012 Head of Programming and Electrical
2013-14 Overall Team Captain and Programming Head
2012-14 Mentor of FLL Team Power Surge
2014 Dean's List Finalist
2014 CIR Xerox Creativity Award
Webpage

Last edited by Toa Circuit : 22-04-2013 at 11:57. Reason: Fixed problem
Reply With Quote
  #2   Spotlight this post!  
Unread 23-04-2013, 11:40
DjScribbles DjScribbles is offline
Programming Mentor
AKA: Joe S
FRC #2474 (Team Excel)
Team Role: Mentor
 
Join Date: Oct 2011
Rookie Year: 2012
Location: Niles MI
Posts: 284
DjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to beholdDjScribbles is a splendid one to behold
Re: Code failing to load (Undefined symbol)

The probable cause is that the compiler in windriver for vxWorks is very permissive of function names (and class names?) at compile time, and doesn't give a warning or error when it doesn't see a function you are referring to; instead it assumes that the function will be available at runtime on the cRio.

The result is that if you call functions (not methods of classes, which IIRC do get checked, since they are scope limited, but don't quote me on that), but have spelling/case errors, the compiler assumes it is an intentional reference to something it doesn't know about. In other cases, calling general library functions (such as itof) can cause this, since the library isn't on the cRio.

When you encounter this from an innocuous change, look at what has changed very carefully, and look at what may have changed in your runtime code path as the result of the change, since the problem could be in code you've had for a while, but don't typically call.

Last edited by DjScribbles : 23-04-2013 at 11:45.
Reply With Quote
  #3   Spotlight this post!  
Unread 23-04-2013, 12:46
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,572
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: Code failing to load (Undefined symbol)

Theres a few different methods for tracking this down in the following thread: http://www.chiefdelphi.com/forums/sh...d.php?t=114080
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 14:36.

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