Nov 21 2007, 04:28 PM
Post
#1
|
|
![]() Group: Members Posts: 2,350 Joined: 30-July 06 Member No.: 10,575 |
I'm getting an error:
CODE terminate called after throwing an instance of 'std::ios_base::failure' what(): basic_ios::clear Aborted With my latest C++/SDL app. What causes this, and what can I do about it? It works fine on my laptop, but when I try to run it on my Z, I got the above error. Any help would be much appreciated. |
|
|
|
![]() |
Nov 22 2007, 09:49 AM
Post
#2
|
|
![]() Group: Members Posts: 2,350 Joined: 30-July 06 Member No.: 10,575 |
Sure, I'll go put some cout'd numbers in now.
EDIT: Attached source EDIT2: It's failing between 4 & 5, or in the "ReadMap" function: EDIT3: Now, after making NO changes other than adding in some debug output, it's just segfaulting ( I should really stop posting these types of issues at night when everything looks hopeless... Thanks again for your help! EDIT4: Yup, I got it (one too few characters in my array. Funny that it worked on the laptop...). I'll leave the source up as a teaser.
Attached File(s)
|
|
|
|
Nov 23 2007, 01:26 AM
Post
#3
|
|
|
Group: Members Posts: 318 Joined: 25-February 04 From: UK Member No.: 2,025 |
EDIT3: Now, after making NO changes other than adding in some debug output, it's just segfaulting When the behaviour of the program changes after making such slight changes that's a clear indication of reading/writing to illegal memory. You should have run valgrind on the program when compiled on your desktop to make sure there are no obvious errors, it would have caught the problem and told you where it was. |
|
|
|
Capn_Fish Another C++ Issue Nov 21 2007, 04:28 PM
koan I don't know so much about exception processin... Nov 22 2007, 01:05 AM
Snappy You may also want to put it some debug output stat... Nov 22 2007, 06:36 AM
Capn_Fish I don't call clear anywhere. What other functi... Nov 22 2007, 08:06 AM
Snappy A quick look .. could it be something to do with h... Nov 22 2007, 09:20 AM
koan QUOTE(Snappy @ Nov 22 2007, 09:20 AM) A q... Nov 25 2007, 10:08 PM
koan Hi
I decided to look at your code. I don't us... Nov 25 2007, 11:55 PM
Snappy QUOTE(Capn_Fish @ Nov 23 2007, 01:49 AM) ... Nov 25 2007, 09:19 AM
Snappy Just curious ...
mapp.cpp, line 147
QUOTEchar Li... Nov 25 2007, 09:36 AM
Snappy btw, if you wish, you can also include the functio... Nov 25 2007, 09:50 AM
Capn_Fish Thanks for the helpful comments! I love open-s... Nov 26 2007, 04:42 AM
koan QUOTE(Capn_Fish @ Nov 26 2007, 04:42 AM) ... Nov 27 2007, 05:12 PM![]() ![]() |
|
Lo-Fi Version | Time is now: 19th May 2013 - 12:43 AM |