Bug 131542

Summary: Some g++ output error messages aren't displayed as error messages
Product: [Applications] kdevelop Reporter: greatbunzinni
Component: Output ViewsAssignee: kdevelop-bugs-null
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: 3.3.3   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:

Description greatbunzinni 2006-07-30 10:39:27 UTC
Version:           3.3.3 (using KDE KDE 3.5.3)

I've noticed when developing a small qmake project that some g++ error messages aren't marked as errors in the message output window. For example, let's take the following error message taken out of the full compiler log output:

<error output="full">
g++ -o ../bin/direqtchat main.o direqtchat.o mainwindow.o chatwidget.o connectclientdialog.o networkengine.o jid.o ui_XmlDump.o ui_ConnectClientDialog.o ui_ConnectServerDialog.o ui_mainWindow.o ui_ChatWidget.o moc_mainwindow.o moc_chatwidget.o moc_connectclientdialog.o moc_networkengine.o moc_ui_XmlDump.o moc_ui_ConnectClientDialog.o moc_ui_ConnectServerDialog.o moc_ui_mainWindow.o moc_ui_ChatWidget.o -L/usr/share/qt3/lib -L/usr/X11R6/lib -lqt-mt -lXext -lX11 -lm -lpthread
networkengine.o: In function `NetworkEngine::deliverMessage(JID, JID, QString)':networkengine.cpp:(.text+0x5b): undefined reference to `ChatNode::addressMatches(JID const&)'
:networkengine.cpp:(.text+0xaf): undefined reference to `ChatNode::receiveMessage(JID, JID, QString)'
networkengine.o: In function `NetworkEngine::~NetworkEngine()':networkengine.cpp:(.text+0x15f): undefined reference to `PostOffice::~PostOffice()'
networkengine.o: In function `NetworkEngine::~NetworkEngine()':networkengine.cpp:(.text+0x2bb): undefined reference to `PostOffice::~PostOffice()'
networkengine.o: In function `NetworkEngine::~NetworkEngine()':networkengine.cpp:(.text+0x303): undefined reference to `PostOffice::~PostOffice()'
networkengine.o: In function `NetworkEngine::NetworkEngine(QObject*, char const*)':networkengine.cpp:(.text+0x367): undefined reference to `PostOffice::PostOffice(QObject*, char const*)'
:networkengine.cpp:(.text+0x3c4): undefined reference to `PostOffice::~PostOffice()'
networkengine.o: In function `NetworkEngine::NetworkEngine(QObject*, char const*)':networkengine.cpp:(.text+0x409): undefined reference to `PostOffice::PostOffice(QObject*, char const*)'
:networkengine.cpp:(.text+0x466): undefined reference to `PostOffice::~PostOffice()'
collect2: ld returned 1 exit status
make[1]: *** [../bin/direqtchat] Error 1
make: *** [sub-src] Error 2
*** Exited with status: 2 ***
</error>

that error message, in the very short compiler output mode, is shown like this:

<error output="very short">
linking ../bin/direqtchat (g++)
*** Exited with status: 2 ***
</error>


This makes it impossible to realize what the error was by looking at the very short compiler output, which forces the user to switch compiler output modes just to see what whent wrong with the compiling process, which isn't very user-friendly.
Comment 1 Jens Dagerbo 2007-01-07 21:46:08 UTC
SVN commit 620944 by dagerbo:

Add various common ld and make error strings to the output error parser
Add 'CC' among the possible compilers

BUG: 71299
BUG: 72699
BUG: 131542
BUG: 91520
BUG: 132601


 M  +8 -0      compileerrorfilter.cpp  
 M  +3 -3      makeactionfilter.cpp  


--- branches/kdevelop/3.4/parts/outputviews/compileerrorfilter.cpp #620943:620944
@@ -50,6 +50,13 @@
 		ErrorFormat( "([^: \\t]+)\\(([0-9]+)\\):([^0-9]+)", 1, 2, 3, "intel" ),
 		//libtool link
 		ErrorFormat( "(libtool):( link):( warning): ", 0, 0, 0 ),
+		// ld 
+		ErrorFormat( "undefined reference", 0, 0, 0 ),
+		ErrorFormat( "undefined symbol", 0, 0, 0 ),
+		ErrorFormat( "ld: cannot find", 0, 0, 0 ),
+		ErrorFormat( "No such file", 0, 0, 0 ),
+		// make
+ 		ErrorFormat( "No rule to make target", 0, 0, 0 ),
 		// Fortran
 		ErrorFormat( "\"(.*)\", line ([0-9]+):(.*)", 1, 2, 3 ),
 		// Jade
@@ -65,6 +72,7 @@
 	};
 
 	return formats;
+
 }
 
 void CompileErrorFilter::processLine( const QString& line )
--- branches/kdevelop/3.4/parts/outputviews/makeactionfilter.cpp #620943:620944
@@ -72,9 +72,9 @@
 MakeActionFilter::ActionFormat* MakeActionFilter::actionFormats()
 {
 	static ActionFormat formats[] = {
-		ActionFormat( i18n("compiling"), 1, 2, "(gcc|cc|distcc|c\\+\\+|g\\+\\+)\\S* (?:\\S* )*-c (?:\\S* )*`[^`]*`(?:[^/\\s;]*/)*([^/\\s;]+)"),
-		ActionFormat( i18n("compiling"), 1, 2, "(gcc|cc|distcc|c\\+\\+|g\\+\\+)\\S* (?:\\S* )*-c (?:\\S* )*-o (?:\\S* )(?:[^/;]*/)*([^/\\s;]+)"),
-		ActionFormat( i18n("compiling"), 1, 2, "(gcc|cc|distcc|c\\+\\+|g\\+\\+)\\S* (?:\\S* )*-c (?:\\S* )*(?:[^/]*/)*([^/\\s;]*)"),
+		ActionFormat( i18n("compiling"), 1, 2, "(gcc|CC|cc|distcc|c\\+\\+|g\\+\\+)\\S* (?:\\S* )*-c (?:\\S* )*`[^`]*`(?:[^/\\s;]*/)*([^/\\s;]+)"),
+		ActionFormat( i18n("compiling"), 1, 2, "(gcc|CC|cc|distcc|c\\+\\+|g\\+\\+)\\S* (?:\\S* )*-c (?:\\S* )*-o (?:\\S* )(?:[^/;]*/)*([^/\\s;]+)"),
+		ActionFormat( i18n("compiling"), 1, 2, "(gcc|CC|cc|distcc|c\\+\\+|g\\+\\+)\\S* (?:\\S* )*-c (?:\\S* )*(?:[^/]*/)*([^/\\s;]*)"),
 		ActionFormat( i18n("compiling"), 1, 1, "^compiling (.*)" ), //unsermake
 		ActionFormat( i18n("compiling"), 1, 1, "\\[.+%\\] Building .* object (.*)" ), //cmake