This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

I have an "Internal compiler error"...


Hi!

I am prety much a newbie and I was trying to compile KOffice
(koffice.kde.org) with Qt 1.42 and egcs 1.0.3. After days of installing
what is required by KOffice, I got the following error-message while
compiling (make) it:

make[3]: Entering directory `/temp/koffice/kdiagramm'
g++ -DHAVE_CONFIG_H -I. -I. -I.. -I/usr/local/include/python1.5
-I/usr/local/include -I../lib -I../lib/kofficeui -I../lib/kofficeui
-I../lib/kofficecore -I../lib/kofficecore -I../lib/koml -I../lib/koml
-I../lib/store -I../lib/store -I../lib/interfaces -I/opt/kde/include
-I/usr/lib/qt/include  -I/usr/X11R6/include -I/opt/kde/include/idl   
-O2 -Wall -c kdiagramm_main.cc
g++ -DHAVE_CONFIG_H -I. -I. -I.. -I/usr/local/include/python1.5
-I/usr/local/include -I../lib -I../lib/kofficeui -I../lib/kofficeui
-I../lib/kofficecore -I../lib/kofficecore -I../lib/koml -I../lib/koml
-I../lib/store -I../lib/store -I../lib/interfaces -I/opt/kde/include
-I/usr/lib/qt/include  -I/usr/X11R6/include -I/opt/kde/include/idl   
-O2 -Wall -c kdiagramm_shell.cc
g++ -DHAVE_CONFIG_H -I. -I. -I.. -I/usr/local/include/python1.5
-I/usr/local/include -I../lib -I../lib/kofficeui -I../lib/kofficeui
-I../lib/kofficecore -I../lib/kofficecore -I../lib/koml -I../lib/koml
-I../lib/store -I../lib/store -I../lib/interfaces -I/opt/kde/include
-I/usr/lib/qt/include  -I/usr/X11R6/include -I/opt/kde/include/idl   
-O2 -Wall -c kdiagramm_doc.cc
g++ -DHAVE_CONFIG_H -I. -I. -I.. -I/usr/local/include/python1.5
-I/usr/local/include -I../lib -I../lib/kofficeui -I../lib/kofficeui
-I../lib/kofficecore -I../lib/kofficecore -I../lib/koml -I../lib/koml
-I../lib/store -I../lib/store -I../lib/interfaces -I/opt/kde/include
-I/usr/lib/qt/include  -I/usr/X11R6/include -I/opt/kde/include/idl   
-O2 -Wall -c kdiagramm.cc
g++ -DHAVE_CONFIG_H -I. -I. -I.. -I/usr/local/include/python1.5
-I/usr/local/include -I../lib -I../lib/kofficeui -I../lib/kofficeui
-I../lib/kofficecore -I../lib/kofficecore -I../lib/koml -I../lib/koml
-I../lib/store -I../lib/store -I../lib/interfaces -I/opt/kde/include
-I/usr/lib/qt/include  -I/usr/X11R6/include -I/opt/kde/include/idl   
-O2 -Wall -c kdiagramm_view.cc
g++ -DHAVE_CONFIG_H -I. -I. -I.. -I/usr/local/include/python1.5
-I/usr/local/include -I../lib -I../lib/kofficeui -I../lib/kofficeui
-I../lib/kofficecore -I../lib/kofficecore -I../lib/koml -I../lib/koml
-I../lib/store -I../lib/store -I../lib/interfaces -I/opt/kde/include
-I/usr/lib/qt/include  -I/usr/X11R6/include -I/opt/kde/include/idl   
-O2 -Wall -c KChartBarsPainter.cpp
KChartBarsPainter.cpp: In method `void KChartBarsPainter::drawData(class
QPainter *, struct table_t *)':
KChartBarsPainter.cpp:150: Internal compiler error.
KChartBarsPainter.cpp:150: Please submit a full bug report to
`egcs-bugs@cygnus.com'.
make[3]: *** [KChartBarsPainter.o] Error 1
make[3]: Leaving directory `/temp/koffice/kdiagramm'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/temp/koffice/kdiagramm'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/temp/koffice'
make: *** [all-recursive-am] Error 2
bash#

I have attached the files KChartBarsPainter.cpp and KChartBarsPainter.h.
Write me if this is somehow important and you need more stuff or
something :-)

Thank You,
	ben

-- 
The real danger is not that computer could start to think like men, but
that men could begin to think like computers. - H. Eves
/* $Id: KChartBarsPainter.h,v 1.1 1998/05/27 11:41:14 kalle Exp $ */

#ifndef _KCHARTBARSPAINTER_H
#define _KCHARTBARSPAINTER_H

#include "KChartAxesPainter.h"

class KChart;
class QPainter;

class KChartBarsPainter : public KChartAxesPainter
{
public:
  KChartBarsPainter( KChart* chart );
  ~KChartBarsPainter();

  virtual void drawData( QPainter* painter );

private:
};

#endif
/* $Id: KChartBarsPainter.cpp,v 1.2 1998/05/29 20:35:20 kalle Exp $ */

#include "KChartBarsPainter.h"
#include "KChart.h"
#include "KChartData.h"

#include <qpainter.h>

#include <math.h> // rint

KChartBarsPainter::KChartBarsPainter( KChart* chart ) :
  KChartAxesPainter( chart )
{
}


KChartBarsPainter::~KChartBarsPainter()
{
}

void KChartBarsPainter::drawData( QPainter* painter )
{
  int left = 0, right = 0;

  if( ( _chart->_overwrite == InFront ) || ( _chart->_overwrite == OnTop ) ) {
	// loop over positions
	for( uint i = 0; i <= _chart->chartData()->maxPos(); i++ ) {
	  int bottom = _chart->_zeropoint;

	  // loop over datasets
	  for( int dataset = 0; dataset < _chart->chartData()->numDatasets(); 
		   dataset++ ) {
		// Don't draw anything if there is no point defined
		if( !_chart->chartData()->hasYValue( dataset, i ) )
		  continue;

		// Choose a colour for the dataset being drawn
		QColor datacolor = chooseDataColor( dataset );
		painter->setPen( datacolor );
		// Create two brushes for filled and non-filled rectangles
		QBrush filledbrush( datacolor, SolidPattern );
		QBrush emptybrush( datacolor, NoBrush );
		
		// get coordinates of top and center of bar
		QPoint xpt = valToPixel( i+1, 
								 _chart->chartData()->yValue( dataset, i ), 
								 dataset );

		// calculate left and right of bar
		int left = xpt.x() - (int)rint( _chart->_xstep/2 );
		int right = xpt.x() + (int)rint( _chart->_xstep/2 );
		
		// calculate new top
		int t = xpt.y();
		if( _chart->_overwrite == OnTop )
		  t -= _chart->_zeropoint - bottom;
		xpt.setY( t );

		// draw the bar
		if( _chart->chartData()->yValue( dataset, i ) >= 0 ) {
		  QRect rect( QPoint( left, xpt.y() ), QPoint( right, bottom ) );
		  painter->setBrush( filledbrush );
		  painter->setPen( datacolor );
		  painter->drawRect( rect );
		  painter->setBrush( emptybrush );
		  painter->setPen( _chart->_accentcolor );
		  painter->drawRect( rect );
		} else {
		  QRect rect( QPoint( left, bottom ), QPoint( right, xpt.y() ) );
		  painter->setBrush( filledbrush );
		  painter->setPen( datacolor );
		  painter->drawRect( rect );
		  painter->setBrush( emptybrush );
		  painter->setPen( _chart->_accentcolor );
		}

		// reset bottom to the top
		if( _chart->_overwrite == OnTop )
		  bottom = xpt.y();
	  }
	}

	// redraw the zero axis
	painter->setPen( _chart->_fgcolor );
	painter->drawLine( _chart->_left, _chart->_zeropoint, 
					   _chart->_right, _chart->_zeropoint );
  } else {
	// loop over the dataset
	for( int dataset = 0; dataset < _chart->chartData()->numDatasets(); 
		 dataset++ ) {
	  // Choose a colour for the dataset being drawn
	  QColor datacolor = chooseDataColor( dataset );
	  painter->setPen( datacolor );
	  // Create two brushes for filled and non-filled rectangles
	  QBrush filledbrush( datacolor, SolidPattern );
	  QBrush emptybrush( datacolor, NoBrush );

	  // loop over the positions in the current dataset
	  for( uint i = 0; i <= _chart->chartData()->maxPos(); i++ ) {
		// skip positions which have no data in this dataset
		if( !_chart->chartData()->hasYValue( dataset, i ) )
		  continue;
		
		// get coordinates of top and center of bar
		QPoint coords = valToPixel( i+1, 
									_chart->chartData()->yValue( dataset, i ),
									dataset );
		// calculate left and right
		left = coords.x() - _chart->_xstep/2 + 
		  (int)rint( dataset * _chart->_xstep / _chart->chartData()->numDatasets() );
		right = coords.x() - _chart->_xstep/2 +
		  (int)rint( (dataset+1) * _chart->_xstep / _chart->chartData()->numDatasets() );

		// and finally draw the bar
		painter->setBrush( filledbrush );
		painter->setPen( _chart->_accentcolor );
		if( _chart->chartData()->yValue( dataset, i ) >= 0 ) {
		  // positive value
		  QRect rect( QPoint( left, coords.y() ), 
					  QPoint( right, _chart->_zeropoint ) );
		  painter->drawRect( rect );
		} else {
		  // negative value
		  QRect rect( QPoint( left, _chart->_zeropoint ),
					  QPoint( right, coords.y() ) );
		  painter->drawRect( rect );
		}
	  }
	}
	
	// redraw the zero axis
	painter->setPen( _chart->_fgcolor );
	painter->drawLine( left, _chart->_zeropoint, right, _chart->_zeropoint );
  }
}



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]