Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   C/C++ (http://www.chiefdelphi.com/forums/forumdisplay.php?f=183)
-   -   Build of GearsBotDemo fails, but only for linux_simulate target (http://www.chiefdelphi.com/forums/showthread.php?t=153489)

mlaga97 11-01-2017 19:38

Build of GearsBotDemo fails, but only for linux_simulate target
 
I have installed the frc toolchain, eclipse, frc plugins, and frcsim using the 2017 instructions on Ubuntu 16.04.

I loaded the example project GearsBotDemo in Eclipse and I am able to successfully build the project for the default target.

My issue is that when I attempt to build the linux_simulate target, the build fails at the linking stage with an error message consisting of several variants of the following:

./src/Subsystems/Claw.o: In function `Claw::Claw()':
/home/myusername/workspace/WPILib/GearsBot/linux_simulate/../src/Subsystems/Claw.cpp:6: undefined reference to `frc::Subsystem::Subsystem(std::__cxx11::basic_str ing<char, std::char_traits<char>, std::allocator<char> > const&)'
makefile:47: recipe for target 'FRCUserProgram' failed
./src/Subsystems/Claw.o:(.rodata._ZTV4Claw[_ZTV4Claw]+0x78): undefined reference to `frc::Subsystem::GetName[abi:cxx11]() const'
./src/Subsystems/Claw.o:(.rodata._ZTV4Claw[_ZTV4Claw]+0x90): undefined reference to `frc::Subsystem::GetSmartDashboardType[abi:cxx11]() const'
./src/Subsystems/Claw.o:(.rodata._ZTV4Claw[_ZTV4Claw]+0xa8): undefined reference to `non-virtual thunk to frc::Subsystem::InitTable(std::shared_ptr<ITable>) '
./src/Subsystems/Claw.o:(.rodata._ZTV4Claw[_ZTV4Claw]+0xb0): undefined reference to `non-virtual thunk to frc::Subsystem::GetTable() const'
./src/Subsystems/Claw.o:(.rodata._ZTV4Claw[_ZTV4Claw]+0xb8): undefined reference to `non-virtual thunk to frc::Subsystem::GetSmartDashboardType() const'
./src/Subsystems/Claw.o:(.rodata._ZTV4Claw[_ZTV4Claw]+0xc0): undefined reference to `non-virtual thunk to frc::Subsystem::GetName() const'


The only thing tying all of them together are that they are all members of the frc namespace.

Any help would be greatly appreciated.

Thad House 12-01-2017 13:08

Re: Build of GearsBotDemo fails, but only for linux_simulate target
 
Quote:

Originally Posted by mlaga97 (Post 1629614)
I have installed the frc toolchain, eclipse, frc plugins, and frcsim using the 2017 instructions on Ubuntu 16.04.

I loaded the example project GearsBotDemo in Eclipse and I am able to successfully build the project for the default target.

My issue is that when I attempt to build the linux_simulate target, the build fails at the linking stage with an error message consisting of several variants of the following:

SNIP

The only thing tying all of them together are that they are all members of the frc namespace.

Any help would be greatly appreciated.

I think that is an issue of GCC 5 being used by default on 16.04, whereas our build system uses 4.9 to build the libraries. Try adding the following line to to the top of every source file in your code, above any includes.

#define _GLIBCXX_USE_CXX11_ABI 0

I haven't tested that, but I have a hunch.

mlaga97 12-01-2017 14:59

Re: Build of GearsBotDemo fails, but only for linux_simulate target
 
After those changes are made, the build then fails at the linking stage with the following error:

Code:

g++ -L/usr/lib/x86_64-linux-gnu -L/home/myusername/wpilib/simulation/lib -Wl,-rpath,/opt/GenICam_v3_0_NI/bin/Linux32_ARM -Xlinker -rpath /home/luc_lagarde/wpilib/simulation/lib -o "FRCUserProgram"  ./src/Subsystems/Claw.o ./src/Subsystems/DriveTrain.o ./src/Subsystems/Elevator.o ./src/Subsystems/Wrist.o  ./src/Commands/Autonomous.o ./src/Commands/CloseClaw.o ./src/Commands/DriveStraight.o ./src/Commands/OpenClaw.o ./src/Commands/Pickup.o ./src/Commands/Place.o ./src/Commands/PrepareToPickup.o ./src/Commands/SetDistanceToBox.o ./src/Commands/SetElevatorSetpoint.o ./src/Commands/SetWristSetpoint.o ./src/Commands/TankDriveWithJoystick.o  ./src/OI.o ./src/Robot.o  -lwpilibcSim -lgz_msgs -lntcore -lgazebo_client -lboost_system
/home/myusername/wpilib/simulation/lib/libwpilibcSim.so: undefined reference to `gazebo::transport::Publisher::Publisher(std::string const&, std::string const&, unsigned int, double)'
/home/myusername/wpilib/simulation/lib/libwpilibcSim.so: undefined reference to `gazebo::transport::Node::DecodeTopicName(std::string const&)'
/home/myusername/wpilib/simulation/lib/libwpilibcSim.so: undefined reference to `google::protobuf::MessageLite::ParseFromString(std::string const&)'
/home/myusername/wpilib/simulation/lib/libwpilibcSim.so: undefined reference to `gazebo::transport::Node::Init(std::string const&)'
/home/myusername/wpilib/simulation/lib/libwpilibcSim.so: undefined reference to `gazebo::transport::ConnectionManager::Advertise(std::string const&, std::string const&)'
/home/myusername/wpilib/simulation/lib/libwpilibcSim.so: undefined reference to `google::protobuf::internal::kEmptyString'
/home/myusername/wpilib/simulation/lib/libwpilibcSim.so: undefined reference to `gazebo::transport::TopicManager::UpdatePublications(std::string const&, std::string const&)'
/home/myusername/wpilib/simulation/lib/libwpilibcSim.so: undefined reference to `gazebo::common::Exception::Exception(char const*, int, std::string)'
/home/myusername/wpilib/simulation/lib/libwpilibcSim.so: undefined reference to `gazebo::transport::TopicManager::FindPublication(std::string const&)'

Any ideas? I appreciate your help.


All times are GMT -5. The time now is 13:31.

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