Harbour and Unix

138 views
Skip to first unread message

Ani Garza T

unread,
Aug 17, 2015, 7:09:33 PM8/17/15
to Harbour Users
Hi, 

I've been a Clipper programer since 1986, and I like it very much. All my programs worked great until Windows 64 bit arrived. 
So I am compiling my clipper programs with Harbour and they are working great in windows 32 and 64 bits.

I use the HBMK2 to compile my project. 

I just have one question because I need to run a program in UNIX.

How do I need to compile it in order to run on UNIX?  Can I simply install the same files I install on DOS?  Will the file.exe  generated when I compiled with HBMK2 run on UNIX?  May I compile under DOS for a UNIX version?  I need to compile in my computer and be able to install in a UNIX server.

Does the same HBMK2 version to compile will work for UNIX?

Any help is really appreciated, thanks,  -Ani Garza T 

Maurício Ventura Faria

unread,
Aug 18, 2015, 7:34:36 AM8/18/15
to harbou...@googlegroups.com
Hi Ani.
I did something like this last week.
You need Linux to build a Linux executable, but you can do this using a Virtual Machine in Windows.
There are other solutions but what I did :
- Download VmWare Player here
https://my.vmware.com/web/vmware/free#desktop_end_user_computing/vmware_player/7_0
- Download Ubuntu 14.04.2 image for VmWare here
http://www.osboxes.org/ubuntu/
- Run the Ubuntu VM image and configure as you need/like...

- Install git
sudo apt-get install git
- Download Harbour source code ( I use Viktor's fork...  https://github.com/vszakats/harbour-core READ !!! )
git clone https://github.com/vszakats/harbour-core.git harbour-core
- Generate Harbour binaries and install
cd harbour-core
make
sudo make install
- Test Hello World !
cd tests
hbmk2 hello.prg
./hello
Harbour should be Ok now.
 
Beyond other things, you very probably will face some issues with capitalization and paths, as they are different in Windows and Linux worlds... #ifdef / #endif is a good friend when different code is needed in different platforms !
Share your source code via SAMBA ( or copy it to the Linux VM, but sharing you can use the Windows text editor you are comfortable with ) and go Harbour !
 
If you need any help please ask.
 
[[]] Maurício Faria
--
--
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.
For more options, visit https://groups.google.com/d/optout.

Ani Garza T

unread,
Aug 18, 2015, 9:51:40 AM8/18/15
to harbou...@googlegroups.com
Hi Mauricio,

Thanks for your response, I'll go over the information you sent.

Do I need another version of Harbour, or may I use the same version I use for DOS?  Can I use the same HBMK2 and use the same myfile.hbp.

I create the Harbour exe like this:

c:\hbmk2  myfile.hbp

myfile.hbp file contains the following:

-omyprogram
-w0
-es2
-rebuild
-ldflag=-Wl,--allow-multiple-definition

mainprogram

___________
I really don´t understand the parameters, but my programs get compiled and linked with this .hpb generating an exe and working great!!  I am really surprised how well Harbour works with my old Clipper programs. Now I need to generate the .exe or .bin so that it runs on UNIX.

Thanks for your help!!  -Ana






You received this message because you are subscribed to a topic in the Google Groups "Harbour Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/harbour-users/C7xwkA3fcmY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to harbour-user...@googlegroups.com.

Maurício Ventura Faria

unread,
Aug 18, 2015, 1:51:02 PM8/18/15
to harbou...@googlegroups.com
Hi Ani.
 
Seems you know almost nothing about UNIXes, you will need to learn a bit before proceed...
Don't worry UNIXes are not my day to day too but with some basic commands it's possible I play a little.
At first, there isn't "an" UNIX, there are UNIX "flavors" and, although they are very similar, there are differences.
I talked about a flavor called Linux which is the most used nowadays, and even Linux has hundreds of different "flavors" !
My suggestion was Ubuntu Linux because it seems to be the most Linux flavor used.
Do you know which UNIX flavor are you targeting ?

You use the .hbp in the same way in Windows and UNIXes, there is no problem here.
--allow-multiple-definition is not recommended.
 
[[]] Maurício Faria

Ani Garza T

unread,
Aug 18, 2015, 2:16:24 PM8/18/15
to harbou...@googlegroups.com
Thanks Mauricio,

I'll test with your recomendations, best regards, -Ani

Reply all
Reply to author
Forward
0 new messages