Error when compiling src\rtl\hbdyn.c in C++ mode (32-bit and C++11)

129 views
Skip to first unread message

marcosgambeta

unread,
Nov 20, 2020, 6:45:04 AM11/20/20
to Harbour Developers
Hi all,

The compilation of the current Harbour in C++ mode (C++11) with MinGW 5.3 32-bit don't work:

g++   -I. -I../../../../../include -W -Wall -O3 -fomit-frame-pointer -march=i586 -mtune=pentiumpro  -DUNICODE -DHB_HAS_PCRE -ID:/harbour320_mingw530_32/core-master/src/3rd/pcre -DPCRE_STATIC -DHB_HAS_ZLIB -ID:/harbour320_mingw530_32/core-master/src/3rd/zlib -std=c++11 -ohbdyn.o  -c ../../../hbdyn.c
../../../../../config/rules.mk:88: recipe for target 'hbdyn.o' failed
../../config/lib.mk:68: recipe for target 'descend' failed
../config/dir.mk:68: recipe for target 'rtl.inst' failed
config/dir.mk:68: recipe for target 'src.inst' failed

See the logs in the attached zip.

Regards,
Marcos Gambeta
core-master.zip

marcosgambeta

unread,
Nov 26, 2020, 2:48:40 AM11/26/20
to Harbour Developers
The errors are related with _cdecl and _stdcall.

With the changes below, the compilation are ok:

#if defined( HB_OS_WIN ) || defined( HB_OS_OS2 )
#ifdef __cplusplus
   #define HB_CDECL  __cdecl
#else
   #define HB_CDECL  _cdecl
#endif
#else
   #define HB_CDECL
#endif

...

#if defined( HB_OS_WIN )

#ifdef __cplusplus
HB_DYN_CTYPE_DECL( HB_U32, __stdcall, FX86_S32 );
HB_DYN_CTYPE_DECL( HB_U64, __stdcall, FX86_S64 );
HB_DYN_CTYPE_DECL( double, __stdcall, FX86_SDB );
HB_DYN_CTYPE_DECL( float,  __stdcall, FX86_SFL );
#else
HB_DYN_CTYPE_DECL( HB_U32, _stdcall, FX86_S32 );
HB_DYN_CTYPE_DECL( HB_U64, _stdcall, FX86_S64 );
HB_DYN_CTYPE_DECL( double, _stdcall, FX86_SDB );
HB_DYN_CTYPE_DECL( float,  _stdcall, FX86_SFL );
#endif

#endif

Regards,
Marcos Gambeta
Reply all
Reply to author
Forward
0 new messages