compiling harbour x64

622 views
Skip to first unread message

m.asur

unread,
Jan 13, 2021, 9:53:10 AM1/13/21
to Harbour Users

Hi, i'm almost new to harbour and to gcc, i try to compile harbour with this settings:
Building Harbour 3.2.0dev from source - https://harbour.github.io
MAKE: mingw32-make 4.3 sh.exe   
HB_USER_CFLAGS: -D__USE_MINGW_ANSI_STDIO=0 -DHB_OPENSSL_STATIC
HB_INSTALL_PREFIX: E:\MgM64\comp\harbour
HB_BUILD_SHARED: no
HB_BUILD_DEBUG: no
HB_BUILD_STRIP: no
HB_BUILD_OPTIM: yes
HB_HOST_PLAT: win (x86_64)  HB_SHELL: nt
HB_PLATFORM: win (x86_64) (auto-detected)
HB_COMPILER: mingw64 (auto-detected: E:/MgM64/comp/mingw64/bin/)
mingw32 version is 10.2, i download curl-7.74.0_2-win64-mingw.zip and openssl-1.1.1i_2-win64-mingw.zip to include contrib packages hbssl and hbcurl
but there're many errors in building harbour.
if i don't set -DHB_OPENSSL_STATIC there're errors becouse harbour can't include "openssl/applink.c", if i don't set HB_BUILD_CONTRIB_DYN=no there're errors in linking of dynamic libs, e.g. hbssl-32-x64.dll cannot find -lssl and cannot find -lcrypto, the same for hbcurl.
What are the correct settings for compiling harbour and contribs in x64 with mingw?
Thanks and forgive my bad english!

hmpaquito

unread,
Jan 13, 2021, 10:52:58 AM1/13/21
to Harbour Users
Why to build harbour ? Try harbour's Mel Smith distribution

m.asur

unread,
Jan 13, 2021, 11:18:55 AM1/13/21
to Harbour Users
Hi,
i simply download core-master.zip from https://github.com/harbour/core, use mingw32 from http://winlibs.com/ (winlibs-x86_64-posix-seh-gcc-10.2.0-mingw-w64-8.0.0-r5.7z), openssl and curl from https://curl.se/windows/, i've unzip everything and 'ming32-make' from the root of core-master.zip archive.

It's something wrong? Pls help!

Miroslav Georgiev

unread,
Jan 14, 2021, 7:34:29 AM1/14/21
to Harbour Users
You can try this methos. It's based on hbenrico:

1. install a fresh new MSYS2 environment from here -> https://www.msys2.org/ (in my case, the 64bit version) 
2. in MSYS2 shell:
pacman -Syu
reopen ten:
pacman -Su
reopen then:
pacman -S base-devel msys2-devel mingw-w64-x86_64-toolchain upx p7zip
3. exit MSYS2 

now mingw is 10.2

4. copy/move c:\msys64 as c:\newhb\msys64
6. uncompress harbour master zip (as c:\new\hb\core-master

I got the following directory structure: 
c:\NEWHB\msys64 
c:\NEWHB\core-master 

7. run cmd
cd c:\newhb
run these comands
set PATH=c:\NEWHB\msys64\mingw64\bin;c:\NEWHB\msys64\usr\bin;%PATH%
set HB_BUILD_SHARED=yes
set HB_INSTALL_PREFIX=c:\NEWHB\hb32
set HB_WITH_MINIZIP=local
set HB_WITH_MINILZO=local
set HB_WITH_ALLEGRO=no
set HB_WITH_CAIRO=no
set HB_BUILD_3RDEXT=no
set HB_BUILD_VERBOSE=yes
set HB_IMPLIB=yes
set HB_BUILD_DYN=no
set HB_BUILD_CONTRIB_DYN=no
set HB_BUILD_SHARED=no
set HB_BUILD_STRIP=all
set HB_WITH_ZLIB=local
set HB_WITH_BZIP2=local
set HB_WITH_MXML=local
set HB_WITH_LZF=local
:: set HB_WITH_CURL=c:\NEWHB\curl\include
set HB_WITH_CURL=yes
set HB_WITH_OPENSSL=yes
set HB_STATIC_CURL=yes
set HB_STATIC_OPENSSL=yes

cd core-master
mingw32-make clean install

8. after a while Harbour x64 should be in c:\newhb\hb32_64

m.asur

unread,
Jan 14, 2021, 8:34:41 AM1/14/21
to Harbour Users
Before all, thank for your reply.
I tried building with msys2, but msys2 installation is very big and sure if i set 
set HB_BUILD_DYN=no
set HB_BUILD_CONTRIB_DYN=no
the building process success, but i think is not standard, and what's about openssl and curl? If i use the latest versions there are problems in linking with new libraries name in x64 environment...
so i tried harbour version 3.4 but there are many other errors: so, what's the right / standard way?
In harbour's Mel Smith distribution for x64 there are lots of libriaries and dll, how he make that builds?

Mel Smith

unread,
Jan 14, 2021, 11:58:26 AM1/14/21
to Harbour Users

In harbour's Mel Smith distribution for x64 there are lots of libriaries and dll, how he make that builds?

Magic & Luck and many batch files :))
-Mel
 

Miroslav Georgiev

unread,
Jan 17, 2021, 3:48:45 PM1/17/21
to Harbour Users
Hi m.asur

I use this method because (i think..) i need openssl, so it's compiled.
Can u post some function names you use from these libs, so I can check on my setup if they are available...

Miroslav Georgiev

unread,
Jan 17, 2021, 3:50:59 PM1/17/21
to Harbour Users
I have problems with Mel's build .. I think. Openssl/curl is missing from his binaries. Am I right?

José M. C. Quintas

unread,
Jan 17, 2021, 10:22:18 PM1/17/21
to harbou...@googlegroups.com

Check my workflows here:

Actions · JoseQuintas/hbpack (github.com)

Harbour 3.2 build with error using mingw 7.3

Harbour 3.2 build ok using mingw 10.2 but get errors to compile some extra libraries

Harbour 3.4 ok with mingw 7.3, mingw 10.2, and all libraries

I do not create optional libraries

I am running all again now after some changes.

Harbour 3.2 official, Harbour 3.4 with little changes to work with extra libraries (HMG, HMG Extended, HWGUI, OOHG).

It is a test work, may be deleted at any time.

May be anybody could add an official build on Harbour github.

José M. C. Quintas

--
--
You received this message because you are subscribed to the Google
Groups "Harbour Users" group.
Unsubscribe: harbour-user...@googlegroups.com
Web: http://groups.google.com/group/harbour-users

---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/harbour-users/f6160371-6d01-484c-8e18-f3e5ee80724dn%40googlegroups.com.

Mario H. Sabado

unread,
Jan 17, 2021, 10:39:48 PM1/17/21
to 'elch' via Harbour Users
Hi Jose,

Can you share your changes with Harbour 3.4 to work with HWGUI?

Regards,
Mario


José M. C. Quintas

unread,
Jan 18, 2021, 1:40:52 AM1/18/21
to harbou...@googlegroups.com

I am adjusting all.

You can check on repository, I do not remember what I change, except HBPs/HBCs, and some compatible functions.

I am changing all libraries, to compile using hbmk2 *.hbp and no other file.

In this exact momment, I create a dir *.hbp /s/b > testall.hbp, and use as container to test compile all samples at same time (hmg, hmg extended, hwgui and oohg).

on hwgui: Commits · JoseQuintas/hwgui (github.com)

on harbour 3.4: harbour-34/contrib/hbobsolete at master · JoseQuintas/harbour-34 (github.com)

On same group you will found hmg and hmg extended.

and on actions of hbpack: Actions · JoseQuintas/hbpack (github.com)

you can found process about compile harbour and all libraries using hb 3.2, hb 3.4, mingw 7.3 and mingw 10.2

github saves all screens to view when needed, with error or not.

build using harbour 3.4 + mingw 7.3 is here: 2320 · JoseQuintas/hbpack@935b93b (github.com)

José M. C. Quintas

José M. C. Quintas

unread,
Jan 18, 2021, 1:48:42 AM1/18/21
to harbou...@googlegroups.com

But I use official version and no problem too.

You will need only by-pass functions, except for win_p2n(() and win_n2p() (do not remember if hwgui need this too, because I adjust all libraries at same time).

Some examples:

FUNCTION hb_CallDll32(...); RETURN hb_CallDll(...)

FUNCTION hb_OsNewLine(); RETURN hb_Eol()

About win_p2n() and win_n2p(), there are note on changelog about where to found them, a direct link to source-code.

José M. C. Quintas


Em 18/01/2021 00:39, Mario H. Sabado escreveu:

jmcqu...@gmail.com

unread,
Jan 18, 2021, 1:53:33 AM1/18/21
to Harbour Users

Image with All tests running on github.
José M. C. Quintas
hb34.png

Mario H. Sabado

unread,
Jan 18, 2021, 3:30:56 AM1/18/21
to 'elch' via Harbour Users
Thanks Jose for the hints.  Will test

Regards,
Mario


José M. C. Quintas

unread,
Jan 18, 2021, 3:40:20 PM1/18/21
to harbou...@googlegroups.com

I do not end to recompe all samples.

A common thing on libraries is about resource: mingw can't compile resource with screens.

This kind of resource need to be compiled with another tool, from RC to RES.

After this, ok with mingw.

RC is valid, RES is valid, but RC with specific windows resources no.

like this one

hwgui/repbuild.rc at master · JoseQuintas/hwgui (github.com)

José M. C. Quintas


Em 18/01/2021 00:39, Mario H. Sabado escreveu:
Message has been deleted
Message has been deleted

m.asur

unread,
Jan 19, 2021, 3:26:04 AM1/19/21
to Harbour Users
I thinked that in open source projects there are no secrets...

Why thereisn't some document that show the way to build harbour with libraries and the most importants (curl and openssl) contribs?
I can't believe that!
Of course i'm not expert in gcc and developing tools, but Isn't it the spirit of open source to make everyone grow, for greater awareness, or do we fall back into the contradictions of closed source projects?

Miroslav Georgiev

unread,
Jan 19, 2021, 6:46:48 AM1/19/21
to Harbour Users
I also found difficult to compile Harbour myself. Unfortunately binaries at https://sourceforge.net/projects/harbour-project/files/ are 32-bit only ;(
Where you download MinGW 10.2 from?

m.asur

unread,
Jan 19, 2021, 7:03:40 AM1/19/21
to Harbour Users
I use mingw32 from http://winlibs.com/ (winlibs-x86_64-posix-seh-gcc-10.2.0-mingw-w64-8.0.0-r5.7z).

Miroslav Georgiev

unread,
Jan 21, 2021, 6:08:39 PM1/21/21
to Harbour Users
what libs are missing. these?
lib\win\mingw64\libhbssl.a
lib\win\mingw64\libhbssls.a  
lib\win\mingw64\liblibssl-1_1-x64.a

lib\win\mingw64\libhbcurl.a
lib\win\mingw64\libhbcurls.a  

Reply all
Reply to author
Forward
0 new messages