Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Linux - Kernel This forum is for all discussion relating to the Linux kernel.


  Search this Thread
Old 09-08-2010, 10:42 PM   #1
Registered: Apr 2007
Location: Philippines
Distribution: Kubuntu, Ubuntu, CentOS
Posts: 289

Rep: Reputation: 41
How to redirect compilation/build error to a file?

Hello everyone,

How do you redirect or save compilation errors to a file? This is useful for building kernel since most warning and errors are too many sometimes?

For example, how to save/capture the "make[x]: *** Error " and warnings here?

archie@archie-desktop:~/od-kernel/kernel$ make modules | awk '{print}' | tee sample
<stdin>:1097:2: warning: #warning syscall fadvise64 not implemented
<stdin>:1265:2: warning: #warning syscall migrate_pages not implemented
<stdin>:1321:2: warning: #warning syscall pselect6 not implemented
<stdin>:1325:2: warning: #warning syscall ppoll not implemented
<stdin>:1365:2: warning: #warning syscall epoll_pwait not implemented
drivers/media/video/samsung/tv20_ap/acc_tvout.c: In function 'init_sd':
drivers/media/video/samsung/tv20_ap/acc_tvout.c:332: error: expected ';' before '}' token
drivers/media/video/samsung/tv20_ap/acc_tvout.c: At top level:
drivers/media/video/samsung/tv20_ap/acc_tvout.c:530: warning: initialization from incompatible pointer type
make[5]: *** [drivers/media/video/samsung/tv20_ap/acc_tvout.o] Error 1
make[4]: *** [drivers/media/video/samsung/tv20_ap] Error 2
make[3]: *** [drivers/media/video/samsung] Error 2
make[2]: *** [drivers/media/video] Error 2
make[1]: *** [drivers/media] Error 2
make: *** [drivers] Error 2
CHK include/linux/version.h
make[1]: `include/asm-arm/mach-types.h' is up to date.
CHK include/linux/utsrelease.h
SYMLINK include/asm -> include/asm-arm
CALL scripts/
CC [M] drivers/media/video/samsung/tv20_ap/acc_tvout.o
perl or awk scripts are also appreciated.

Old 09-08-2010, 11:19 PM   #2
Registered: Apr 2007
Location: Philippines
Distribution: Kubuntu, Ubuntu, CentOS
Posts: 289

Original Poster
Rep: Reputation: 41
I have found some solutions. >__<

$ gcc temp.c &> error.log

% gcc temp.c |& tee error.log
Old 09-09-2010, 03:27 AM   #3
Registered: Feb 2009
Posts: 347

Rep: Reputation: 72
gcc temp.c > error.log 2>&1

Redirects stdout and stderr to error.log.


compile, redirection, stderr, stdout

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
bash: redirect stderr to file including name of file with the error SilversleevesX Programming 11 07-27-2010 04:06 PM
Error in compilation of cxx file with C++ compiler version as (CC: Sun C++ 5.9 SunOS_ ash_bit2k2 Solaris / OpenSolaris 2 04-01-2010 01:46 AM
Virtualbox-ose compilation error using Sbo slack-build samac Slackware 11 10-30-2008 03:28 PM
Kernel compilation error: Error 15: File not found Niceman2005 Linux - General 9 10-04-2007 04:45 AM
Stubs-32.h file missing error during compilation on Windows using Colinux + FC4 rkaur Linux - Software 0 03-21-2007 07:11 AM > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 11:50 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration