D 2023-07-24T10:16:09.291 J foundin 3.3.0 J icomment When\scompiling\sapplications\sthat\suse\sMySQL++\swith\sMingW\s(GNU-C\sfor\sWindows),\stwo\swarnings\sappear\sthat\scan\sbe\savoided:\r\n\r\nWarning\s1:\r\n\tC:\\MySQL++\\3.3.0\\include/common.h:56:\swarning:\s"NOMINMAX"\sredefined\r\n\t\t56\s|\s\s#define\sNOMINMAX\r\nSolution:\sWe\scan\sprevent\sthis\sby\schanging\s"common.h"\swith\swhen\s#defining\sNOMINMAX:\r\n\r\n\t//Don't\sdefine\sNOMINMAX\swhen\scompiling\swith\sGNU\sC\s(MingW)\r\n\t#if\s!defined\s(__GNUC__)\r\n\t\t//\sDon't\slet\swindows.h\s(via\sConnector/C)\s#define\smin/max\r\n\t\t#define\sNOMINMAX\r\n\t#endif\r\n\r\nWarning\s2:\s"warning:\stype\sattributes\signored\safter\stype\sis\salready\sdefined\s[-Wattributes]"\r\n\tThis\swarning\sappears\sin\sseveral\sfiles,\sfor\sexample:\r\n\t\tC:\\MySQL++\\3.3.0\\include/cpool.h:42:22:\swarning:\stype\sattributes\signored\safter\stype\sis\salready\sdefined\s[-Wattributes]\r\n\t\t\t42\s|\sclass\sMYSQLPP_EXPORT\sConnection;\r\nSolution:\sChanging\sthe\sdefinition\sof\sMYSQLPP_EXPORT\sin\scommon.h:\r\n\r\n\t//\sDefine\sDLL\simport/export\stags\sfor\sWindows\scompilers,\swhere\swe\sbuild\r\n\t//\sthe\slibrary\sinto\sa\sDLL,\sfor\sLGPL\slicense\scompatibility\sreasons.\r\n\t//\s(This\sis\sbased\son\sa\ssimilar\smechanism\sin\swxWindows.)\r\n\t#if\sdefined\s(__GNUC__)\r\n\t\t//Don't\sset\sDLL\simport/export\stags\sfor\sGNU\sC\s(MingW)\r\n\t\t#define\sMYSQLPP_EXPORT\r\n\t#else\s\r\n\t\t#ifdef\sMYSQLPP_MAKING_DLL\r\n\t\t\t//\sWhen\smaking\sthe\sDLL,\sexport\stagged\ssymbols,\sso\sthey\sappear\r\n\t\t\t//\sin\sthe\simport\slibrary.\r\n\t\t\t#define\sMYSQLPP_EXPORT\s__declspec(dllexport)\r\n\t\t#elif\s!defined(MYSQLPP_NO_DLL)\r\n\t\t\t//\sWe\smust\sbe\s_using_\sthe\sDLL,\sso\simport\ssymbols\sinstead.\r\n\t\t\t#define\sMYSQLPP_EXPORT\s__declspec(dllimport)\r\n\t\t#else\r\n\t\t\t//\sNot\smaking\sa\sDLL\sat\sall,\sso\sno-op\sthese\sdeclspecs\r\n\t\t\t#define\sMYSQLPP_EXPORT\r\n\t\t#endif\r\n\t#endif\r\n\r\nHope\sthis\shelps!\r\nM J login anonymous J mimetype text/plain J private_contact 6b6e81fe47844b8a0c44c73c70f577f7454cbb3f J severity Minor J status Open J title Warnings\scompiling\sin\sWindows\swith\sMingW J type Code\sDefect K d90247c72808a8e7cb5c3b910e6b7a96e46d8d12 U anonymous Z 871b9c86401dd9ee978e83cf7076123f