xHarbour-org / xharbour

xHarbour is a portable implementation of the Clipper/xBase language (Compiler & complete Run-time libraries). It's practically 100% backward compatible with CA-Clipper 5.2e and 5.3c, and offers many modern language extensions, and extensive Run-time libraries.
http://www.xharbour.org
GNU General Public License v2.0
39 stars 18 forks source link

Compile error MINGW+BISON #5

Closed Numerabilis closed 1 year ago

Numerabilis commented 1 year ago

make_gc.log C:\xhbgit>make_gc all Creating System Files (ST) ...

Error:

'cat' nÆo ‚ reconhecido como um comando interno ou externo, um programa oper vel ou um arquivo em lotes. mingw32-make.exe: *** [obj/gc/hbver.c] Error 1

My batch env:

SET BISON_DIR=\GnuWin32\Bin
SET CC_DIR=\MinGW

SET PATH=C:\XHBGIT\BIN;C:\MinGW\bin;C:\GnuWin32\Bin;C:\WINDOWS
SET HB_DIR=C:\XHBGIT
SET HB_PATH=C:\XHBGIT
SET INCLUDE=C:\XHBGIT\INCLUDE;C:\MinGW\INCLUDE
SET LIB=C:\XHBGIT\LIB;C:\MinGW\LIB
ronpinkas commented 1 year ago

If I understand correctly it says "cat" is an unknown command - cat is a standard Linux command, you should check your MingW installation to see how make 'cat' work it's like dos's type command.

On Jun 9, 2023, at 10:45 AM, Anderson Cardoso Silva @.***> wrote:

Error:

'cat' nÆo ‚ reconhecido como um comando interno ou externo, um programa oper vel ou um arquivo em lotes. mingw32-make.exe: *** [obj/gc/hbver.c] Error 1

C:\xhbgit>make_gc all Creating System Files (ST) ...

My batch env:

SET BISON_DIR=\GnuWin32\Bin SET CC_DIR=\MinGW

SET PATH=C:\XHBGIT\BIN;C:\MinGW\bin;C:\GnuWin32\Bin;C:\WINDOWS SET HB_DIR=C:\XHBGIT SET HB_PATH=C:\XHBGIT SET INCLUDE=C:\XHBGIT\INCLUDE;C:\MinGW\INCLUDE SET LIB=C:\XHBGIT\LIB;C:\MinGW\LIB — Reply to this email directly, view it on GitHub https://github.com/ronpinkas/xharbour/issues/5, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADYCEIYL6THBHZB4KC2CIX3XKNAIJANCNFSM6AAAAAAZA2C7EE. You are receiving this because you are subscribed to this thread.

marcosgambeta commented 1 year ago

Add this:

SET HB_ARCHITECTURE=w32

Numerabilis commented 1 year ago

Hi Marcos,

I did it and it ran further but it still got errors: C:\xhbgit>make_gc all

In file included from source\rtl\hbsocket.c:232:0: source\rtl\hbsocket.c: In function 'hb_socketSetOsError': source\rtl\hbsocket.c:1123:12: error: 'ERROR_NOT_ENOUGH_MEMORY' undeclared (first use in this function) case WSA_NOT_ENOUGH_MEMORY: ^ source\rtl\hbsocket.c:1123:12: note: each undeclared identifier is reported only once for each function it appears in source\rtl\hbsocket.c: In function 'hb_socketGetIFaces': source\rtl\hbsocket.c:4101:29: error: 'ERROR_BUFFER_OVERFLOW' undeclared (first use in this function) if( dwResult == ERROR_BUFFER_OVERFLOW ) ^~~~~ source\rtl\hbsocket.c:4107:29: error: 'NO_ERROR' undeclared (first use in this function) if( dwResult == NO_ERROR ) ^~~~ mingw32-make.exe: *** [obj\gc\hbsocket.o] Error 1 make_gc.log make0_gc.log

Logs are attached.

My env batch file:

SET BISON_DIR=\GnuWin32\Bin
SET CC_DIR=\MinGW
SET HB_ARCHITECTURE=w32

SET PATH=C:\XHBGIT\BIN;C:\MinGW\bin;C:\GnuWin32\Bin;C:\WINDOWS
SET HB_DIR=C:\XHBGIT
SET HB_PATH=C:\XHBGIT
SET INCLUDE=C:\XHBGIT\INCLUDE;C:\MinGW\INCLUDE
SET LIB=C:\XHBGIT\LIB;C:\MinGW\LIB
marcosgambeta commented 1 year ago

Anderson,

Try the steps below:

1) Use a recent version of the C/C++ compiler:

Suggestion: https://github.com/brechtsanders/winlibs_mingw/releases/download/13.1.0-16.0.5-11.0.0-msvcrt-r5/winlibs-i686-posix-dwarf-gcc-13.1.0-mingw-w64msvcrt-11.0.0-r5.7z (from https://winlibs.com)

2) Compile using only the settings below (adjust the paths):

SET CC_DIR=C:/mingw32/ SET BISON_DIR=C:/gnuwin32/bin SET HB_ARCHITECTURE=w32 CALL make_gc.bat all

Works for me. I get only warning's and none errors.

Numerabilis commented 1 year ago

Hooray!! It worked with GCC v13.1.0!!! No warnings and no errors!!! Thanks, Marcos!

It was missing one more var: SET HB_COMPILER=mingw32 After that it compiled and copied everything to the right place. That GCC v13.1.0 creates mingw32 folder and not mingw. My full environment was this:

SET BISON_DIR=\GnuWin32\Bin
SET CC_DIR=\MinGW32
SET HB_ARCHITECTURE=w32
SET HB_COMPILER=mingw32

All working 100%