Teach me how to build Harbour on MAC

591 views
Skip to first unread message

Pritpal Bedi

unread,
Dec 11, 2014, 4:51:04 PM12/11/14
to harbou...@googlegroups.com
Hello Everybody

I have just received MacAir and iPhone for an HbQt application 
to be deployed on iPhone. The same application works well on Android.

Please be precise. Consider me a kid. Give step-by-step instructions 
as to how download Harbour, compile it statically and dynamically on Mac,
how to download QtContribs and compile it statically.

Static compile is the key as App Store does not accept 
dyanamically linked apps. I am about to subscribe for Qt Indie license, 
which I suppose will have static libraries all all OSes.

This will be my first encounter with Mac OS.


Pritpal Bedi
a student of software analysis & concepts
a kid on MAC | LINUX

Lorenzo Fiorini

unread,
Dec 12, 2014, 12:56:49 AM12/12/14
to harbou...@googlegroups.com
On Thu, Dec 11, 2014 at 10:51 PM, Pritpal Bedi <bedipr...@gmail.com> wrote:

> Please be precise. Consider me a kid. Give step-by-step instructions
> as to how download Harbour, compile it statically and dynamically on Mac,
> how to download QtContribs and compile it statically.

I cannot help you with QtContribs or IOS but OSX is my primary platform.

Readme.md has all the info you need but this is how I usually do:

- install Xcode from the Apple Store ( with command line Tools )
- install Homebrew packaging system from brew.sh
- brew install all the contribs dependency you need ( f.e. brew
install git qt5 ... )
- git clone harbour-core
- make
- make install

Let me know if it's enough.

best regards,
Lorenzo

Pritpal Bedi

unread,
Dec 12, 2014, 6:11:27 AM12/12/14
to harbou...@googlegroups.com
Hi Lorenzo


 
I cannot help you with QtContribs or IOS but OSX is my primary platform.


That will be of immense help to me.
 

Readme.md has all the info you need but this is how I usually do:


Yep, I discovered that and followed the points as described there.
And which you have described below. I could get Harbour compiled 
with "clang".  But somehow I could not saw "Hello World" on the screen,
though I feel hello.prg was compiled and linked ok per hbmk2 output.
I will look deep what I missed tomorrow.

 
- install Xcode from the Apple Store ( with command line Tools )


Installing Homebrew did it itself. But later I also installed XCode 6.2 studio.
That is needed for iOS builds.

 
- install Homebrew packaging system from brew.sh


That was easy.
 

- brew install all the contribs dependency you need ( f.e. brew
install git qt5 ... )


I did not install qt5, instead downloaded the Qt 5.4 Mac and iOS combined .dmg.
I could execute Qt Creator which prompted me to install XCode 5.0 at least.
I opted for XCode 6.2 beta to remain relevant for some more time in future.
I closed the QtCreator, then later, I could not find a way how to execute it 
later. I tried all I could do for an hour but failed.
 
- git clone harbour-core
- make
- make install


That went fine.
 

Let me know if it's enough.


Thank you in extending the helping hand. I will have many 
questions coming in learning curve. For now just tell me 
where should I look to start Qt Creator. The execuatable resides 
in and as /users/Qt540/Qt  Creator.app.


Regards

Lorenzo Fiorini

unread,
Dec 12, 2014, 6:36:25 AM12/12/14
to harbou...@googlegroups.com
On Fri, Dec 12, 2014 at 12:11 PM, Pritpal Bedi <bedipr...@gmail.com> wrote:

> Installing Homebrew did it itself. But later I also installed XCode 6.2
> studio.
> That is needed for iOS builds.
> ...
> I did not install qt5, instead downloaded the Qt 5.4 Mac and iOS combined
> .dmg.
> I could execute Qt Creator which prompted me to install XCode 5.0 at least.
> I opted for XCode 6.2 beta to remain relevant for some more time in future.
> I closed the QtCreator, then later, I could not find a way how to execute it
> later. I tried all I could do for an hour but failed.

You'be chosen a different path so it's hard for me to guess what can
be wrong now.

I have Qt tools ( but not QT Creator ) in the LaunchPad.
I've never used them, I use qt5 only to build gtqtc, but if I click on
them they start.

Usually big applications are in Finder Go Applications but you said
/Users/QT540/QT Creator.app
which is strange since QT540 looks like a username.

best regards,
Lorenzo

Dušan D. Majkić

unread,
Dec 12, 2014, 8:00:20 AM12/12/14
to Harbour Users
> I closed the QtCreator, then later, I could not find a way how to execute it
> later. I tried all I could do for an hour but failed.

I had same issue. Here is what I did:

Go to Finder (klick on first icon - "smiling Mac" in dock).
Go to Home dir (on main menu item "Go", click on "Home")

You should see your home contents (Downloads, Documents, etc)

One of those directories is "Qt" - it is the default location for
official Qt install.
Expand "Qt", and scroll a bit down to the "Qt Creator.app".

Double click to open QtCreator.

When it is opened, you should see its icon on the Dock.
Righ click QtCreator icon, and click on Options->"Keep on Dock"

It should stay there for easy access after you close application .

Dušan D. Majkić

unread,
Dec 12, 2014, 8:03:40 AM12/12/14
to Harbour Users
Or form command line type

open ~/Qt/Qt\ Creator.app

Then choose to keep app icon in the dock.

Dušan D. Majkić

unread,
Dec 12, 2014, 9:29:00 AM12/12/14
to Harbour Users
It seems that on darwin (Mac OS X) Harbour force qt5 installed from homebrew

In file contrib/gtqtc/gtqtc.hbp there is:

-depincpath=qt5:/usr/local/opt/qt5/include{darwin}

I believe that Include path from HB_WITH_QT should also be
regarded, so that installations from Qt official installer could be used.

This is important since "brew install qt5" installs open source version,
and Qt5 has commercial versions for mobile (with appstore support),
and enterprise versions (with some extra components).

Pritpal Bedi

unread,
Dec 12, 2014, 4:03:00 PM12/12/14
to harbou...@googlegroups.com
Thanks

open  ~/Qt/Qt\ Creator.app


It worked. Basic things but difficult for first timers.


Pritpal Bedi 

miguel

unread,
Dec 15, 2014, 12:08:04 PM12/15/14
to harbou...@googlegroups.com
Hi everyone,

I'm trying the same without success.
I was in doubt about opening a new thread, but this does not seem closed.

I got Harbour running ok. But am unable to build qtcontribs.
Here are my steps On OS X 10.9.5 Mavericks.
* OS is up to date and Xcode too via AppStore
* Make sure command line tools are installed. In terminal:
# check if installed:
pkgutil --pkg-info=com.apple.pkg.CLTools_Executables
# returns info on version and tools
# if not do (and recheck for personal pleasure)
xcode-select --install # runs nice GUI to instal command line tools

* using homebrew (as suggested in Harbour README.md)
brew install pcre slang qt5 # I ditched the cairo, freeimage libgd mysql postgresql suggestions. graphics and dbs suppose no trouble
brew install upx uncrustify ack # same for optipng jpegoptim

* get Harbour from git

# can use svn or just download

* Create environment - Is there something missing?
export HB_QTPATH=/usr/local/opt/qt5/bin
export PATH=/Users/ME/hb32/bin/darwin/clang:$PATH
export HB_WITH_QT=/usr/local/opt/qt5/include
export HB_INSTALL_PREFIX=/Users/ME/hb32 # by default this is /opt/harbour not sure if relevant

* build Harbour
cd hb32
make
make install

* minimal test Harbour
cd tests
hbmk2 hello.prg
./hello
# Should print: Hello, world!

* move qtcontribs contents to hb32/addons
* build qtcontribs
cd ../hb32/addons
hbmk2 qtcontribs.hbp

At this point I get:
fatal error: 'glib.h' file not found

Tried installing glib using home-brew. Rebuilding qtcontribs fails.

Anyone knows what I'm doing wrong?
txs,
Miguel


Reply all
Reply to author
Forward
0 new messages