Closed ghost closed 2 years ago
If memory serves those functions in old versions of MSVCRT are only available as _snprintf, _strdup etc ... so I have macros in dwcompat.h that point snprintf strdup etc to them... I don't remember which are which... but dwcompat.h may require changes to be C++ compatible if that is what this issue is relating to.
If memory serves those functions in old versions of MSVCRT are only available as _snprintf, _strdup etc ... so I have macros in dwcompat.h that point snprintf strdup etc to them... I don't remember which are which... but dwcompat.h may require changes to be C++ compatible if that is what this issue is relating to.
No. This is not related to C++. I compiled dwtest.c with gcc from MinGW-W64 and it fails, after commenting out dwcompat.h it now compiled and run fine. Maybe you should add a macro in dwtest.c to check for MinGW-W64, if it's MinGW-W64's gcc then don't include dwcompat.h. This macro could be served as a template for us to copy to our own source file too.
To check for MINGW-W64 you could check for the macro __MINGW32__
(which is defined for both 32 bit and 64 bit version of MINGW-W64). As I know the macro __MINGW64__
is only defined on MINGW-W64 64 bit and the macro __MINGW__
is not defined at all (doesn't sure about that, you could check it yourself).
MINGW64 is one of the compilers I test with, not sure why it wouldn't compile.. but I'll double check it when I get some time later this week. There are a number of variations of that compiler though, can you tell me which one specifically you are using? I think I was using the TDM version: https://jmeubank.github.io/tdm-gcc/download/
I tested with a newer version of MingW64, it seems that _MSC_VER is no longer defined, so I added MINGW32 check as well. See if the latest commit fixes it. Forgot to mention this issue in the commit though.
https://github.com/dbsoft/dwindows/commit/2c5e4be5da6b85f2d9ccf61c56f6c5505782cbe8
I tested with a newer version of MingW64, it seems that _MSC_VER is no longer defined, so I added MINGW32 check as well. See if the latest commit fixes it. Forgot to mention this issue in the commit though.
Please have a look at line 274 of dwcompat.h, you forgot to add the MinGW-W64 check here. Change it to this fixed the problem: #if !defined(_MSC_VER) && !defined(__MINGW32__)
Please have a look at line 274 of dwcompat.h, you forgot to add the MinGW-W64 check here. Change it to this fixed the problem:
#if !defined(_MSC_VER) && !defined(__MINGW32__)
That is what I changed it to. Did it not work for you?
Please have a look at line 274 of dwcompat.h, you forgot to add the MinGW-W64 check here. Change it to this fixed the problem:
#if !defined(_MSC_VER) && !defined(__MINGW32__)
That is what I changed it to. Did it not work for you?
Sorry. I forgot to replace the dwcompat.h in your 3.2 release with the latest from github :smile:
Ok, going to close this issue then... if there is anything else feel free to reopen it!
In dwtest.c:
I wanted to know how old these Windows SDKs are for dwcompat to be required. I'm using MinGW-W64 and dwcompat.h is causing problems. Comment out the block of code above solved it.