Nothing has changed since the destructor was added, so the results are
the same.
Although the try/catch block is active vkSQLException is not caught:
***************************************************************************************************
linux //works as expected
-------------------------
Connecting to TRT-MRT ...
SQLException:Failed to connect to datasource: [unixODBC][Driver
Manager]Data source name not found and no default driver specified
sqlState=IM002 errorCode=0
catch blok passed
TRT-MRT ! Hello, World!
#if __MINGW64__ && USECLASS == false //don't convert struct
odbc::SQLException to std::exception
------------------------------------------------------------------------------------------------
Connecting to TRT-MRT ...
runtime_error:Kuku lele --> THIS MUST NOT HAPPEN
catch blok passed--> THIS MUST NOT HAPPEN
TRT-MRT ! Hello, World! --> THIS MUST NOT HAPPEN
#if __MINGW64__ && USECLASS == true //convert struct odbc::SQLException
to std::exception
-----------------------------------------------------------------------------------------
Connecting to TRT-MRT ...
terminate called after throwing an instance of 'vkSQLException'
what(): Failed to connect to datasource: [unixODBC][Driver
Manager]Data source name not found and no default driver specified
#if __MINGW64__ && EXPTNTEST == true //using testdll_64.dll to throw
vkSQLException
-----------------------------------------------------------------------------------
Caught std::exception from DLL: Choke me!
Connecting to TRT-MRT ...
Throwing vkSQLException from DLL.
terminate called after throwing an instance of 'vkSQLException'
what(): Failed to connect to datasource: [unixODBC][Driver
Manager]Data source name not found and no default driver specified
***************************************************************************************************
On 16.11.20. 03:09, Liu Hao wrote:
在 2020/11/16 上午5:54, gmail Vladimir Koković 写道:
Hi,
Let me try to describe what kind of problem I have with mingw-w64,
because it becomes a nightmare for me, despite the fact that I have over 30
years of experience with
C and c ++ compilers:
My ERP consists of a main program and two shared libraries.
(... snip ...)
#if __MINGW64__ && USECLASS == true && EXPTNTEST == false //convert struct
odbc::SQLException to
std::exception
class vkSQLException : public std::exception {
Try defining a virtual destructor for this class:
```c++
class vkSQLException : public std::exception
{
virtual ~vkSQLException();
};
// in your DLL, create a .cpp file that contains:
vkSQLException::
~vkSQLException()
{
}
```
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public