Skip to main content



      Home
Home » Language IDEs » C / C++ IDE (CDT) » Problems pane fails to parse path to autogenerated source files
Problems pane fails to parse path to autogenerated source files [message #521191] Tue, 16 March 2010 13:02 Go to next message
Eclipse UserFriend
Hi, newbie question here.

I'm trying to use the Problems pane to locate some warnings in an auto-generated source file (actually a file which is hardlinked from elsewhere) which is part of a makefile project. However, I'm having a lot of trouble getting Eclipse to parse the build log to locate the source file correctly. It only ever reports "line n, external location: myfile.c" - and Eclipse can't hyperlink this back to the source file.

I have managed to produce the following simplified test case. Create a makefile containing the following:

all:
	echo syntax error > main.c
	$(CC) -o main.o main.c


This will report the "external location" error the first time you build the project, but parse it correctly on subsequent runs. This isn't much use to me since I'm trying to locate warnings, and since they are warnings, my source files don't get rebuilt on subsequent builds!

Is there a simple fix I can use?
Re: Problems pane fails to parse path to autogenerated source files [message #521216 is a reply to message #521191] Tue, 16 March 2010 14:32 Go to previous message
Eclipse UserFriend
That is because file main.c is not known to eclipse during the build when the markers are generated. Eclipse will refresh workspace and find the (new) files only after the build.
A better way is to instruct your precompiler/generator to generate #line compiler directives in the generated source. That way the compiler will print errors referring to the original source rather than generated file. Many precompilers can do that.

Another trick you may want to use is to right-click on error marker in problems view and try "Open external location".

Andrew
Previous Topic:Call hierarchy is not working
Next Topic:Evaluating Expressions while debugging
Goto Forum:
  


Current Time: Wed Nov 05 23:12:49 EST 2025

Powered by FUDForum. Page generated in 0.04206 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top