1
General / [C++] exception handling problem
« on: December 31, 2008, 02:40:28 pm »
sorry i saw other posts who were not sfml specific, so i asked my question here. Thank you very much for the answer!
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
#include <iostream>
#include <stdexcept>
#include <vector>
using std::vector;
using std::cout;
using std::cerr;
using std::endl;
using std::out_of_range;
int main()
{
vector<int> intVec;
try {
int integer = intVec[-1];
cout << "This won't get executed :)" << endl;
}
catch(out_of_range &e)
{
cout << "This won't get executed too :( on my machine" << endl;
cerr << e.what() << endl;
}
catch(...)
{
cerr << "unhandled exception" << endl;
}
}
build/Release/MinGW-Windows/main.o:main.cpp:(.text+0xab): undefined reference to `sf::RenderWindow::RenderWindow()'
build/Release/MinGW-Windows/main.o:main.cpp:(.text+0x2d1): undefined reference to `sf::RenderWindow::~RenderWindow()'
std::map<wchar_t, Character> myCharacters; ///< Rendering settings of each character