473,394 Members | 1,674 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

terminate called after throwing an instance of 'std::out_of_range'

1
I have a program that compiles and runs fine under Win XP.
(using DevC++ beta 5).

I've compiled the same program under Linux (Debian Lenny) and Mac OS X 10.5.8.
(Using Eclipse). However when I try to run it from the command line I get this error:

terminate called after throwing an instance of 'std::out of range' what(): basic_string::substr

When I try debugging from eclipse I get the error.
When I try gdb from the command line the error does not occur.

The program is part of a homework assignment (which is why at this moment I've chosen not to post any code), but this particular problem has nothing to do with the assignment.

Could this be a problem with locale settings? Where should I look next?
Dec 4 '09 #1
1 11862
weaknessforcats
9,208 Expert Mod 8TB
You are using different compilers so that means you are using different implementations of the standard C++ library templates.

You will need to debug the program that's crashing.
Dec 4 '09 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

13
by: Mike Austin | last post by:
Hi all. Just working on a small virtual machine, and thought about using vector iterators instead of pointer arithmetic. Question is, why does an iterator plus any number out of range not...
8
by: puzzlecracker | last post by:
Does string class take into consideration a poterntial buffer overflow issue? or does std:string::c_str() member functions does? what are the preventives?
4
by: daroman | last post by:
Hi Guys, i've problem with my small C++ programm. I've just small template class which represetns a array, everything works fine up to combination with std::string. I did tried it with M$ VC++ and...
5
by: Adrian | last post by:
Can this code ever throw out_of_range or should the commented out code always be used? Is there any chance that std::string::npos+1 is bigger then std::string::npos Take str to be any...
2
by: Steve555 | last post by:
Hi, In a function that erases part of a string, the compiler sometimes gives this error: terminate called after throwing an instance of 'std::out_of_range' what(): basic_string::erase I...
1
by: usenet | last post by:
I wrote some sample code (see below) for nested exception throwing i.e. my catch blocks are throwing exceptions of their own (for simplicity I used standard exceptions). I am getting some...
17
by: desktop | last post by:
I have the following code: #include <stdexcept> int main(){ int i = 10; int arr; int index = 11;
8
by: Bryan | last post by:
Hello all. I'm fairly new to c++. I've written several programs using std::vectors, and they've always worked just fine. Until today. The following is a snippet of my code (sorry, can't...
5
MrPickle
by: MrPickle | last post by:
I googled and got some answers but whenever I used it I kept getting and std::out_of_range exception and I'm not completely clear on how to use it. I know how to initialize it; std::vector<...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.