Welcome Guest ( Log In | Register )



 
Reply to this topicStart new topic
> Linux Basic Command - For Storing Compilation Error To File
kanade
post May 28 2008, 06:36 PM
Post #1


Member [ Level 1 ]
Group Icon

Group: [HOSTED]
Posts: 34
Joined: 15-May 08
Member No.: 30,356



Ex: Compiling a cpp file using a basic command "g++ filename.cpp" and to run the program use ./a.out, Then to store the compilation error to text file use this command.

g++ test.cpp > log.txt

log.txt contains the compile time errors.
Go to the top of the page
 
+Quote Post
kanade
post May 30 2008, 08:49 AM
Post #2


Member [ Level 1 ]
Group Icon

Group: [HOSTED]
Posts: 34
Joined: 15-May 08
Member No.: 30,356



If your code is giving core dump or segmentation fault then the easiest way to debug the error is using the gdb and file created by coredump.

example: use this command to compile the code
$ gcc -g -o outfile sample.cpp

use this command to run this.

$ ./outfile -- if you get message segmentation fault or core dump then look for the coredump file created in perticular folder the use following
command to debug it.

$gdb coredumpfilename --- this will display where exactly code is created a dump.

You can use 'bt' command to back trace the error.


enjoy error free coding ............

This post has been edited by kanade: May 30 2008, 08:51 AM
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Now Linux is ease(9)
  2. Linux SuSE detec you all hareware(2)
  3. You can Play now in Linux(26)
  4. What's The Difference Between Linux And Unix?!?(15)
  5. What Language Is Linux Written In ?(15)
  6. Where To Find Notepad++ For Linux ?(37)
  7. What Made You Switch To Linux?(60)
  8. Psybnc - Howto(4)
  9. Looking For Linux(34)
  10. Virtualization In Linux: A Review Of Four Software Choices(4)
  11. How To Install Linux Without A CD or DVD?(11)
  12. Getting My Wireless Network Adapter Working On Linux(2)
  13. What Softwares Should I Get To Linux?(6)
  14. Diablo 2 In Linux?(10)
  15. Linux?(3)
  1. What Is Linux(2)
  2. So, I Want To Try Out Linux.(9)
  3. How To Play Music And Movie In Linux? Which Is The Good One?.(6)
  4. Some Usefull Linux Basic Commands And Utilities. Please Add To This List If You Know One.(0)
  5. How To Copy File & Folders From Linux To Windows?.(12)
  6. Access Linux Box From Windows Machine- Putty Tool(2)
  7. Linux For Beginners- Easy To Install(15)
  8. Strange Error When Trying To Install Fedora Core 9(6)
  9. Choice Of Motherboard For Linux Virtualization(4)
  10. Why Linux?(23)
  11. Which Linux Version For Newbies?(14)
  12. Linux Software Installation Help(2)
  13. I Want To Get Linux, Which One Is Best?(6)


 



- Lo-Fi Version Time is now: 14th October 2008 - 03:39 AM