In general, why would you not show the actual code the first time? It just wastes Peter87's time...
Granted, just showing main in this case isn't too much better, since the exception happens inside, but let's continue.
One gotcha with C++ exceptions (as opposed to languages like C# and Java), is that if another exception occurs while you're still unwinding the stack from a previous exception, this will cause the runtime to call
std::terminate, which is what is happening in your code. This is usually caused by destructor throwing an exception, which shouldn't happen. The architecture of your code should be a set up so that this doesn't happen.
You should use a debugger. Use it! Use a debugger. It will make your life much easier to step through your code, line-by-line, and see when funky behavior starts occurring. Most IDEs have easy ways to set break points, step-in, and debug. What IDE do you have? Try searching its name with "debugger" next to it.
Edit: More questions for you,
What is GLShaderError? Did you create it yourself?
Edit 2: Oh, I see what it now from the link you pasted.
_____________________________
Edit 3: One thing that I'm pretty sure is a problem are constructs like this:
1 2
|
std::string error = "Unknown uniform '" + std::string(uniform) + "'";
throw GLShaderError(error.c_str(), "");
|
This looks wrong. When the function this is called in goes out of scope, c_str() will no longer point to valid memory.
Might be useful:
https://stackoverflow.com/questions/5887655/throwing-catching-scoping-stlstring-c-str-exceptions
But this is a guess. Use a debugger.