|
|
|
|
![]() ![]() |
May 28 2008, 06:36 PM
Post
#1
|
|
|
Member [ Level 1 ] 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. |
|
|
|
May 30 2008, 08:49 AM
Post
#2
|
|
|
Member [ Level 1 ] 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 |
|
|
|
![]() ![]() |
Similar Topics
|
Lo-Fi Version | Time is now: 14th October 2008 - 03:39 AM |