Go to Post Well, it's officially that part of the offseason where we all lose our minds again. - Whippet [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 Rating: Thread Rating: 5 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 17-02-2012, 01:32
Andrew Schreiber Andrew Schreiber is offline
Data Nerd
FRC #0079
 
Join Date: Jan 2005
Rookie Year: 2000
Location: Misplaced Michigander
Posts: 4,057
Andrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond repute
Warning: module holds reference to undefined symbol

While using Command Based Robot code I am getting the following error for each of my SubSystems

Warning: module [what I guess is an address in the symbol table] holds reference to undefined symbol [some number]CommandBase[Hex Value][name of symbol]

It then unloads the FRC_UserProgram.out causing a "No Robot Code" error.

Now the weird part, on a whim I changed the reference name (via the refactor menu) to something different. The error never changed. I searched for every instance the old name and none were found. This makes me question whether the updated code is being put onto the robot.

Any advice is appreciated.
__________________




.
Reply With Quote
  #2   Spotlight this post!  
Unread 17-02-2012, 06:55
wireties's Avatar
wireties wireties is offline
Principal Engineer
AKA: Keith Buchanan
FRC #1296 (Full Metal Jackets)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2004
Location: Rockwall, TX
Posts: 1,169
wireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond repute
Send a message via AIM to wireties
Re: Warning: module holds reference to undefined symbol

Quote:
Originally Posted by Andrew Schreiber View Post
While using Command Based Robot code I am getting the following error for each of my SubSystems

Warning: module [what I guess is an address in the symbol table] holds reference to undefined symbol [some number]CommandBase[Hex Value][name of symbol]

It then unloads the FRC_UserProgram.out causing a "No Robot Code" error.

Now the weird part, on a whim I changed the reference name (via the refactor menu) to something different. The error never changed. I searched for every instance the old name and none were found. This makes me question whether the updated code is being put onto the robot.

Any advice is appreciated.
I'm not sure what help I can be - we don't use the command-based robot code. No doubt you know this but for the students out there - when we load kernel modules we use a dynamic linking loader but it is a single pass linker unlike the multi-pass linker we use to combine object modules and libraries form the command line. The process is much like loading a kernel module in Linux or a dynamic driver in Solaris.

So you are loading a kernel module that has a symbol in it that cannot be resolved against the symbol tables of all modules (and the kernel) already in memory. From your description, the symbol is a mangled C++ symbol.

When you build the command-based code, do you need to pre-link a library with your application code (with a -l parameter on the linker command line)? I will look at the command-based stuff and get back to you.

HTH
__________________
Fast, cheap or working - pick any two!
Reply With Quote
  #3   Spotlight this post!  
Unread 17-02-2012, 07:05
wireties's Avatar
wireties wireties is offline
Principal Engineer
AKA: Keith Buchanan
FRC #1296 (Full Metal Jackets)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2004
Location: Rockwall, TX
Posts: 1,169
wireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond repute
Send a message via AIM to wireties
Re: Warning: module holds reference to undefined symbol

The command-based robot does not link to any extra libraries, only to WPILib.a, so that is not the problem. Do you include a customized version of CommandBase.cpp in your project? I see that class has 3 static members - init, OI and examplesubsystem)? Do you have instances of all 3 declared somewhere?
__________________
Fast, cheap or working - pick any two!
Reply With Quote
  #4   Spotlight this post!  
Unread 17-02-2012, 09:00
Andrew Schreiber Andrew Schreiber is offline
Data Nerd
FRC #0079
 
Join Date: Jan 2005
Rookie Year: 2000
Location: Misplaced Michigander
Posts: 4,057
Andrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond repute
Re: Warning: module holds reference to undefined symbol

Quote:
Originally Posted by wireties View Post
The command-based robot does not link to any extra libraries, only to WPILib.a, so that is not the problem. Do you include a customized version of CommandBase.cpp in your project? I see that class has 3 static members - init, OI and examplesubsystem)? Do you have instances of all 3 declared somewhere?
CommandBase.cpp has been modified to look like:

Code:
#include "CommandBase.h"

#include "Commands/Scheduler.h"


CommandBase::CommandBase(const char *name) : Command(name) {
}

CommandBase::CommandBase() : Command() {
}

// Initialize a single static instance of all of your subsystems to NULL
OI* CommandBase::oi = NULL;
DriveTrain *CommandBase::chassis = NULL;
Elevator *CommandBase::elevator = NULL;
Intake *CommandBase::intake = NULL;
Shooter *CommandBase::shooter = NULL;

void CommandBase::init() {
    // Create a single static instance of all of your subsystems. The following
	// line should be repeated for each subsystem in the project.
	//examplesubsystem = new ExampleSubsystem();
	chassis = new DriveTrain();
	elevator = new Elevator();
	intake = new Intake();
	shooter = new Shooter();
	
	oi = new OI();
}
Code:
#ifndef COMMAND_BASE_H
#define COMMAND_BASE_H

#include "Commands/Command.h"
#include "Subsystems/DriveTrain.h"
#include "Subsystems/Elevator.h"
#include "Subsystems/Intake.h"
#include "Subsystems/Shooter.h"
#include "OI.h"


/**
 * The base for all commands. All atomic commands should subclass CommandBase.
 * CommandBase stores creates and stores each control system. To access a
 * subsystem elsewhere in your code in your code use CommandBase.examplesubsystem
 */
class CommandBase: public Command {
public:
	CommandBase(const char *name);
	CommandBase();
	static void init();
	// Create a single static instance of all of your subsystems
	static DriveTrain *chassis;
	static Elevator *elevator;
	static Intake *intake;
	static Shooter *shooter;
	static OI *oi;
};

#endif
__________________




.
Reply With Quote
  #5   Spotlight this post!  
Unread 17-02-2012, 09:23
wireties's Avatar
wireties wireties is offline
Principal Engineer
AKA: Keith Buchanan
FRC #1296 (Full Metal Jackets)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2004
Location: Rockwall, TX
Posts: 1,169
wireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond repute
Send a message via AIM to wireties
Re: Warning: module holds reference to undefined symbol

That looks correct to me. Are all your subsystem classes complete or stubbed out?

Maybe try commenting out your additions till the module will load?
__________________
Fast, cheap or working - pick any two!
Reply With Quote
  #6   Spotlight this post!  
Unread 17-02-2012, 09:33
Andrew Schreiber Andrew Schreiber is offline
Data Nerd
FRC #0079
 
Join Date: Jan 2005
Rookie Year: 2000
Location: Misplaced Michigander
Posts: 4,057
Andrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond repute
Re: Warning: module holds reference to undefined symbol

Quote:
Originally Posted by wireties View Post
That looks correct to me. Are all your subsystem classes complete or stubbed out?

Maybe try commenting out your additions till the module will load?
They are indeed all stubbed out, the Create New SubSystem option in the context menu on the project tends to create fully stubbed out subclass of SubSystem.

I attempted the commenting out solution, none of the modules would load.
__________________




.
Reply With Quote
  #7   Spotlight this post!  
Unread 17-02-2012, 09:38
Jared Russell's Avatar
Jared Russell Jared Russell is offline
Taking a year (mostly) off
FRC #0254 (The Cheesy Poofs), FRC #0341 (Miss Daisy)
Team Role: Engineer
 
Join Date: Nov 2002
Rookie Year: 2001
Location: San Francisco, CA
Posts: 3,077
Jared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond repute
Re: Warning: module holds reference to undefined symbol

In this thread from a couple years ago the poster had a similar problem. For him, doing a clean reinstallation of WindRiver and all the updates fixed the issue. I would try installing WindRiver to its default directory for good measure.
Reply With Quote
  #8   Spotlight this post!  
Unread 17-02-2012, 09:40
wireties's Avatar
wireties wireties is offline
Principal Engineer
AKA: Keith Buchanan
FRC #1296 (Full Metal Jackets)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2004
Location: Rockwall, TX
Posts: 1,169
wireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond repute
Send a message via AIM to wireties
Re: Warning: module holds reference to undefined symbol

Time to check with the author I reckon - perhaps try the nmppc utility and see if you can identify the unmangled symbol name? Is the 4 Feb update required to support the command-based templates? And if so, is your development environment up to date?
__________________
Fast, cheap or working - pick any two!
Reply With Quote
  #9   Spotlight this post!  
Unread 17-02-2012, 09:44
wireties's Avatar
wireties wireties is offline
Principal Engineer
AKA: Keith Buchanan
FRC #1296 (Full Metal Jackets)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2004
Location: Rockwall, TX
Posts: 1,169
wireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond repute
Send a message via AIM to wireties
Re: Warning: module holds reference to undefined symbol

Quote:
Originally Posted by Andrew Schreiber View Post
They are indeed all stubbed out, the Create New SubSystem option in the context menu on the project tends to create fully stubbed out subclass of SubSystem.
Where in the project do you right-click? I don't see the "Create New SubSystem" option.
__________________
Fast, cheap or working - pick any two!
Reply With Quote
  #10   Spotlight this post!  
Unread 17-02-2012, 09:45
Andrew Schreiber Andrew Schreiber is offline
Data Nerd
FRC #0079
 
Join Date: Jan 2005
Rookie Year: 2000
Location: Misplaced Michigander
Posts: 4,057
Andrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond reputeAndrew Schreiber has a reputation beyond repute
Re: Warning: module holds reference to undefined symbol

Quote:
Originally Posted by wireties View Post
Where in the project do you right-click? I don't see the "Create New SubSystem" option.
There is additional software you have to install (see the WPILib Cookbook for instructions). You click on the project name.
__________________




.
Reply With Quote
  #11   Spotlight this post!  
Unread 17-02-2012, 10:11
wireties's Avatar
wireties wireties is offline
Principal Engineer
AKA: Keith Buchanan
FRC #1296 (Full Metal Jackets)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2004
Location: Rockwall, TX
Posts: 1,169
wireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond repute
Send a message via AIM to wireties
Re: Warning: module holds reference to undefined symbol

Hey - we do something like this but it is all home brewed. It cleanly separates the behaviors into classes/tasks though and uses a message passing mechanism to isolate each function. It makes life much easier for the student programmers, they can focus on simple tasks as if they were a single program.

PM me an e-mail address and we'd be glad to share the current code with you.
__________________
Fast, cheap or working - pick any two!
Reply With Quote
  #12   Spotlight this post!  
Unread 06-02-2013, 19:26
scottbot95 scottbot95 is offline
Registered User
FRC #1388 (Eagle Robotics)
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2010
Location: Arroyo Grande, CA
Posts: 46
scottbot95 is an unknown quantity at this point
Re: Warning: module holds reference to undefined symbol

have you declared all the static members somewhere other than the class definition? it's a dumb problem with c++ but if you dont, the compiler wont actually create a symbol for the static class member.
Reply With Quote
  #13   Spotlight this post!  
Unread 07-02-2013, 00:57
bob.wolff68's Avatar
bob.wolff68 bob.wolff68 is offline
Da' Mentor Man
FRC #1967
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2007
Location: United States
Posts: 157
bob.wolff68 is just really nicebob.wolff68 is just really nicebob.wolff68 is just really nicebob.wolff68 is just really nicebob.wolff68 is just really nice
Re: Warning: module holds reference to undefined symbol

I'll throw my 2 cents in. We've had some whacky problem in the past which were never fully explained, but sometimes doing a Project->Clean... will rinse out the garbage and get you back to sanity. I would suggest doing it as there should be no ill effects from a clean at all and only potential up-side.

bob
__________________
~~~~~~~~~~~~~~~~~~~
Bob Wolff - Software from the old-school
Mentor / C / C++ guy
Team 1967 - The Janksters - San Jose, CA
Reply With Quote
  #14   Spotlight this post!  
Unread 10-02-2013, 02:59
enrique's Avatar
enrique enrique is offline
Registered User
FRC #1251 (Tech Tigers)
Team Role: Electrical
 
Join Date: Jan 2010
Rookie Year: 2010
Location: Florida
Posts: 87
enrique will become famous soon enough
Send a message via Yahoo to enrique
Re: Warning: module holds reference to undefined symbol

I'm having the same error. I thought it was because of a class I made for a sensor, but I removed the class and the error continues. Warning: module holds reference to undefined symbol round. In debug I get the screen attached.
Attached Thumbnails
Click image for larger version

Name:	error1.jpg
Views:	17
Size:	47.5 KB
ID:	13912  
Reply With Quote
  #15   Spotlight this post!  
Unread 10-02-2013, 10:46
enrique's Avatar
enrique enrique is offline
Registered User
FRC #1251 (Tech Tigers)
Team Role: Electrical
 
Join Date: Jan 2010
Rookie Year: 2010
Location: Florida
Posts: 87
enrique will become famous soon enough
Send a message via Yahoo to enrique
Re: Warning: module holds reference to undefined symbol

Don't know if this helps, but on my error it had to do with the math.h include. Even though winriver has it and it has the round feature. I think the crio has something different. Either ways I made my own round function and it worked fine. Your error is wpilib related. I'm thinking maybe if you run the winriver update and format the crio, maybe the wpilibs will be in sync.
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 12:43.

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