Gcc Error Message Full Path
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Can gcc be configured to not print out a full path in warning/error messages? up vote 8 down vote favorite 1 When gcc prints out a warning or error, it shows the full path of the file that contains the error. Is there a flag to shorten the output to just the filename? gcc share|improve this question edited Feb 20 '15 at 2:20 Qantas 94 Heavy 9,944134158 asked Aug 15 '09 at 17:27 user156968 add a comment| 4 Answers 4 active oldest votes up vote 7 down vote It just depends on how you invoke gcc: /tmp/c$ gcc -Wall bad.c bad.c:1: warning: return type defaults to ‘int’ bad.c: In function ‘main’: bad.c:1: warning: control reaches end of non-void function vs /tmp/c$ gcc -Wall /tmp/c/bad.c /tmp/c/bad.c:1: warning: return type defaults to ‘int’ /tmp/c/bad.c: In function ‘main’: /tmp/c/bad.c:1: warning: control reaches end of non-void function vs /tmp/c$ gcc -Wall ../../tmp/c/bad.c ../../tmp/c/bad.c:1: warning: return type defaults to ‘int’ ../../tmp/c/bad.c: In function ‘main’: ../../tmp/c/bad.c:1: warning: control reaches end of non-void function where contents of bad.c are just main() { } if anyone cares. share|improve this answer answered Aug 15 '09 at 17:33 Mark Rushakoff 138k22294346 1 True, that works, but what about if there's already a complicated build system set up? It'd be nice
sources with g++. Can I set a command line flag of g++ to see the full path on warning or error messages? I use relative paths for compiling the source, but I need messages with a absolute path. Thanks a lot Phil Philipp Kraus, Dec 8, 2010 #1 Advertisements Jorgen Grahn Guest On Wed, 2010-12-08, Philipp Kraus wrote: > Hello, > > I use a Scons script for compiling my sources with g++. Can I set a > command line flag of g++ to see the full path http://stackoverflow.com/questions/1282392/can-gcc-be-configured-to-not-print-out-a-full-path-in-warning-error-messages on warning or error > messages? I use relative paths for compiling the source, but I need > messages with a absolute path. If it's not document in the exhaustive reference manual, then most likely "no". It's not something people generally need. /Jorgen -- // Jorgen Grahn
Things LocationTech Long-Term Support PolarSys Science OpenMDM More Community Marketplace Events Planet Eclipse Newsletter Videos Participate Report a Bug Forums Mailing Lists Wiki IRC How to Contribute Working Groups Automotive Internet of Things LocationTech Long-Term Support PolarSys Science OpenMDM Toggle navigation Home Projects Forums Eclipse Community https://www.eclipse.org/forums/index.php/t/171630/ Forums Forum Search: Search Help Register Login Home Home» Language IDEs» C / C++ IDE (CDT)» Cannot run program make: unknown reason - Problem with Remote C/C++ Projec Show: Today's Messages :: Show Polls :: Message Navigator Cannot run program make: unknown reason - Problem with Remote C/C++ Projec [message #545934] Fri, 09 July 2010 16:05 brianMessages: 1Registered: July 2010 Junior Member I've recently updated to Helios and CDT 7.0 and am running into gcc error an issue when I create a remote c/c++ project. I can create a remote project (Linux) and compile and run, but it seems to bork environment variables here on my local machine (also Linux). When I try to build a local project I get the error: (Cannot run program "make": Unknown reason) as well as the following warning: Error launching external scanner info generator Also, i get the following terminal output: Unable to get $PATH. Unable to find gcc error message full path for "make" Unable to get $PATH. Unable to find full path for "gcc" Here are the steps I took to replicate this error: 1. Clean install of Eclipse, CDT 7.0, Parallel Tools 4, and RSE runtime. 2. Import my project(s) into workspace, local builds are fine. 3. Create a new remote c/c++ project, remote build is fine. 4. Attempt to build local project, receive above errors. The same thing happens if I create a new local project. 5. The remote project is still able to build fine. 6. I can build my local project if I edit the project properties -> C/C++ Build -> Environment and add my PATH. So it seems I can solve my problem, but my concern is am I just putting a band-on a underlying problem? Is there some configuration I need to edit? Is this a bug? I've tried to search but most of the results deal with people who have problems installing mingw on windows. Thanks in advance. Report message to a moderator Re: Cannot run program make: unknown reason - Problem with Remote C/C++ Projec [message #546394 is a reply to message #545934] Mon, 12 July 2010 15:52 JohanMessages: 1Registered: July 2010 Location: Delft, The Netherlands Junior Member The same problem here. It seems to be Helios-only; Galileo still works fine. **** Build of configuration Debug for project TestC++ **** (Cannot