Fatal Error while Running c++ object file [closed] - c++

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I have compiled C++ project using cmake utility on Red hat Linux 4.1.2.
gcc version: 4.1
When I try to run object file using following command I got an exception:
./GCVMP ../../dat/settlingsUnix/MPSettings.xml
exception : Fatal Error: æ¹¥åSä
I am not able to understand root cause.
Please help me in this regard.

I suspect that the "Fatal Error:" portion is something printed by your code. It's supposed to be followed by a message explaining the error, but the message passed is corrupted, and so junk is printed.
Have you tried compiling the program with -ggdb running it under gdb? Here's a good starter on how to use the debugger: http://www.ibm.com/developerworks/library/l-gdb/

Related

How to debug a g++ segmentation fault using gdb? [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 3 years ago.
Improve this question
I got a segfault when running my program. Then I googled my question and tried to follow steps from https://www.gnu.org/software/gcc/bugs/segfault.html.
I did not configure GCC with --enable-checking then my first question is -
1) is it necessary to configure it and compile with -v -da -Q ?
But I always do compile with flags such as -g -o0. After running the program in GDB with arguments I get this:
2) I can not print variables after segfault, is it okay ?
3) How to figure out the line of my source code where segfault happens ?
Then I googled my question and tried to follow steps from > https://www.gnu.org/software/gcc/bugs/segfault.html.
These are the steps for GCC developers to follow when GCC itself crashes while compiling your program.
These are not the steps you should follow when debugging a crash in the program itself.
Instead, read this.
How to figure out the line of my source code where segfault happens ?
GDB told you the line: it's common/search.cpp line 172.

SegmentationFault linux AFS [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
Can someone tell me how to debug segmentation fault in linux VIA AFS. I would appreciate if someone could refer me command. I am able to run my code via compiler but not on when i give command g++ -o file1 file2.cpp----> ./file----->segmentation fault
Compile the program with the -g option
g++ -g -o file1 file2.cpp
Then execute the executable created with gdb.
gdb file1
Once you see the seg fault issue bt, this will give you the stack.
frame <frame number> you can see the details about the particular stack.
Happy debugging.

Running a c++ file from command line [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I'm very much used to Visual Studio, but a HW assignment requires that the finished product be run from the command line. I've built it in Visual Studio to make sure my code is at least syntactically correct and won't cause any compiler to throw me a message, but he designed the template so that it would only really work on Command Line. Therefore, I need the command line to test the functionality of the code
TL/DR: the jist of it is: I should be able to run it from command line by typing in:
programName argument
How do I do this with a .cpp?
It should be
Programname.exe argument 1 argument2 ... argumentn
Make sure you're running the program in the correct path or specify the full path of the .exe
First open command prompt than type cd and your file's location ( Bot don't write your program's name.Example we have a test.exe in our desktop. If we open the command prompt we will see something like this: C:\Users\Username\ : We should locate the file so we can do : cd C:\Users\Username\Desktop or cd Desktop This one works if the directed folder is a sub folder of Username .Than you can use this code : start test.exe. hope this helps.Please send a feedback.

CS107 Assignment Files [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I'm trying to run the Stanford CS107 Assignment files on my mac but whenever I try to run the binary files I get an error 'Permission denied'. If I chmod the file so I have execute permissions I get an error that says 'cannot execute binary file'.
How can I execute these files?
I can't run the imdb-test-linux binary because all the source files aren't given. To get the imdb-test file to run there was a problem in the imdb-utils.h file. The code uses
const char *ostype = getenv("OSTYPE");
Which returns Null on my mac for some reason. To fix the problem, in the 'determinePathToData' function inside the imdb-utils.h file just return the directory where you have placed the data files.
run 'make imdb-test' and it should run.
Hope this helps someone :)

What causes SXSTrace error "StartTrace failed ... Unknown Error"? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
I'm here because of a sibe-by-side configuration error.
When I try to launch a game, it pops a side-by-side configuration error.
I try lots of stuff that didn't work, but then, I found this site:
http://blogs.msdn.com/b/cesardelatorre/archive/2011/03/27/the-application-has-failed-to-start-because-its-side-by-side-configuration-is-incorrect-error-related-to-mmc-exe-programs-and-weird-cause-amp-simple-solution.aspx.
Following they'r instructions, I tried the command( In command prompt! ):
sxstrace.exe trace -logfile:C:\MySxSTrace.log
at first it returned that it couldn't recognize this kind of command.
So I did this:
Right click computer -> advanced -> environment variables -> system variables -> and i edited the path to add C:\Windows\System32\
OR
http://helpdeskgeek.com/how-to/fix-not-recognized-as-an-internal-or-external-command/
So it resolved the problem that it could not recognize it as an internal or ext command.
But then, i tried the command again: sxstrace.exe trace -logfile:C:\MySxSTrace.log
and it returns THIS: StartTrace failed. Error message is: Unknown Error.
I searched and I found someone who sayd that you cant put something on the root folder, complete nonsense. Because I haven't found anything, I ask in this site as I think programmers should understand that kind of stuff. Oh yeah and I heard that the side-by-side configuration error has something to do with c++.
So yeah:
1-The application has failed to start because its side-by-side configuration is incorrect. Please see the application event log for more detail.
2- StartTrace failed. Error message is: Unknown Error.
You can use dependency walker to open your exe and find the missing dependency and SxS versioning.