LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices

Reply
 
LinkBack Search this Thread
Old 09-08-2010, 09:42 PM   #1
archieval
Member
 
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?

Quote:
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/checksyscalls.sh
CC [M] drivers/media/video/samsung/tv20_ap/acc_tvout.o
perl or awk scripts are also appreciated.

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

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

bash:
$ gcc temp.c &> error.log

csh:
% gcc temp.c |& tee error.log
 
Old 09-09-2010, 02:27 AM   #3
bsat
Member
 
Registered: Feb 2009
Posts: 346

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

Redirects stdout and stderr to error.log.
 
  


Reply

Tags
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
Trackbacks are Off
Pingbacks are On
Refbacks are 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 03: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 12:46 AM
Virtualbox-ose compilation error using Sbo slack-build samac Slackware 11 10-30-2008 02:28 PM
Kernel compilation error: Error 15: File not found Niceman2005 Linux - General 9 10-04-2007 03:45 AM
Stubs-32.h file missing error during compilation on Windows using Colinux + FC4 rkaur Linux - Software 0 03-21-2007 06:11 AM


All times are GMT -5. The time now is 01:13 AM.

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