running under cygwin

Dec 3, 2010 at 7:56 AM

Is there any success building and running with pstsdk on cygwin?

I successfully built with g++ 4.3.4 under cygwin and when I try the following simple program, I get a "terminate called after throwing an instance of std::out_of_range'" "what (): fseek failed" error message

std::string  s(argv[1]);  
std::wstring filename(s.begin(), s.end());

try {    

pst myfile(filename);    
folder fold = myfile.open_root_folder();

} catch (char *s) {  cerr << "Exception thrown: " << s << endl;  }

The file is a legit PST file and exists. I am a bit confused about (a) why open_root_folder (or any other folder operation, for that matter) throws that exception, and (b) why the exception was not caught by my 'catch' block?

I am a bit rusty with my C++, so it is likely I am doing something very stupid here...

Dec 3, 2010 at 8:09 AM

Not a whole lot of information, but if I had to guess I'd say your PST file is over 4gb, and fseek on gcc only supports seeking to 32 byte offsets. 

You need to specify the exception type you wish to catch in your catch clause (here, std::out_of_range). catch (char* s) only catches when a char* is thrown, which is pretty much never.