Closed jbensabat closed 8 months ago
Thank you for reporting. Documentation is still (always ^^) under development. But you can find tutorials, courses and API description on the official website: https://gstlearn.org
To have a first overview of what gstlearn provides, I suggest you to read our courses: https://gstlearn.org/?page_id=193
All what is available in python or R is available in C++. The API available is described through doxygen HTML files: https://gstlearn.org/?page_id=91
hi thanks a lot jac
@jbensabat : Please, could you provide me a reproducible example that leads to the exception you are talking about ? I never experienced this exception with my windows (Visual or MinGW). I have done a small fix in 49298c9 to prevent calling "stop" method when the redirection is not active, but all of our tests use an active redirection. Thank you for your help.
Good morning I compiled the lib and examples with MSVC2022/64bit we got the same exception for every example we ran (we did not run all the examples though) I solved the problem transforming the stop() method namely, you call int fd = _open_osfhandle((intptr_t)_old_stdout, _O_WRONLY | _O_TEXT); what I have seen is that I got fd=-1, which caused the exception when calling _fdopen(fd,.. best jac
void StdoutRedirect::stop() {
// https://stackoverflow.com/questions/32185512/output-to-console-from-a-win32-gui-application-on-windows-10 if (_old_stdout) { SetStdHandle(STD_OUTPUT_HANDLE, _old_stdout); int fd = _open_osfhandle((intptr_t)_old_stdout, _O_WRONLY | _O_TEXT); **if (fd >= 0) { FILE fp = _fdopen(fd, "w"); freopen_s(&fp, "CONOUT$", "w", stdout); } }
std::cout.rdbuf(_coutbuf);** _out.close();
}
Fixed in v1.1.0
Hello I have built the lib and I am now trying to run the examples. Some of them are obvious but others are more complex. Is there documentation available on gstlearn ? about what it does and how it is organized, ?
also, running the examples can lead to exceptions which occur in the following function
/**
if defined(_WIN32) || defined(_WIN64)
// https://stackoverflow.com/questions/32185512/output-to-console-from-a-win32-gui-application-on-windows-10 if (_old_stdout) { SetStdHandle(STD_OUTPUT_HANDLE, _old_stdout); int fd = _open_osfhandle((intptr_t)_old_stdout, _O_WRONLY | _O_TEXT); if (fd >= 0) { FILE* fp = _fdopen(fd, "w"); freopen_s(&fp, "CONOUT$", "w", stdout); } }
else
std::cout.rdbuf(_coutbuf); _out.close();
endif
}
under windows _open_osfhandle returns a negative value thus creating an exception in _fdopen I just placed a condition on the value of fd
best jac