ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

C++ compiler crashed

asked 2013-11-03 16:43:56 -0600

FuerteNewbie gravatar image

updated 2013-12-12 20:11:15 -0600

tfoote gravatar image
In file included from /usr/include/c++/4.6/ostream:588:0,
                 from /usr/include/c++/4.6/iostream:40,
                 from /opt/ros/fuerte/include/ros/time.h:54,
                 from /opt/ros/fuerte/include/ros/ros.h:38,
                 from /home/weiyang/fuerte_workspace/sandbox/flight/src/qnode.cpp:13:
/usr/include/c++/4.6/bits/ostream.tcc:150:1: error: missing terminating " character
In file included from /usr/include/c++/4.6/ostream:588:0,
                 from /usr/include/c++/4.6/iostream:40,
                 from /opt/ros/fuerte/include/ros/time.h:54,
                 from /opt/ros/fuerte/include/ros/ros.h:38,
                 from /home/weiyang/fuerte_workspace/sandbox/flight/src/qnode.cpp:13:
/usr/include/c++/4.6/bits/ostream.tcc:151:9: error: template declaration of ‘std::basic_ostream<_CharT, _Traits>& std::put’
/usr/include/c++/4.6/bits/ostream.tcc:151:9: error: ‘char_type’ was not declared in this scope

For some reason, the error above happened, and I try to solve by editing this line


and after I tried to make my package again and these happen.

c++: internal compiler error: Segmentation fault (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.6/README.Bugs> for instructions.
make[3]: *** [CMakeFiles/flight.dir/src/qnode.o] Error 4
make[3]: Leaving directory `/home/weiyang/fuerte_workspace/sandbox/flight/build'
make[2]: *** [CMakeFiles/flight.dir/all] Error 2
make[2]: Leaving directory `/home/weiyang/fuerte_workspace/sandbox/flight/build'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/weiyang/fuerte_workspace/sandbox/flight/build'
make: *** [all] Error 2

Anyone encounter this before? I've tried to google and some people explains this as a compiler crash. The solution is to get a new compiler which I don't really understand how. Please help thanks.

qnode.cpp I believe that should be nothing wrong because I was just editing a small part of the code.

 * @file /include/flight/qnode.hpp
 * @brief Communications central!
 * @date February 2011
** Ifdefs

#ifndef flight_QNODE_HPP_
#define flight_QNODE_HPP_

** Includes

#include <ros/ros.h>
#include <string>
#include <QThread>
#include "../../flightPanel/msg_gen/cpp/include/flightPanel/flightCommand.h"
#include "../../px-ros-pkg/px_comm/msg_gen/cpp/include/px_comm/OpticalFlow.h"
#include "geometry_msgs/Pose2D.h"
#include "flight/flightFeedback.h"
#include "AltitudeControl.hpp"
#include "RollControl.hpp"
#include "PitchControl.hpp"
#include "YawControl.hpp"
#include "Timer.hpp"
#include "Serial.hpp"
#include "state.hpp"
#include <sensor_msgs/Image.h>

** Namespaces

namespace flight {

** Class

class QNode : public QThread {

   QNode( int argc, char** argv );
   virtual ~QNode();
   bool init();
   bool init( const std::string &master_url, const std::string &host_url );
   void run();
   float rcAmplitude;

   void rosShutdown();

   int init_argc;
   char** init_argv;
   ros::Publisher chatter_publisher;
   ros::Subscriber commandMsg;
   ros::Subscriber opticalFlowMsg;
   ros::Subscriber depthMsg;
   ros::Subscriber geometryMsg;
   flight::flightFeedback feedbackMsg;

   void parseCommand( const flightPanel::flightCommand::ConstPtr& msg );
   int parseInt( const flightPanel::flightCommand::ConstPtr& msg, int i );
   float parseFloat( const flightPanel::flightCommand::ConstPtr& msg, int i );
   void parseOpticalFlow( const px_comm::OpticalFlow::ConstPtr& msg );
   void parseDepth( const sensor_msgs::Image ...
edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2013-11-03 16:49:05 -0600

Bill Smart gravatar image

updated 2013-11-03 16:49:50 -0600

You should never, ever edit the system files, especially for the compiler. The problem is probably being caused by some line before line 13 in your qnode.cpp file, but not actually causing an error until that file is included. My guess is that you're not closing a quote in one of the files you include before line 13, or not closing a quote on an include directive.

Don't forget to undo your changes to the system file.

edit flag offensive delete link more


qnode.cpp is added, I already undo the changes, and I think there should be no problem to my .cpp file.

FuerteNewbie gravatar image FuerteNewbie  ( 2013-11-03 16:56:50 -0600 )edit

Hmmm. It seems that the error is being triggered by the inclusion of ros.h, which is odd, since it's the first real line of code. Can you compile other things that include ros.h?

Bill Smart gravatar image Bill Smart  ( 2013-11-03 22:51:09 -0600 )edit

Randomly, I noticed that the code claims to be a header file (.hpp), but the error was generated by a source file (.cpp). Shouldn't make a difference for your error, though.

Bill Smart gravatar image Bill Smart  ( 2013-11-03 22:53:54 -0600 )edit

Can't compile everything that include ros.h. I believe that ostream.tcc is the main problem as every file included is pointing backward from qnode > ros,h > time.h > iostream > ostream and eventually go to ostream.tcc line 150:1. /usr/include/c++/4.6/bits/ostream.tcc:150:1: error: missing terminating " character

FuerteNewbie gravatar image FuerteNewbie  ( 2013-11-04 13:36:23 -0600 )edit

Try reinstalling the compiler, perhaps, to make sure that your files are correct?

Bill Smart gravatar image Bill Smart  ( 2013-11-04 14:42:31 -0600 )edit

Yes I was thinking that too, can C++ be installed like python?

FuerteNewbie gravatar image FuerteNewbie  ( 2013-11-04 15:03:30 -0600 )edit

Do replacing my package solve this problem? It seems like the system file had been 'infected'.

FuerteNewbie gravatar image FuerteNewbie  ( 2013-11-04 15:05:36 -0600 )edit

You should use whatever graphical package manager your distribution supports to reinstall g++. That should replace all of the compiler files to their original state.

Bill Smart gravatar image Bill Smart  ( 2013-11-05 18:01:03 -0600 )edit

Question Tools

1 follower


Asked: 2013-11-03 16:43:56 -0600

Seen: 966 times

Last updated: Nov 04 '13