Git Product home page Git Product logo

harbour / core Goto Github PK

View Code? Open in Web Editor NEW
322.0 78.0 208.0 145.49 MB

Portable, xBase compatible programming language and environment

Home Page: https://harbour.github.io/

License: Other

Makefile 0.54% Harbour 0.41% C 80.30% C++ 0.43% xBase 17.80% CSS 0.01% JavaScript 0.02% HTML 0.03% XSLT 0.01% Ruby 0.01% Shell 0.03% NSIS 0.05% Batchfile 0.04% Yacc 0.33% Roff 0.01% VBScript 0.01% VBA 0.01%

core's Introduction

Welcome to Harbour Build Status

Harbour is the free software implementation of a multi-platform, multi-threading, object-oriented, scriptable programming language, backward compatible with Clipper/xBase. Harbour consists of a compiler and runtime libraries with multiple UI and database backends, its own make system and a large collection of libraries and interfaces to many popular APIs.

Table of Content

  1. Guarantees and Liability
  2. How to Participate
  3. How to Get
  4. How to Build
  5. How to Do a Partial Build
  6. How to Create Distributable Packages
  7. How to Enable Optional Components
  8. Build Options
  9. Build Examples
  10. Build Your Own Harbour App
  11. Debugging Options
  12. Troubleshooting
  13. Supported Platforms and C Compilers
  14. Platform Matrix
  15. External links
  16. Harbour Links

Guarantees and Liability

This document and all other parts of Harbour are distributed in the hope they will be useful, but there is NO GUARANTEE that they are complete, accurate, non-infringing or usable for any purpose whatsoever. Contributors are NOT LIABLE for any damages that result from using Harbour in any ways. For more legal details, see LICENSE.

If you think you can make Harbour better, start to contribute. See How to Participate.

The information this document is subject to change without notice and does not represent any future commitment by the participants of the project.

How to Participate

There are several ways to help making Harbour better:

  • You can give feedback/suggestions to developers on available channels, see Harbour Links.

  • Submit a change:

    1. Fork Harbour
    2. Create a branch: git checkout -b my_mod
    3. Do commit pre-check and new log entry: hbrun bin/commit
    4. Commit your changes: git commit -am "Added my feature"
    5. Push to the branch: git push origin my_mod
    6. Open a Pull Request
  • Always use the same coding/formatting style as you find in the files you're modifying. The easiest way to achieve this is to use these commands to format the sources:

      $ uncrustify -c <harbour_dir>/bin/harbour.ucf <source(.c|.h)>
      $ <harbour_dir>/bin/hbformat <source(.prg|.hb|.ch)>
    
  • Text editor setting for Harbour files

    • Encoding is either 7-bit ASCII or UTF-8 (without BOM)
    • Always use spaces, never tabs
    • Remove trailing spaces from lines
    • Always keep one (not zero or multiple) newline at the end of file
    • Use platform native newline (CRLF or LF)
  • In the rare case you need to send something large (> 100KB), use this free service.

  • Of course, there is more into Harbour contribution than writing code, so you're welcome to do so in other areas like documentation, helping fellow users, giving input on decisions, testing in various environments, volunteering in administration tasks, etc.

  • Participate in localization:
    Localization Status

How to Get

Stable versions

Harbour stable binary download

Download binary archive from this page and unpack or install:

Harbour stable source download

Download source archive from this page and unpack:

Unstable versions

WARNING: Recommended for users contributing to Harbour development, following the development mailing list, commits and reading ChangeLog.txt.

Harbour live source repository

You'll need Git version control software installed on your system, and issue this command:

git clone https://github.com/harbour/core.git harbour-core

You can get subsequent updates using this command:

git pull

Harbour unstable sources

Download source archive from any of these links and unpack:

Harbour unstable binaries (updated once a day from live source repository)

Windows (unified):

Follow commits using any of these facilities

How to Build

Before reporting a problem to developers, make sure to read Troubleshooting and try the suggestions you find there.

For all platforms you'll need:

  • Supported ANSI C compiler
  • GNU Make (3.81 recommended, minimum 3.79 required, see also platform details)
  • Harbour sources (2.0.0 or upper)

on Windows hosts (possible cross-build targets: Windows CE, MS-DOS, OS/2, Linux)

Platform specific prerequisites:

  1. Windows XP or upper system is recommended to build Harbour.
  2. Make sure to have your C compiler of choice properly installed in PATH. Refer to your C compiler installation and setup instructions for details. It's recommended to make sure no tools in your PATH belonging to other C compilers are interfering with your setup. It's also highly discouraged to keep multiple copies of the same compiler, or different versions of the same compiler in PATH at the same time. For the list of supported compilers, look up Supported Platforms and C Compilers.
  3. GNU Make 3.81 or upper is required. A copy of this tool is included in all Harbour packages, so you don't have to do anything. If you want to get it separately, you can find it here Unpack it to your PATH or Harbour source root directory, and run it as mingw32-make.

To build:

> win-make [install]

To test it, type:

> cd tests
> ..\bin\hbmk2 hello.prg
> hello

You should see Hello, world! on screen.

on Windows hosts with POSIX shells (MSYS/Cygwin)

Though you can use these alternative shells to build Harbour on Windows, it's generally recommended to use the native one.

To build:

> sh -c make [install]

To test it, type:

> cd tests
> ..\bin\hbmk2 hello.prg
> hello

You should see Hello, world! on screen.

When building for Borland C++ make sure that GNU Make is executed when typing make, Borland Make has the same name.

on MS-DOS hosts (possible cross-build targets: Windows, OS/2, Linux)

Make sure to have your C compiler of choice properly installed in PATH.

To build:

> dos-make [install]

To test it, type:

> cd tests
> ..\bin\hbmk2 hello.prg
> hello

You should see Hello, world! on screen.

on OS/2 hosts (possible cross-build targets: MS-DOS, OS/2, Linux)

To build:

> os2-make [install]

To test it, type:

> cd tests
> ..\bin\hbmk2 hello.prg
> hello

You should see Hello, world! on screen.

on Linux hosts (possible cross-build targets: Windows, Windows CE, MS-DOS, OS/2)

To build:

$ make [install] [HB_PLATFORM=<...>]

To test it, type:

$ cd tests
$ hbmk2 hello.prg
$ ./hello

You should see Hello, world! on screen.

on Darwin (OS X) hosts (possible cross-build targets: Windows, Windows CE, MS-DOS)

Platform specific prerequisite: Xcode or Command Line Tools for Xcode installed

To build:

$ make [install] [HB_PLATFORM=<...>]

To test it, type:

$ cd tests
$ hbmk2 hello.prg
$ ./hello

You should see Hello, world! on screen.

You can override default (host) architecture by adding values below to HB_USER_CFLAGS, HB_USER_LDFLAGS envvars, you can use multiple values:

Intel 32-bit: -arch i386
Intel 64-bit: -arch x86_64
PPC 32-bit: -arch ppc
PPC 64-bit: -arch ppc64

on FreeBSD hosts

Platform specific prerequisites:

  1. You'll need to have the developer tools installed.

  2. Then you'll need to install gmake and optionally bison. If you installed the ports collection, then all you need to do to install bison and gmake is to run the following commands, which may require that you run su root first to get the correct permissions:

     $ cd /usr/ports/devel/gmake
     $ make
     $ make install
     $ make clean
     $ cd /usr/ports/devel/bison
     $ make
     $ make install
     $ make clean
    

To build:

$ gmake install

To test it, type:

$ cd tests
$ hbmk2 hello.prg
$ ./hello

You should see Hello, world! on screen.

on Minix hosts

Install GNU make from the Minix pkgsrc repository; for details see here.

Optionally, GCC may also be installed if you wish to use that instead of Clang, the Minix system compiler.

on other *nix hosts (possible cross-build targets: Windows, Windows CE, MS-DOS)

To build:

$ gmake [install] [HB_PLATFORM=<...>]

Or

$ make [install] [HB_PLATFORM=<...>]

To test it, type:

$ cd tests
$ hbmk2 hello.prg
$ ./hello

You should see Hello, world! on screen.

For sunpro on Solaris:
If you have any GNU binutils stuff installed, do make sure /usr/ccs/bin (the location of the native Sun C compilation system tools) come before the GNU binutils components in your $PATH.

How to Do a Partial Build

If you want to build only a specific part of Harbour, like one core library or all core libraries, or all contrib packages, you have to do everything the same way as for a full build, the only difference is that you first have to go into the specific source directory you want to build. When starting GNU Make, all components under that dir will be built:

cd src/rtl
<make> [clean] [install]

If you want to rebuild one specific contrib package, use this:

cd contrib
hbmk2 make.hb <name> [clean] [custom hbmk2 options]

How to Create Distributable Packages

Source .tgz on *nix

$ package/mpkg_src.sh

Binary .tgz on *nix

$ export HB_BUILD_PKG=yes
$ make clean install

Binary .deb on Linux

$ fakeroot debian/rules binary

Binary .rpm on Linux

$ package/mpkg_rpm.sh

You can fine-tune the build with these options:

--with static      - link all binaries with static libs
--with ads         - build components dependent on ads (rddads)
--with allegro     - build components dependent on allegro (gtalleg)
--with cups        - build components dependent on cups (hbcups)
--with cairo       - build components dependent on cairo (hbcairo)
--with curl        - build components dependent on libcurl (hbcurl)
--with firebird    - build components dependent on firebird (hbfbird, sddfb)
--with freeimage   - build components dependent on freeimage (hbfimage)
--with gd          - build components dependent on gd (hbgd)
--with mysql       - build components dependent on mysql (hbmysql, sddmy)
--with odbc        - build components dependent on odbc (hbodbc, sddodbc)
--with pgsql       - build components dependent on pgsql (hbpgsql, sddpg)
--with localzlib   - build local copy of zlib library
--with localpcre   - build local copy of pcre library
--without x11      - do not build components dependent on x11 (gtxwc)
--without curses   - do not build components dependent on curses (gtcrs)
--without slang    - do not build components dependent on slang (gtsln)
--without gpllib   - do not build components dependent on GPL 3rd party code
--without gpm      - build components without gpm support (gttrm, gtsln, gtcrs)

Binary .rpm on Linux (cross-builds)

for Windows:

$ package/mpkg_rpm_win.sh

for Windows CE:

$ package/mpkg_rpm_wce.sh

Binary .zip and .exe on Windows for all targets (except Linux)

$ set HB_DIR_NSIS=%ProgramFiles%\NSIS\
$ set HB_DIR_ZIP=C:\info-zip\
$ set HB_BUILD_PKG=yes

Then run build as usual with clean install options. See: How to Build

Binary .zip on MS-DOS for all targets (except Linux)

$ set HB_DIR_ZIP=C:\info-zip\
$ set HB_BUILD_PKG=yes

Then run build as usual with clean install options. See: How to Build

Unified .7z and .exe installer for Windows

$ package\winuni\mpkg_win_uni.bat

Carefully read in-file instructions and do the necessary steps before calling the script.

How to Enable Optional Components

Certain Harbour parts – typically contrib packages – depend on 3rd party components. To make these Harbour parts built,you need to tell Harbour where to find the headers for these 3rd party components.

On *nix systems most of these 3rd party components will automatically be picked up if installed on well-known standard system locations.

You only need to use manual setup if the dependency isn't available on your platform on a system location, or you wish to use a non-standard location. Typically you need to do this on non-*nix (Windows, MS-DOS, OS/2) systems for all packages and for a few packages on *nix which aren't available through official package managers (f.e. ADS Client).

Note that Harbour is tuned to use 3rd party binary packages in their default, unmodified – "vanilla" – install layout created by their official/mainstream install kits. If you manually move, rename, delete or add files under the 3rd party packages' root directory, the default Harbour build process (especially Windows implib generation) might not work as expected.

You can set these environment variables before starting the build. Make sure to adjust them to your own directories:

HB_WITH_ADS=C:\ads\acesdk
HB_WITH_ALLEGRO=C:\allegro\include
HB_WITH_BLAT=C:\blat\full\source
HB_WITH_BZIP2=C:\bzip2 (defaults to locally hosted version if not found)
HB_WITH_CAIRO=C:\cairo\include\cairo
HB_WITH_CUPS= (on *nix only)
HB_WITH_CURL=C:\curl\include
HB_WITH_CURSES= (on *nix systems and DJGPP, where it's autodetected)
HB_WITH_EXPAT=C:\expat\lib (defaults to locally hosted version)
HB_WITH_FIREBIRD=C:\Firebird\include
HB_WITH_FREEIMAGE=C:\FreeImage\Dist
HB_WITH_GD=C:\gd\include
HB_WITH_GPM= (on Linux only)
HB_WITH_GS=C:\ghostscript-9.01\psi
HB_WITH_GS_BIN=C:\ghostscript-9.01\bin (on Windows)
HB_WITH_JPEG=C:\jpeglib (defaults to locally hosted version if not found)
HB_WITH_LIBHARU=C:\libharu\include (defaults to locally hosted version)
HB_WITH_LIBMAGIC= (currently on *nix systems)
HB_WITH_LZF=C:\liblzf (defaults to locally hosted version if not found)
HB_WITH_MINILZO=C:\minilzo\ (defaults to locally hosted version if not found)
HB_WITH_MINIZIP=C:\zlib\contrib\minizip (defaults to locally hosted version if not found)
HB_WITH_MXML=C:\minixml (defaults to locally hosted version if not found)
HB_WITH_MYSQL=C:\mysql\include
HB_WITH_OCILIB=C:\ocilib\include
HB_WITH_ODBC= (may only be needed on non-Windows systems)
HB_WITH_OPENSSL=C:\openssl\inc32 OR C:\openssl\include
HB_WITH_PCRE=C:\pcre (defaults to locally hosted version if not found)
HB_WITH_PGSQL=C:\pgsql\include
HB_WITH_PNG=C:\libpng (defaults to locally hosted version if not found)
HB_WITH_QT=C:\Qt\include (version 4.5.0 or upper is required)
HB_WITH_SLANG= (on *nix systems)
HB_WITH_SQLITE3=C:\sqlite3 (defaults to locally hosted version if not found)
HB_WITH_TINYMT=C:\tinymt\tinymt (defaults to locally hosted version)
HB_WITH_WATT= (on MS-DOS systems)
HB_WITH_X11= (on *nix systems)
HB_WITH_XDIFF=C:\libxdiff-0.23\xdiff (defaults to locally hosted version if not found)
HB_WITH_ZLIB=C:\zlib (defaults to locally hosted version if not found)

To explicitly disable any given components, use the value no. This may be useful to avoid autodetection of installed packages on *nix systems. You may also use the value local to force using the locally hosted copy (inside Harbour source repository) of these packages, where applicable. nolocal will explicitly disable using locally hosted copy.

You can override autodetection of QT 'moc' tool by using HB_QTPATH and optionally HB_QTPOSTFIX envvars. This may only be necessary on some *nix systems. F.e.:

HB_QTPATH=/opt/qt5/bin/ HB_QTPOSTFIX=

Certain contribs can be instructed – when using .hbc files – to link against static build of their 3rd party lib dependencies (for advanced users only):

HB_STATIC_ALLEGRO=yes
HB_STATIC_CURL=yes
HB_STATIC_OPENSSL=yes

NOTES:

  • you need to use native path format to your shell/OS
  • spaces in directory names aren't currently supported (you can use 8.3 name alias on Windows platform, though)
  • don't put directory names inside double quotes
  • use absolute paths

Darwin (OS X)

  1. Install Homebrew

  2. Install packages:

     $ brew install pcre slang cairo freeimage libgd mysql postgresql qt5
     $ brew install upx uncrustify ack optipng jpegoptim
    

Linux (generic)

For contrib/rddads lib:

Download and install Advantage Client Engine API for Linux package (f.e. aceapi-10.00.0.3.tar.gz)

For contrib/hbhpdf lib, if you don't wish to use locally hosted version:

Download libharu from http://libharu.org/ -> ./configure -> make install

Linux (.deb based distros: Debian, Ubuntu)

You'll need these base packages to build/package/test/use Harbour:

$ sudo apt-get install bash git gcc binutils fakeroot debhelper valgrind upx uncrustify

You'll need these packages to compile certain contribs and optional Harbour features:

  for gtcrs terminal lib:    $ sudo apt-get install libncurses-dev
  for gtsln terminal lib:    $ sudo apt-get install libslang2-dev OR
                             $ sudo apt-get install libslang1-dev
  for gtxwc terminal lib:    $ sudo apt-get install libx11-dev
  for console mouse support: $ sudo apt-get install libgpm-dev OR
                             $ sudo apt-get install libgpmg1-dev
  for contrib/gtalleg lib:   $ sudo apt-get install liballegro4.2-dev
  for contrib/hbcairo lib:   $ sudo apt-get install libcairo2-dev
  for contrib/hbcups lib:    $ sudo apt-get install libcups2-dev
  for contrib/hbcurl lib:    $ sudo apt-get install libcurl4-openssl-dev OR
                             $ sudo apt-get install libcurl4-gnutls-dev
  for contrib/hbfbird lib:   $ sudo apt-get install firebird2.1-dev OR
                             $ sudo apt-get install libfirebird2.0-dev
  for contrib/hbfimage lib:  $ sudo apt-get install libfreeimage-dev
  for contrib/hbgd lib:      $ sudo apt-get install libgd2-xpm-dev OR
                             $ sudo apt-get install libgd-xpm-dev
  for contrib/hbgs lib:      $ sudo apt-get install libgs-dev
  for contrib/hbmagic lib:   $ sudo apt-get install libmagic-dev
  for contrib/hbmysql lib:   $ sudo apt-get install libmysqlclient15-dev
  for contrib/hbodbc lib:    $ sudo apt-get install unixodbc-dev
  for contrib/hbpgsql lib:   $ sudo apt-get install libpq-dev
  for contrib/hbqt lib:      $ sudo apt-get install libqt5-dev

Optional, to override locally hosted sources:

  for bzip2 support:         $ sudo apt-get install libbz2-dev
  for zlib support:          $ sudo apt-get install zlib1g-dev
  for pcre (regex) support:  $ sudo apt-get install libpcre3-dev
  for contrib/hbsqlit3 lib:  $ sudo apt-get install libsqlite3-dev
  for contrib/hbexpat lib:   $ sudo apt-get install libexpat1-dev

Linux (.rpm based distros: openSUSE, Fedora, CentOS, Mandriva)

You'll need these base packages to build/package/test/use Harbour:

bash git gcc make glibc-devel rpm valgrind upx uncrustify

You'll need these packages to compile certain contribs and optional Harbour features:

  for gtcrs terminal lib:    ncurses-devel ncurses
  for gtsln terminal lib:    slang-devel slang
  for gtxwc terminal lib:    xorg-x11-devel
                             XFree86-devel
  for console mouse support: gpm-devel OR
                             gpm
  for contrib/gtalleg lib:   allegro-devel
  for contrib/hbcairo lib:   cairo-devel
  for contrib/hbcups lib:    libcups2-devel
  for contrib/hbcurl lib:    curl-devel
  for contrib/hbfbird lib:   firebird-devel
  for contrib/hbfimage lib:  freeimage-devel
  for contrib/hbgd lib:      gd-devel
  for contrib/hbmysql lib:   libmysqlclient-devel OR
                             mysql-devel OR
                             MySQL-devel
  for contrib/hbodbc lib:    unixodbc-devel OR
                             unixODBC-devel
  for contrib/hbpgsql lib:   postgresql-devel
  for contrib/hbqt lib:      qt5-devel

NOTES:

  • You can use following commands on different distros to install packages:

    openSUSE: $ sudo zypper install Fedora, CentOS: $ sudo yum install Mandriva: $ sudo urpmi

  • Check this for more

  • On openSUSE, if you want to build 32-bit Harbour on a 64-bit host, install above packages with -32bit appended to their names, f.e. slang-devel-32bit

OpenSolaris

$ pkg install SUNWgit SUNWgcc SUNWgmake

FreeBSD

If you want to use the gtsln library instead of gtstd or gtcrs, then you also need to install libslang. If you installed the ports collection, then all you need to do to install libslang is to run the following commands, which may require that you run su first to get the correct permissions:

$ cd /usr/ports/devel/libslang
$ make
$ make install
$ make clean

Build Options

You can fine-tune Harbour builds with below listed environment variables. You can add most of these via the GNU Make command line also, using make VARNAME=value syntax. All of these settings are optional and all settings are case sensitive.

General

  • HB_INSTALL_PREFIX

    Target root directory to install Harbour files. On *nix systems the default is set to /usr/local/ or $(PREFIX) if specified, and /usr/local/harbour-<arch>-<comp> for cross-builds. It's always set to ./pkg/<arch>/<comp> when HB_BUILD_PKG is set to yes. On non-*nix systems, you must set it to a valid directory when using install. Use absolute paths only. For a peace of mind, avoid using spaces and quotes in the name. You have to use path format native to your shell. F.e. to specify C:\dir on Windows, with Cygwin you should use /cygdrive/c/dir, with MSYS /c/dir.

  • HB_USER_PRGFLAGS User Harbour compiler options

  • HB_USER_CFLAGS User C compiler options

  • HB_USER_RESFLAGS User resource compiler options (on win, wce, os2)

  • HB_USER_LDFLAGS User linker options for executables

  • HB_USER_AFLAGS User linker options for libraries

  • HB_USER_DFLAGS User linker options for dynamic libraries

Set these only if autodetection doesn't suit your purpose:

  • HB_PLATFORM Override platform autodetection

  • HB_COMPILER Override C compiler autodetection

    See this for possible values: Supported Platforms and C Compilers See also: HB_CC* settings.

Special

  • HB_BUILD_NAME=[<name>]

    Create named build. This allows to keep multiple builds in parallel for any given platform/compiler. F.e. debug / release.

    In current implementation it's appended to compiler directory name, so all filesystem/platform name rules and limits apply. (Back)slashes will be stripped from the name though.

  • HB_BUILD_PKG=yes

    Create release package. Default: no Requires clean install in root source dir.

  • HB_BUILD_DYN=no

    Create Harbour dynamic libraries. Default: yes

  • HB_BUILD_CONTRIB_DYN=no

    Create contrib dynamic libraries. Default: yes

  • HB_BUILD_SHARED=yes

    Create Harbour executables in shared mode. Default: yes when HB_INSTALL_PREFIX points to a *nix system location, otherwise no.

  • HB_BUILD_DEBUG=yes

    Create a debug build. Default: no

  • HB_BUILD_STRIP=[all|bin|lib|no]

    Strip symbols and debug information from binaries. Default: no

  • HB_BUILD_OPTIM=no

    Enable C compiler optimizations. Default: yes

  • HB_BUILD_MODE=[cpp|c]

    Change default build mode to C++ or C. Default: c, except for msvc* compilers, where it's cpp.

  • HB_BUILD_PARTS=[all|compiler|lib]

    Build only specific part of Harbour.

  • HB_BUILD_NOGPLLIB=yes

    Disable components dependent on GPL 3rd party code, to allow Harbour for commercial (closed source) projects. Default: no

  • HB_BUILD_3RDEXT=no

    Enable autodetection of 3rd party components on default system locations. Default: yes

  • HB_BUILD_CONTRIBS=no [<l>]

    Don't build any, or space separated <l> list of, contrib packages. Please note it won't prevent building packages which are dependencies of other – enabled – packages.

  • HB_BUILD_CONTRIBS=[<l>]

    Build space separated <l> list of contrib libraries. Build all if left empty (default).

  • HB_BUILD_ADDONS=<l>

    Build space separated list of additional .hbp projects.

  • HB_COMPILER_VER=[<ver>]

    Set C compiler version. This is used with win/msvc, win/mingw and cygwin/gcc targets currently. <ver> format:

    <15><0>[<0>] = <major><minor>[.<revision>]
    

    Default: filled by compiler autodetection or empty

  • HB_USER_LIBS=[<list>]

    Add space separated <list> of libs to link process. Lib names should be without extension and path. You only need this in special cases, like CodeGuard build with win/bcc.

  • HB_INSTALL_IMPLIB=no

    Copy import libraries created for external .dll dependencies to the library install directory in install build phase. Default: yes For Windows/OS/2 targets only. Please note that this feature doesn't work with all possible binary distributions of 3rd party packages. We test only the official/mainstream ones. Also note that the generated implibs will require .dlls compatible with the ones used at build time.

  • HB_INSTALL_3RDDYN=yes

    Copy dynamic libraries of external .dll dependencies to the dynamic library directory in install build phase. Default: no

  • HB_SRC_ROOTPATH=<dir>

    When using GNU Make older than 3.81, you shall set the root directory of Harbour source tree as an absolute path. If not set, some build functionality may fail, like detection of 3rd party packages with locally hosted sources. With newer make versions, this variable is ignored.

  • HB_REBUILD_EXTERN=yes

    Rebuild extern headers. This is typically used by developers after code modifications or before release. Default: no

  • HB_REBUILD_PARSER=yes

    Rebuild language parser sources. Typically you only need this if your are Harbour core developer modifying grammar rules (.y). Requires GNU Bison 1.28 or upper in PATH. Default: no

  • HB_CCPATH=[<dir>/]

    Used with non-*nix gcc family compilers (and sunpro) to specify path to compiler/linker/archive tool to help them run from *nix hosts as cross-build tools. Ending slash must be added.

  • HB_CCPREFIX=[<prefix>]

    Used with gcc compiler family to specify compiler/linker/archive tool name prefix.

  • HB_CCSUFFIX=[<suffix>]

    Used with gcc compiler family to specify compiler/linker tool name suffix – usually version number.

Cross-building

You can build Harbour for target platforms different than host platform. F.e. you can create Windows build on *nix systems, Linux builds on Windows systems, etc. It's also possible to build targets for different than host CPU architectures. F.e. you can create Windows 64-bit build on 32-bit Windows platform, or Linux x86-64 build on x86 hosts, or Linux MIPS build on x86 host, etc.

Point this envvar to the directory where native Harbour executables for your host platform can be found:

  HB_HOST_BIN=<harbour_native_build_dir>\bin

If you leave this value empty, the make system will try to autodetect it, so in practice all you have to do is to create a native build first (no install required), then create the cross-build. If you set this value manually, it may be useful to know that harbour, hbpp and hbmk2 executables are required for a cross-build process to succeed.

Build Examples

on Windows 32-bit hosts

NOTES:

  • All code below should be copied to batch files or typed at command line.
  • Naturally, you'll need to adapt dirs to valid ones on your system. Don't use spaces in dirs.
  • You can use additional clean, install or clean install make parameters depending on what you want to do.
  • To redirect all output to a log file, append this after the make command: > log.txt 2>&1
rem MSVC 2012
call "%ProgramFiles%\Microsoft Visual Studio 11.0\VC\vcvarsall.bat"
win-make
rem MSVC 2012 for Windows x86-64
rem (requires preceding build for native target)
call "%ProgramFiles%\Microsoft Visual Studio 11.0\VC\vcvarsall.bat" x86_amd64
win-make
rem MSVC 2010 and Windows SDK 7.1
call "%ProgramFiles%\Microsoft Visual Studio 10.0\VC\vcvarsall.bat"
win-make
rem MSVC 2010 (Professional or above) and Windows SDK 7.1 for Windows x86-64
rem (requires preceding build for native target)
call "%ProgramFiles%\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" x86_amd64
win-make
rem Windows SDK 7
call "%ProgramFiles%\Microsoft Visual Studio 9.0\VC\bin\vcvars32.bat"
win-make
rem Windows SDK 7 for Windows x86-64
rem (requires preceding build for native target)
call "%ProgramFiles%\Microsoft Visual Studio 9.0\VC\bin\vcvarsx86_amd64.bat"
win-make
rem MSVC 2008 + SDK
set WindowsSDKDir=%ProgramFiles%\Microsoft SDKs\Windows\v6.0A\
call "%ProgramFiles%\Microsoft Visual Studio 9.0\VC\vcvarsall.bat"
win-make
rem MSVC 2008
call "%ProgramFiles%\Microsoft Visual Studio 9.0\VC\vcvarsall.bat"
win-make
rem MSVC 2008 (Standard or above) for Windows x86-64
rem (requires preceding build for native target)
call "%ProgramFiles%\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86_amd64
win-make
rem MSVC 2008 (Team Suite) for Windows IA-64 Itanium
rem (requires preceding build for native target)
call "%ProgramFiles%\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86_ia64
win-make
rem MSVC 2008 for Windows CE ARM
rem (requires preceding build for native target)
set INCLUDE=%ProgramFiles%\Microsoft Visual Studio 9.0\VC\ce\include;%ProgramFiles%\Windows Mobile 5.0 SDK R2\PocketPC\Include\Armv4i
set LIB=%ProgramFiles%\Microsoft Visual Studio 9.0\VC\ce\lib\armv4i;%ProgramFiles%\Windows Mobile 5.0 SDK R2\PocketPC\Lib\ARMV4I
set PATH=%ProgramFiles%\Microsoft Visual Studio 9.0\VC\ce\bin\x86_arm;%ProgramFiles%\Microsoft Visual Studio 9.0\Common7\IDE;%PATH%
win-make
rem MSVC 2005
call "%ProgramFiles%\Microsoft Visual Studio 8\VC\vcvarsall.bat"
win-make
rem MSVC 2005 for Windows CE ARM
rem (requires preceding build for native target)
set INCLUDE=%ProgramFiles%\Microsoft Visual Studio 8\VC\ce\include;%ProgramFiles%\Windows Mobile 5.0 SDK R2\PocketPC\Include\Armv4i
set LIB=%ProgramFiles%\Microsoft Visual Studio 8\VC\ce\lib\armv4i;%ProgramFiles%\Windows Mobile 5.0 SDK R2\PocketPC\Lib\ARMV4I
set PATH=%ProgramFiles%\Microsoft Visual Studio 8\VC\ce\bin\x86_arm;%ProgramFiles%\Microsoft Visual Studio 8\Common7\IDE;%PATH%
win-make
rem MSVC .NET 2003 (untested)
call "%ProgramFiles%\Microsoft Visual Studio .NET 2003\VC7\vcvarsall.bat"
win-make
rem MinGW GCC
set PATH=C:\mingw\bin;%PATH%
win-make
rem MinGW GCC using MSYS shell
set PATH=C:\msys\1.0.11\bin;C:\mingw\bin;%PATH%
sh -c make
rem MinGW GCC for Windows x86-64
rem (requires preceding build for native target)
set PATH=C:\mingw64\bin;%PATH%
win-make
rem MinGW GCC for Windows CE ARM
rem (requires Cygwin + preceding build for native target)
set PATH=C:\mingwce\opt\mingw32ce\bin;C:\cygwin\bin;%PATH%
rem optional:
set CYGWIN=nodosfilewarning
win-make
rem Intel(R) C++
call "%ProgramFiles%\Intel\Compiler\C++\10.1.014\IA32\Bin\iclvars.bat"
win-make
rem Intel(R) C++ for Windows IA-64 Itanium
rem (requires preceding build for native target)
call "%ProgramFiles%\Intel\Compiler\C++\10.1.025\Itanium\Bin\iclvars.bat"
win-make
rem Borland C++ 5.5.1
set PATH=C:\Borland\BCC55\Bin;%PATH%
win-make
rem Pelles C
set PATH=%ProgramFiles%\PellesC\Bin;%PATH%
set INCLUDE=%ProgramFiles%\PellesC\Include;%ProgramFiles%\PellesC\Include\Win;%INCLUDE%
set LIB=%ProgramFiles%\PellesC\Lib;%ProgramFiles%\PellesC\Lib\Win;%LIB%
win-make
rem Pelles C for Windows x86-64
rem (requires preceding build for native target)
set PATH=%ProgramFiles%\PellesC\Bin;%PATH%
set INCLUDE=%ProgramFiles%\PellesC\Include;%ProgramFiles%\PellesC\Include\Win;%INCLUDE%
set LIB=%ProgramFiles%\PellesC\Lib;%ProgramFiles%\PellesC\Lib\Win64;%LIB%
win-make
rem Pelles C for Windows CE ARM
rem (requires preceding build for native target)
set PATH=%ProgramFiles%\PellesC\Bin;%PATH%
set INCLUDE=%ProgramFiles%\PellesC\Include\WinCE;%ProgramFiles%\PellesC\Include;%INCLUDE%
set LIB=%ProgramFiles%\PellesC\Lib;%ProgramFiles%\PellesC\Lib\WinCE;%LIB%
win-make
rem Delorie GNU C for MS-DOS (on Intel 32-bit Windows hosts only)
set DJGPP=C:\djgpp\djgpp.env
set PATH=C:\djgpp\bin;%PATH%
win-make
rem Open Watcom C/C++
SET WATCOM=C:\watcom
SET PATH=%WATCOM%\BINNT;%WATCOM%\BINW;%PATH%
SET EDPATH=%WATCOM%\EDDAT
SET INCLUDE=%WATCOM%\H;%WATCOM%\H\NT
win-make
rem Open Watcom C/C++ for MS-DOS
SET WATCOM=C:\watcom
SET PATH=%WATCOM%\BINNT;%PATH%
SET EDPATH=%WATCOM%\EDDAT
SET INCLUDE=%WATCOM%\H
win-make
rem Open Watcom C/C++ for OS/2
rem (requires preceding build for Windows target)
SET WATCOM=C:\watcom
SET PATH=%WATCOM%\BINNT;%WATCOM%\BINW;%PATH%
SET BEGINLIBPATH=%WATCOM%\BINP\DLL
SET EDPATH=%WATCOM%\EDDAT
SET INCLUDE=%WATCOM%\H;%WATCOM%\H\OS2
win-make
rem Open Watcom C/C++ for Linux
rem (requires preceding build for Windows target)
SET WATCOM=C:\watcom
SET PATH=%WATCOM%\BINNT;%WATCOM%\BINW;%PATH%
SET EDPATH=%WATCOM%\EDDAT
SET INCLUDE=%WATCOM%\LH
win-make
rem VxWorks GCC x86
rem (requires preceding build for Windows target)
wrenv -p vxworks-6.8
set HB_COMPILER=gcc
win-make
rem VxWorks GCC ARM
rem (requires preceding build for Windows target)
wrenv -p vxworks-6.8
set HB_COMPILER=gcc
set HB_CPU=arm
set HB_BUILD_NAME=arm
win-make
rem VxWorks Wind River Compiler x86
rem (requires preceding build for Windows target)
wrenv -p vxworks-6.8
set HB_COMPILER=diab
win-make
rem Symbian OS
rem (requires preceding build for Windows target)
set PATH=C:\Symbian\CSL Arm Toolchain\bin;%PATH%
set HB_PLATFORM=symbian
set HB_COMPILER=gcc
set HB_CCPREFIX=arm-none-symbianelf-
set HB_USER_CFLAGS=-IC:\Symbian\SDK\S60\devices\S60_5th_Edition_SDK_v1.0\epoc32\include\stdapis -IC:\Symbian\SDK\S60\devices\S60_5th_Edition_SDK_v1.0\epoc32\include -D__GCC32__ -D__SYMBIAN32__
win-make
rem Cygwin GCC using Cygwin shell
set PATH=C:\cygwin\bin
sh -c make
rem Add these *before* above sample scripts to configure 3rd party dependencies.
rem When using MSYS or Cygwin shell you'll have to use forward slashes and
rem also Cygwin drive notation for Cygwin.
set HB_WITH_ADS=C:\ads\acesdk
set HB_WITH_ALLEGRO=C:\allegro\include
set HB_WITH_BLAT=C:\blat\full\source
set HB_WITH_CAIRO=C:\cairo\include\cairo
set HB_WITH_CURL=C:\curl\include
set HB_WITH_FIREBIRD=C:\Firebird\include
set HB_WITH_FREEIMAGE=C:\FreeImage\Dist
set HB_WITH_GD=C:\gd\include
set HB_WITH_MYSQL=C:\mysql\include
set HB_WITH_OCILIB=C:\ocilib\include
set HB_WITH_OPENSSL=C:\openssl\inc32
set HB_WITH_PGSQL=C:\pgsql\include
set HB_WITH_QT=C:\Qt\include

on Windows x86-64 (64-bit) hosts

Same as 32-bit Windows, but, you'll have to change %ProgramFiles% to %ProgramFiles(x86)% for 32-bit and mixed tools, you can build for both x86 and x64 without building a native target first, and potential differences with some compilers in using native binaries if they are available.

rem MinGW GCC for Windows x86-64
set PATH=C:\mingw64\bin;%PATH%
win-make
rem MSVC 2012 for Windows x86
call "%ProgramFiles(x86)%\Microsoft Visual Studio 11.0\VC\vcvarsall.bat"
win-make
rem MSVC 2012 for Windows x86-64
rem (requires preceding build for native target)
call "%ProgramFiles(x86)%\Microsoft Visual Studio 11.0\VC\vcvarsall.bat" x86_amd64
win-make
rem MSVC 2010 and Windows SDK 7.1 for Windows x86
call "%ProgramFiles(x86)%\Microsoft Visual Studio 10.0\VC\vcvarsall.bat"
win-make
rem MSVC 2010 (Professional or above) and Windows SDK 7.1 for Windows x86-64
call "%ProgramFiles(x86)%\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" amd64
win-make
rem Windows SDK 7 for Windows x86
call "%ProgramFiles(x86)%\Microsoft Visual Studio 9.0\VC\bin\vcvars32.bat"
win-make
rem Windows SDK 7 for Windows x86-64
call "%ProgramFiles(x86)%\Microsoft Visual Studio 9.0\VC\bin\vcvars64.bat"
win-make
rem MSVC 2008 for Windows x86
call "%ProgramFiles(x86)%\Microsoft Visual Studio 9.0\VC\vcvarsall.bat"
win-make
rem MSVC 2008 (Standard or above) for Windows x86-64
call "%ProgramFiles(x86)%\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" amd64
win-make
rem MSVC 2008 (Team Suite) for Windows IA-64 Itanium
rem (requires preceding build for native target)
call "%ProgramFiles(x86)%\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86_ia64
win-make

on MS-DOS hosts

rem Delorie GNU C
set DJGPP=C:\djgpp\djgpp.env
set PATH=C:\djgpp\bin;%PATH%
dos-make
rem Open Watcom C/C++
SET WATCOM=C:\watcom
SET PATH=%WATCOM%\BINW;%PATH%
SET EDPATH=%WATCOM%\EDDAT
SET INCLUDE=%WATCOM%\H
dos-make
rem Add these *before* above sample scripts to configure 3rd party dependencies.
rem You have to use 8.3 path notation.
set HB_WITH_ALLEGRO=C:\ALLEGR~1.2\include
set HB_WITH_FIREBIRD=C:\FIREBI~1.4\include
set HB_WITH_GD=C:\GD-20~1.34\include
set HB_WITH_MYSQL=C:\MYSQL-~1.67\include
set HB_WITH_PGSQL=C:\PGSQL-~1.3\include
set HB_WITH_WATT=C:\WATT\inc

on OS/2 hosts

rem GCC 3.3.4 and GCC 3.3.5
C:\usr\bin\gccenv.cmd
os2-make
rem GCC 4.x
C:\usr\local433\gcc440.cmd
set HB_COMPILER=gccomf
os2-make
rem Open Watcom C/C++
SET WATCOM=C:\watcom
SET PATH=%WATCOM%\BINP;%WATCOM%\BINW;%PATH%
SET BEGINLIBPATH=%WATCOM%\BINP\DLL
SET EDPATH=%WATCOM%\EDDAT
SET INCLUDE=%WATCOM%\H;%WATCOM%\H\OS2
SET HELP=%WATCOM%\BINP\HELP;%HELP%
SET BOOKSHELF=%WATCOM%\BINP\HELP;%BOOKSHELF%
os2-make

on Linux hosts

# Open Watcom C/C++ for OS/2
# (requires preceding build for Linux target)
export WATCOM="/opt/lng/watcom"
export INCLUDE="${WATCOM}/h:${WATCOM}/h/os2"
export PATH="${WATCOM}/binl:$PATH"
export HB_BUILD_3RDEXT=no
make "$@"
# Borland C++ 5.5.1
export PATH=~/.wine/drive_c/Borland/BCC55/Bin:$PATH
export HB_PLATFORM=win
export HB_COMPILER=bcc
export HB_BUILD_3RDEXT=no
make

on Darwin (OS X) hosts

# To create "Universal" binaries, compatible with pre-Snow Leopard PowerPC and Intel systems
export HB_USER_LDFLAGS="-arch i386 -arch ppc"
export HB_USER_CFLAGS="$HB_USER_LDFLAGS"
export HB_COMPILER=gcc
make

on *nix hosts in general

[g]make
# MinGW GCC for Windows x86
[g]make HB_PLATFORM=win
# MinGW GCC for Windows CE ARM
[g]make HB_PLATFORM=wce

Build Your Own Harbour App

For all platforms you'll need two things:

  • Harbour binaries

    Either a Harbour binary distribution or a local Harbour build will be okay. If you're reading this text, it's very likely you have one of these already.

  • Supported ANSI C compiler

    Your compiler of choice has to be placed in the PATH – and configured appropriately according to instructions. If you use official Harbour binary distribution on Windows, you already have MinGW compiler embedded in the installation, which will automatically be used, so you don't have to make any extra steps here.

Use hbmk2 to build your app from source. It's recommended to put it in the PATH (f.e. by using set PATH=C:\harbour\bin;%PATH% on Windows).

See hbmk2 documentation, with examples.

Debugging Options

Tracing

Build Harbour with:

HB_BUILD_DEBUG=yes

Run app with:

HB_TR_LEVEL=debug
# to override default stderr output:
HB_TR_OUTPUT=<filename>
# to enable additional system specific logging output,
# OutputDebugString() on Windows, syslog() on *nix systems:
HB_TR_SYSOUT=yes

Memory statistics/tracking

Build Harbour with:

HB_USER_CFLAGS=-DHB_FM_STATISTICS

Valgrind (on linux and darwin targets)

Build Harbour with:

HB_BUILD_DEBUG=yes

Build app with:

$ hbmk2 myapp -debug

Run app with:

$ valgrind --tool=memcheck --leak-check=yes --num-callers=16 -v ./myapp 2> myapp.log

CodeGuard (on win/bcc target only)

Build Harbour with:

HB_USER_CFLAGS=-vG
HB_USER_LIBS=cg32

Harbour Debugger

Build app with:

$ hbmk2 myapp -b -run

or run script with:

$ hbrun myapp --hb:debug

Press <Alt+D> in the app.

Troubleshooting

Always evaluate these points before reporting an issue on the developers' mailing list.

  1. Make sure to have carefully read this document.

  2. Make sure to do a make clean before doing a build after refreshing the sources.

  3. If that still fails, make sure to install fresh source tree in a new local directory and start over. See How to Get for instructions to get the source. In case you installed Harbour into system locations (this used to be the case with some *nix users, albeit mostly completely unnecessarily or wrongly - f.e. for unstable versions), you will need to remember cleaning off Harbour from all of these locations, too. Advice: Never install unstable Harbour versions to system locations.

  4. If you are doing a cross-build, make sure to have rebuilt the native Harbour executables for your host platform. See HB_HOST_BIN build messages to find their location.

  5. Keep your PATH clean from old, mixed compiler tools or other Harbour versions when building Harbour. The surest way to achieve this is to leave only C compiler directory in PATH:

    set PATH=C:\<c_compiler_bin_dir>
    

    If you use Harbour official binary distro on Windows, even above is unnecessary and not recommended.

  6. Remove all old, unnecessary environment variables (for both Harbour and C compiler) from your environment. Also remove any custom settings for your C compiler. Use only those documented in this file. Follows some environment variable settings which are commonly believed by users to be useful, but which in reality are either not needed or not even used by Harbour build process and hbmk2.

  7. Remove any Harbour build settings documented in Build Options.

  8. Try to do no or only small modifications at once to examples included in Build Examples. If it doesn't work, fall back to documented examples as is.

  9. If everything fails and you are to report a build problem to Harbour developers, make sure to include your OS version/language/CPU architecture, Harbour revision, C compiler name/release and version, environment variables and verbose log output containing both stderr and stdout in one combined stream (use make > log.txt 2>&1). Enable verbose mode using HB_BUILD_VERBOSE=yes. Complete log output is rarely necessary, but always make sure to include the top of the output (lines starting with !) and the area where problematic behavior occurred first. Make sure to not only include a link failure or a make tool failure, as it's most of the time not enough information. Compress your log using zip if it is larger than 25KB. (use the extension .zip) With these, you have much better chance to get useful or any response.

  10. Do not alter the directory layout and files in Harbour and 3rd party packages.

  11. If you are to report a build problem with a Harbour application, all of the above points apply, plus make sure to use -trace command line option when running hbmk2 and redirect the result to a file (see above how). It's good idea to first remove all manual references to Harbour core components from makefiles and custom environment. F.e. it's commom mistake to add C compiler header and/or lib dirs, Harbour core header and/or lib dirs, built-in constants to makefiles or environment. No such thing is necessary as all of these are automatically handled by hbmk2. IOW start simple and don't be overbusy with fine-tuning your configuration. If you need to, the problem is most probably elsewhere. It's also good idea to try with Harbour nightly binary or official stable release first.

  12. If you are to report a problem with Harbour itself, always provide self-contained, minimal source code example. Do not use xhb contrib library, or any 3rd party Harbour libraries. The example shall reproduce the problem using official stable or nightly Harbour build. Do not post executables and other binary files. If your source contains non-ASCII (national, accented, special) chars, clearly mark the codepage/encoding used (UTF-8 recommended) and attach the files compressed with zip. (use the extension .zip)
    See more on self-contained examples: http://sscce.org/

  13. If your example involves compatibility components, make sure to test it against original implementation (for example, test legacy Clipper core language elements against real CA-Clipper 5.2e or 5.3b, or hbct functions against CT3 library, etc)

Supported Platforms and C Compilers

You can override target platform autodetection with these HB_PLATFORM values:

  • linux - Linux
  • darwin - OS X
  • bsd - FreeBSD / OpenBSD / NetBSD / DragonFly BSD / *BSD
  • beos - BeOS / Haiku
  • hpux - HP-UX
  • sunos - Sun Solaris / OpenSolaris
  • qnx - QNX
  • android - Android
  • vxworks - VxWorks
  • symbian - Symbian OS (experimental)
  • minix - Minix 3 (tested on 3.2.1; earlier releases won't work)
  • aix - IBM AIX
  • win - MS Windows (all flavors) (see External links for Win9x requirements)
  • wce - MS Windows CE
  • dos - MS-DOS (32-bit protected mode only) (MS-DOS compatible systems also work, like dosemu)
  • os2 - OS/2 Warp 4 / eComStation

You can override C compiler autodetection with these HB_COMPILER values:

linux

  • gcc - GNU C
  • clang - Clang
  • watcom - Open Watcom C/C++
  • icc - Intel(R) C/C++
  • sunpro - Sun Studio C/C++
  • open64 - Open64 C/C++

darwin

  • gcc - GNU C
  • clang - Clang
  • icc - Intel(R) C/C++

bsd

  • gcc - GNU C
  • clang - Clang
  • pcc - Portable C Compiler (experimental)

hpux

  • gcc - GNU C

beos

  • gcc - GNU C

qnx

  • gcc - GNU C

android

  • gcc - GNU C x86
  • gccarm - GNU C ARM

vxworks

  • gcc - GNU C
  • diab - Wind River Compiler

symbian

  • gcc - GNU C

minix

  • clang - Clang
  • gcc - GNU C

aix

  • gcc - GNU C

cygwin

  • gcc - GNU C

sunos

  • gcc - GNU C
  • sunpro - Sun Studio C/C++

win

  • mingw - MinGW GNU C 3.4.2 and above
  • mingw64 - MinGW GNU C x86-64
  • msvc - Microsoft Visual C++
  • msvc64 - Microsoft Visual C++ x86-64
  • msvcia64 - Microsoft Visual C++ IA-64 (Itanium)

win (partial support, some features may be missing)

  • clang - Clang
  • watcom - Open Watcom C/C++
  • bcc - Borland/CodeGear/Embarcadero C++ 4.x and above
  • bcc64 - Embarcadero C++ 6.5 and above
  • icc - Intel(R) C/C++
  • iccia64 - Intel(R) C/C++ IA-64 (Itanium)
  • pocc - Pelles C 4.5 and above
  • pocc64 - Pelles C x86-64 5.0 and above
  • xcc - Pelles C for xhb

wce

  • mingw - MinGW GNU C x86
  • mingwarm - MinGW GNU C ARM (CEGCC 0.55 and above)
  • msvcarm - Microsoft Visual C++ ARM
  • poccarm - Pelles C ARM 5.0 and above

dos

  • djgpp - Delorie GNU C
  • watcom - Open Watcom C/C++

os2

  • gcc - EMX GNU C 3.3.5 or lower
  • gccomf - EMX GNU C 3.3.5 or upper
  • watcom - Open Watcom C/C++

Platform Matrix

  host
platform
target
platform/compiler
target cpu
   | win      | win/bcc           | x86
   | win      | win/bcc64         | x86-64
   | win      | win/gcc           | x86
   | win      | win/global        | x86
   | win      | win/icc           | x86
   | win      | win/icc64         | x86-64 (not supported yet)
   | win      | win/iccia64       | ia64
   | win      | win/mingw         | x86
   | win      | win/mingw64       | x86-64
   | win      | win/msvc          | x86
   | win      | win/msvc64        | x86-64
   | win      | win/msvcia64      | ia64
   | win      | win/pocc          | x86
   | win      | win/pocc64        | x86-64
   | win      | win/watcom        | x86
   | win      | win/xcc           | x86
 x | win      | wce/mingwarm      | arm
 x | win      | wce/mingw         | x86   (not fully supported yet)
 x | win      | wce/poccarm       | arm
 x | win      | wce/msvcarm       | arm
 x | win      | wce/msvcmips      | mips  (not supported yet)
 x | win      | wce/msvcsh        | sh    (not supported yet)
 x | win      | wce/msvc          | x86   (not supported yet)
 x | win      | dos/djgpp         | x86   (on Windows x86 hosts only)
 x | win      | dos/watcom        | x86
 x | win      | os2/watcom        | x86
 x | win      | linux/watcom      | x86
 x | win      | android/gcc       | x86
 x | win      | android/gccarm    | arm
 x | win      | vxworks/gcc       | (CPU cross-builds possible: x86, arm, mips, ppc)
 x | win      | vxworks/diab      | (CPU cross-builds possible: x86, arm, mips, ppc, sparc)
 x | win      | symbian/gcc       | arm
 x | win      | cygwin/gcc        | x86
   | dos      | dos/djgpp         | x86
   | dos      | dos/watcom        | x86
 x | dos      | win/watcom        | x86
 x | dos      | os2/watcom        | x86
 x | dos      | linux/watcom      | x86
   | os2      | os2/gcc           | x86
   | os2      | os2/watcom        | x86
 x | os2      | win/watcom        | x86
 x | os2      | dos/watcom        | x86
 x | os2      | linux/watcom      | x86
   | linux    | linux/gcc         | (CPU cross-builds possible)
   | linux    | linux/clang       | (CPU cross-builds possible)
   | linux    | linux/icc         | (CPU cross-builds possible: x86, x86-64, ia64)
   | linux    | linux/sunpro      | (CPU cross-builds possible: x86, x86-64)
   | linux    | linux/open64      | (CPU cross-builds possible: x86-64, ia64, ...)
 x | linux    | wce/mingwarm      | arm
 x | linux    | wce/mingw         | x86
 x | linux    | win/mingw         | x86
 x | linux    | win/mingw64       | x86-64
 x | linux    | win/watcom        | x86
 x | linux    | win/bcc           | x86 (requires WINE)
 x | linux    | win/bcc64         | x86-64 (requires WINE)
 x | linux    | os2/watcom        | x86
 x | linux    | dos/watcom        | x86
 x | linux    | dos/djgpp         | x86
 x | linux    | android/gcc       | x86
 x | linux    | android/gccarm    | arm
 x | linux    | vxworks/gcc       | (CPU cross-builds possible: x86, arm, mips, ppc)
 x | linux    | vxworks/diab      | (CPU cross-builds possible: x86, arm, mips, ppc, sparc)
   | bsd      | bsd/gcc           | (CPU cross-builds possible)
   | bsd      | bsd/clang         | (CPU cross-builds possible)
   | bsd      | bsd/pcc           | (experimental)
 x | bsd      | wce/mingwarm      | arm
 x | bsd      | wce/mingw         | x86
 x | bsd      | win/mingw         | x86
 x | bsd      | dos/djgpp         | x86
   | darwin   | darwin/clang      | (CPU cross-builds possible: x86, x86-64, unibin)
   | darwin   | darwin/gcc        | (CPU cross-builds possible: x86, x86-64, ppc, ppc64, unibin)
   | darwin   | darwin/icc        | (CPU cross-builds possible: x86, x86-64)
 x | darwin   | wce/mingwarm      | arm
 x | darwin   | wce/mingw         | x86
 x | darwin   | win/mingw         | x86
 x | darwin   | win/mingw64       | x86-64
 x | darwin   | dos/djgpp         | x86
 x | darwin   | android/gcc       | x86
 x | darwin   | android/gccarm    | arm
   | hpux     | hpux/gcc          | (CPU cross-builds possible)
   | qnx      | qnx/gcc           | (CPU cross-builds possible - no tested)
   | beos     | beos/gcc          | x86
 x | hpux     | wce/mingwarm      | arm
 x | hpux     | wce/mingw         | x86
 x | hpux     | win/mingw         | x86
 x | hpux     | dos/djgpp         | x86
   | minix    | minix/clang       | x86
   | minix    | minix/gcc         | x86
   | aix      | aix/gcc           | (CPU cross-builds possible: ppc, ppc64)
   | sunos    | sunos/gcc         | (CPU cross-builds possible)
   | sunos    | sunos/sunpro      | (CPU cross-builds possible: x86, x86-64, sparc32, sparc64)
 x | sunos    | wce/mingwarm      | arm
 x | sunos    | wce/mingw         | x86
 x | sunos    | win/mingw         | x86
 x | sunos    | dos/djgpp         | x86
 x | sunos    | vxworks/gcc       | (CPU cross-builds possible: x86, arm, mips, ppc)
 x | sunos    | vxworks/diab      | (CPU cross-builds possible: x86, arm, mips, ppc, sparc)

Leading x marks cross-platform scenarios.

Supported shells per host platforms:

  • win / NT shell (cmd.exe)
  • win / POSIX shell (MSYS or Cygwin sh.exe)
  • win / MS-DOS shell (command.com)
  • dos / MS-DOS shell (command.com)
  • dos / POSIX shell (bash.exe)
  • os/2 / OS/2 shell (cmd.exe)
  • os/2 / POSIX shell (bash.exe)
  • *nix / POSIX shell

External links

Harbour Links


This document Copyright © 2009–present Viktor Szakats (vszakats.net/harbour)
Creative Commons Attribution-ShareAlike 4.0

core's People

Contributors

alcz avatar alex-degarate avatar alkresin avatar aperricone avatar bedipritpal avatar davep avatar druzus avatar emg60 avatar fivetechsoft avatar fmancera avatar fperillo avatar fsgiudice avatar ibisz avatar jlefebvre-mafact avatar kaddath avatar lailton avatar lfiorini avatar melak avatar mlacecilia avatar omm avatar oscarhdezsz avatar ronpinkas avatar snaiperis avatar spiccioli avatar starmusic avatar teowindtelsoft avatar toninhofwi avatar tuffnatty avatar vailtom avatar vszakats avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

core's Issues

GTWVT in HB_GTI_RESIZEMODE_FONT corrupts display after maximize, then restore

GTWVT in HB_GTI_RESIZEMODE_FONT corrupts display after maximize, then restore.

Steps to reproduce:

  1. build and run tests/wvtext.prg using: hbmk2 wvtext -gtwvt -run
  2. click on upper right corner middle button to 'maximize'
  3. click on upper right corner middle button to 'restore'
  4. watch the columns being shifted and first few columns not visible
  5. press F1 repeatedly to see more strangeness

Inquiry: SQLCipher for SQLite3 and Hb SSL

Using SQLCipher to encrypt SQLite3 database requires the use of libeay32.dll. The resulting application won't run if libeay32.dll is not package with it.

Then I found Hb SSL and tried to link the following: libhbssl.a, liblibeay32.a, libssleay32.a and libhbssls.a my question is, are these libraries requires libeay32.dll?

My goal is to encrypt SQLite3 database. How can I adopt HB SSL in this regard?

I encrypt the database with PRAGMA KEY = '' using SQL Cipher and libeay32.dll

Thanks.

Danny

Inconsistent pcode generated for off-limits number of parameters

hb_memowrit( "t.prg", e"proc main()\nqout(" + replicate( ",", 65536 ) + ")" )
hb_run( "harbour t.prg" )

Generated pcode will push 65537 NILs, but the number of parameters
passed to HB_P_DOSHORT will be 1. Running it will result in:
Unrecoverable error 9015: Symbol item expected from hb_vmDo()

In either -gc0-2 and -gc3 modes.

Wrong default DATETIME type picture mask in GET

dbCreate( "testdbf", {{"A","C",1,0}, {"B","T",8,0}},, .T. )
dbAppend() ; _FIELD->A := "X" ; _FIELD->B := hb_DateTime()
USE testdbf
Browse() // Date mask Ok! Time mask bad. You can delete "sp, :, .". You can not write "sp, :, ."
SET DATE ANSI
Browse() // Date mask Ok! Time mask bad. You can delete "sp,:,.". You can not write "sp, :, ."
SET CENTURY ON
Browse() // Date edit mask is incorrect.

linux

the source compile ok, more when i try run:
show me
./main: error while loading shared libraries: libxhb.so.3.2: cannot open shared object file: No such file or directory

anything ?
linux ubuntu server 32 bits. 13.04

Run to cursor (F7) and Toggle breakpoint (F9) in Debugger

Hello!
Here is the simple program:
-- begin[test.prg] -------
Function Main
altd()
? "Alpha"
? "Beta"
? "Delta"
return
-- end[test.prg] -------

When I use hbmk2 with the command line:
hbmk2 test -b
than F7 (run to Cursor) and F9 (Breakpoint) in the debugger work well.
But if I use
hbmk2 c:\hb30\bin\test -b
then F7 and F9 stop working.
I have discovered this problem while using *.clp file since the same problem persist with them.

Harbour 3.0.0 (Rev. 16951)
Copyright (c) 1999-2011, http://harbour-project.org/

Harbour Build Info

Version: Harbour 3.0.0 (Rev. 16951)
Compiler: MinGW GNU C 4.5.2 (32-bit)
Platform: Windows XP 5.1.2600 Service Pack 3
PCode version: 0.3
ChangeLog last entry: 2011-07-17 19:15 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
ChangeLog ID: ChangeLog 16951 2011-07-17 17:16:33Z vszakats
Built on: Jul 17 2011 20:06:49

Build options: (Clipper 5.3b) (Clipper 5.x undoc)

Another missing -w3 warning, suppressed by an iif()

Another missing 'Variable 'C' is assigned but not used in function" warning:

LOCAL a, b := { "x", "y" }, l := .T.
LOCAL c := ""

FOR a := 1 TO Len( b )
   c := b[ a ]
   c += iif( l, "z", "" )
   ? c
NEXT

Deleting the 'iif()' fixes it:

LOCAL a, b := { "x", "y" }
LOCAL c := ""

FOR a := 1 TO Len( b )
   c := b[ a ]
   c += "z"
   ? c
NEXT

Harbour and Clipper different MemoEdit() behavior

  • ESC will not exit editing
  • Inherits previous value LastKey() (K_ESC). MemoEdit() hangs on invocation.
#include "inkey.ch"
#include "memoedit.ch"

PROCEDURE Main()
   LOCAL cs := "Editable text"
   KEYBOARD Chr( K_ESC )
   Inkey()
   DO WHILE .T.
      cs := MemoEdit( cs, 5, 10, 20, 70, .T., "m_func", 50 )
      DO CASE
      CASE LastKey() == K_CTRL_W ; MemoWrit( "saved.txt", cs )
      CASE LastKey() == K_ESC    ; EXIT
      ENDCASE
   ENDDO
   ? "Ok, it works"
   RETURN

FUNCTION m_func()
   RETURN iif( LastKey() == K_ESC .OR. LastKey() == K_CTRL_W, LastKey(), ME_DEFAULT )

File name casing (-fn:) doesn't work?

What's the harbour flag -fn: ? Is it tor force table name case to lowercase or uppercase?

I try to compile this simple .prg:
bambang@bambang-notebook:~/master/harbour-svn$ cat fncolonlbug.prg
PROCEDURE MAIN
use COBA

bambang@bambang-notebook:~/master/harbour-svn$ harbour -gc1 -fn:l fncolonlbug.prg
Harbour 3.2.0dev (r1404111536)
Copyright (c) 1999-2014, http://harbour-project.org/
Compiling 'fncolonlbug.prg'...
Lines 3, Functions/Procedures 2
Generating C source output to 'fncolonlbug.c'... Done.

I expect statement "use COBA" will be converted to "use coba", however that does not the case.

bambang@bambang-notebook:~/master/harbour-svn$ cat fncolonlbug.c
/*

  • Harbour 3.2.0dev (r1404111536)
  • GNU C 4.6.3 (32-bit)
  • Generated C source from "fncolonlbug.prg"
    */

include "hbvmpub.h"

include "hbpcode.h"

include "hbinit.h"

HB_FUNC( FNCOLONLBUG );
HB_FUNC( MAIN );
HB_FUNC_EXTERN( DBUSEAREA );

HB_INIT_SYMBOLS_BEGIN( hb_vm_SymbolInit_FNCOLONLBUG )
{ "FNCOLONLBUG", {HB_FS_PUBLIC | HB_FS_FIRST | HB_FS_LOCAL}, {HB_FUNCNAME( FNCOLONLBUG )}, NULL },
{ "MAIN", {HB_FS_PUBLIC | HB_FS_LOCAL}, {HB_FUNCNAME( MAIN )}, NULL },
{ "DBUSEAREA", {HB_FS_PUBLIC}, {HB_FUNCNAME( DBUSEAREA )}, NULL }
HB_INIT_SYMBOLS_EX_END( hb_vm_SymbolInit_FNCOLONLBUG, "fncolonlbug.prg", 0x0, 0x0003 )

if defined( HB_PRAGMA_STARTUP )

#pragma startup hb_vm_SymbolInit_FNCOLONLBUG

elif defined( HB_DATASEG_STARTUP )

#define HB_DATASEG_BODY HB_DATASEG_FUNC( hb_vm_SymbolInit_FNCOLONLBUG )
#include "hbiniseg.h"

endif

HB_FUNC( FNCOLONLBUG )
{
static const HB_BYTE pcode[] =
{
HB_P_ENDPROC
};

hb_vmExecute( pcode, symbols );
}

HB_FUNC( MAIN )
{
static const HB_BYTE pcode[] =
{
HB_P_LINE, 2, 0,
HB_P_PUSHFUNCSYM, 2, 0,
HB_P_FALSE,
HB_P_PUSHNIL,
HB_P_PUSHSTRSHORT, 5,
'C', 'O', 'B', 'A', 0,
HB_P_PUSHNIL,
HB_P_PUSHNIL,
HB_P_FALSE,
HB_P_DOSHORT, 6,
HB_P_LINE, 3, 0,
HB_P_ENDPROC
};

hb_vmExecute( pcode, symbols );
}

hb_itemParamStore() fails to clear parameter on NULL

According to fe09f94, hb_itemParamStore() should assign NIL to the reference parameter when NULL is passed. It seems to leave it untouched though.

proc main()
   local a := "zz"
   _CLEAR_REF( @a )
   ? a
   return

#pragma begindump
#include "hbapiitm.h"
HB_FUNC( _CLEAR_REF )
{
   hb_itemParamStore( 1, NULL );  
}
#pragma enddump

GPF and memory access past buffer via RestScreen()

RestScreen() doesn't check if the 5th parameter contains enough data for the passed area, so a memory access past buffer may occur.

hbshell_gtSelect( "GTWVT" ) // any GT will do which allows resizing to larger sizes
CLS
SetMode( 1024, 1024 )
RestScreen( 0, 0, MaxRow() + 1, MaxCol() + 1, "" )
hb_MemoWrit( "mem.bin", SaveScreen() )

It will either reveal app memory and save it to mem.bin, or crash.

-gc3 output causes clang warning 'will never be executed [-Wunreachable-code]'

BEGIN SEQUENCE
   ?
RECOVER USING o
END SEQUENCE

generated code:

HB_FUNC( T )
{
   do {
    hb_xvmSeqBegin();
    do {
    hb_xvmPushFuncSymbol( symbols + 1 );
    if( hb_xvmDo( 0 ) ) break;
    if( hb_xvmSeqEndTest() ) break;
    goto lab00001;
    } while( 0 );   // <--- warning here
    if( hb_xvmSeqRecover() ) break;
    if( hb_xvmPopVariable( symbols + 2 ) ) break;
lab00001: ;
    /* *** END PROC *** */
   } while( 0 );
}

The warning can be enabled by -Weverything or explicitly.

dbRSelect() doesn't seem to work

dbCreate( "aa", { { "A", "C", 1, 0 } } )
dbCreate( "bb", { { "B", "C", 1, 0 } } )
USE aa NEW; dbAppend(); FIELD->A := "A"; INDEX ON FIELD->A TO aa
USE bb NEW; dbAppend(); FIELD->B := "A"; SET RELATION TO FIELD->B INTO aa
? dbRSelect() // Clipper: 1, Harbour: 0

Human readable JSON malformatted for self-references

LOCAL h := { "1" => }
LOCAL a := { 0 }
? hb_jsonEncode( h, .T. )                // Correct
h[ "1" ] := h; ? hb_jsonEncode( h, .T. ) // Incorrect
? hb_jsonEncode( a, .T. )                // Correct
a[ 1 ] := a; ? hb_jsonEncode( a, .T. )   // Incorrect
{
  "1": null
}
{
  "1":
null
}
[
  0
]
[
null
]

wrong .c code generated with SET PROCEDURE scenario

wrong .c code generated when compiling a.prg:

a.prg

PROCEDURE Main()
   b()
   RETURN
SET PROCEDURE TO "p.prg"

p.prg

STATIC PROCEDURE b()
   RETURN

when .c code is compiled using mingw 4.8.x, the output is this:

In file included from include/hbvmpub.h:52:0,
                 from a.c:7:
include/hbdefs.h:1596:51: error: static declaration of 'HB_FUN_B' follows non-static declaration
 #define HB_FUNC_STATIC( funcname ) static HARBOUR HB_FUN_##funcname ( void )
                                                   ^
a.c:16:1: note: in expansion of macro 'HB_FUNC_STATIC'
 HB_FUNC_STATIC( B );
 ^
include/hbdefs.h:1595:78: note: previous declaration of 'HB_FUN_B' was here
 #define HB_FUNC_EXTERN( funcname ) HB_EXTERN_C_ HB_EXTERN_ HARBOUR HB_EXPORT HB_FUN_##funcname ( void )
                                                                              ^
a.c:14:1: note: in expansion of macro 'HB_FUNC_EXTERN'
 HB_FUNC_EXTERN( B );
 ^

Cl*pper 5.x compiles it fine, then reports 'B' as a missing external on linking.

MROW()/ MCOL() incorrect after wheel events

I'm building a console application with gtwin on XP with Harbour 3.2.0dev (r1303291931). I'm attempting to support a mouse wheel, but find that MROW() and MCOL() return desktop based coordinates, rather than application window based coordinates, after a wheel up or wheel down. After a left or right click or a mouse move, they work fine, returning application based coordinates. The problem occurs only after wheel events.

\tests\mousetst.prg in the Harbour source shows this condition clearly. Compile and run this program, and move the program window away from the top left corner of the desktop. Move or click the mouse, and notice the application based coordinates in the lower left corner. Then, being careful not to move the mouse, move the wheel up or down. Notice the desktop based coordinates now appearing in the lower left corner.

Although I don't use them, MROW(.T.)/MCOL(.T.) return the same values as MROW()/MCOL(). I would like to use MAXROW(.T.)/MAXCOL(.T.), but these also return the same values as MAXROW()/MAXCOL().

Thanks for a great product and thanks in advance for your help.

Operator Overloading

allow operators + =, - =,% =, ^ =, ** =, / = can be overloaded: HB_APICLS.H and CLASSES.C

EF_CANRETRY support for EG_READ errors in RDD

When certain Windows server resources are exhausted, the OS may inflict intermittent RTEs on read operations with the following error codes:

  • 1450: ERROR_NO_SYSTEM_RESOURCES [when operating on the local filesystem]
  • 1130: ERROR_NOT_ENOUGH_SERVER_MEMORY [when operating via a network share]

Since the root cause of these errors may be difficult or impossible to track down or fix in a shared server environment, it would seem useful if the Harbour application's error handler could handle them more gracefully, specifically by retrying the operation as needed. At this moment Harbour RDDs issue these RTEs without an EF_CANRETRY flag, so this is not possible and I wonder if it would be something feasible and useful to implement.

BTW, these errors where observed on Windows Server 2003 R2 running on dedicated, brand, server hardware

UPDATE: Slightly related, that if the read error occurs inside index handling code (CDX in this specific case), the current error is an internal one: Unrecoverable error 1010: hb_cdxIndexPageRead: Read index page failed.

hbmk2.exe recognize .ani files (animated cursors) thru resource file ?

Hi all,

We are having trouble to be recognized .ani files during compiling process. We use HMG from Roberto Lopez (based on MinGW) and is displaying a error message from hbmk2.exe saying:

windres: cursor file `Maggy.ani' does not contain cursor data

I believe is not windres msg error, because I cutted the process for windres compilation and I putted RC file in .hbc for building.

In the RC file I tested with:

MAGGY CURSOR Maggy.ani

This is for mouse's pointer to be displayed like a Maggy in action.

According msdn for animated cursors at resource file should be defined as "CURSOR" the kind of resource and the path+name of image file. Pls see at http://msdn.microsoft.com/en-us/library/windows/desktop/aa381043%28v=vs.85%29.aspx

But I do not get to be reconize by the nickname of cursor, because this error during compilation.

If I not use RC file for this animated file and at runtime the app changes the mouse pointer by C function:
HB_FUNC( FILECURSOR )
{
hb_retnl( ( LONG ) SetCursor( LoadCursorFromFile( hb_parc( 1 ) ) ) );
}

The this work perfectly. But the problem is I do not want to need to attach images files with the executable. I wish all animated cursors to be incorporated to the executable by the RC file.

What I am doing wrong ?

Rgds/Pablo César

_SET_PRINTFILE bug

? Set( _SET_PRINTFILE ) is empty in Clipper and LPT1 in Harbour after start.

Possible problem with hb_threadQuitRequest()?

Seeing the code path, it seems that the high-level function requires pThread->fActive to be HB_FALSE, while the called low-level function needs pThread->fActive to be HB_TRUE.

from src/vm/thread.c

HB_FUNC( HB_THREADQUITREQUEST )
{
   PHB_THREADSTATE pThread = hb_thParam( 1, 0 );

   if( pThread )
   {
      HB_STACK_TLS_PRELOAD
      HB_BOOL fResult = HB_FALSE;

#if defined( HB_MT_VM )
      if( ! pThread->fActive )
      {
         hb_vmThreadQuitRequest( ( void * ) pThread );
         fResult = HB_TRUE;
      }
#endif
      hb_retl( fResult );
   }
}

from src/vm/hvm.c

void hb_vmThreadQuitRequest( void * Cargo )
{
   PHB_THREADSTATE pState;

   HB_TRACE( HB_TR_DEBUG, ( "hb_vmThreadQuitRequest(%p)", Cargo ) );

   pState = ( PHB_THREADSTATE ) Cargo;

   HB_VM_LOCK();

   if( pState->pStackId && pState->fActive )
      hb_stackIdSetActionRequest( pState->pStackId, HB_QUIT_REQUESTED );

   HB_VM_UNLOCK();
}

Am I on the wrong track with this? Shouldn't the '!' operator
be deleted from the high-level one, to make this function ever succeed?

Compiler to warn for non-empty SWITCH/CASE branches that are missing an EXIT or RETURN

Expected behavior for this warning (-w3):

SWITCH var
CASE "a" // no warning (empty block)
CASE "b" ; x := 1 // warning here: "non-empty SWITCH CASE block without an EXIT or RETURN"
CASE "c" ; RETURN // no warning
CASE "d" ; EXIT // no warning
CASE "e" ; x := 2 // warning here (it's last but still, for consistency)
ENDSWITCH

Such warning would help to avoid bugs due to accidental CASE fall-through,
due to missing "break" (EXIT/RETURN)

Similar feature is present in f.e. C# (it's a hard error there).

Code from Nanforum toolkit doen't complie with strange error

This function from Nanforum doesn't compile, seems like ft_isbiton and ft_int86 don't work as expected...

/*

  • File......: TEMPFILE.PRG
  • Author....: Glenn Scott
  • CIS ID....: 71620,1521
    *
  • This is an original work by Glenn Scott and is placed in the
  • public domain.
    *
  • Modification history:

  • Rev 1.7 28 Sep 1992 23:48:48 GLENN
  • Deleted #define for FLAG_CARRY as Toolkit v2.1's ftint86.ch has it.
    *
  • Rev 1.6 03 Oct 1991 18:36:28 GLENN
  • Tim Wong from Nantucket pointed out that this DOS function actually
  • leaves a file handle in AX. In order to preserve the functionality,
  • I now fclose() that handle if the call is succsessful.
    *
  • Rev 1.5 15 Aug 1991 23:05:04 GLENN
  • Forest Belt proofread/edited/cleaned up doc
    *
  • Rev 1.4 17 Jul 1991 22:11:18 GLENN
  • Stripped off chr(0)s in the return value (aRegs[DS])
    *
  • Rev 1.3 03 Jul 1991 01:08:08 GLENN
  • Changed one line in FT_TEST driver ( cHide == "Y" )
    *
  • Rev 1.2 14 Jun 1991 19:53:10 GLENN
  • Minor edit to file header
    *
  • Rev 1.1 12 Jun 1991 02:45:40 GLENN
  • Documentation mods, and convert to new ft_int86() syntax, return value.
    *
  • Rev 1.0 01 Apr 1991 01:02:24 GLENN
  • Nanforum Toolkit
    *
    */

/* $DOC$

  • $FUNCNAME$
  • FT_TEMPFIL()
    
  • $CATEGORY$
  • DOS/BIOS
    
  • $ONELINER$
  • Create a file with a unique name
    
  • $SYNTAX$
  • FT_TEMPFIL( [ <cPath> ] [, <lHide> ] ) -> cFileSpec
    
  • $ARGUMENTS$
  • <cPath> is the directory where you want to create the temporary
    
  • file.  If you omit this argument, the root of the current drive
    
  • is assumed ("\").
    
  • If <lHide> is .T., then the file will be created with the hidden
    
  • attribute set.  The default is .F.
    
  • $RETURNS$
  • <cFileSpec> should be your path, including the name of the newly
    
  • created unique file.  Use this with FOPEN(), etc.
    
  • If a DOS error occurred when trying to create the file, a
    
  • null string will be returned.
    
  • $DESCRIPTION$
  • This function uses DOS Interrupt 21, service 5Ah (Create temporary
    
  • file) to create a unique filename in a directory you specify.
    
  • There will be no extension.  After the file is created, you may
    
  • then fopen() it and do any i/o you need (see the test driver
    
  • in the source code).
    
  • This function requires FT_INT86().
    
  • $EXAMPLES$
  • Create a unique file in the root of the current drive:
    
  •        myFile := FT_TEMPFIL()
    
  • Create a unique file in the current directory and hide it:
    
  •        myFile := FT_TEMPFIL(".\", .t.)
    
  • Create a unique file on another drive, but do not hide it:
    
  •        myFile := FT_TEMPFIL("e:\nanfor\src\")
    
  • $END$
    */

include "FTINT86.CH"

define DOS 33

define TEMPNAME 90

ifdef FT_TEST

FUNCTION MAIN( cPath, cHide )
LOCAL cFile, nHandle
cFile := FT_TEMPFIL( cPath, (cHide == "Y") )

 if !empty( cFile )
    QOut( cFile )
    nHandle := fopen( cFile, 1 )
    fwrite( nHandle, "This is a test!" )
    fclose( nHandle )
 else
    Qout( "An error occurred" )
 endif

RETURN nil

endif

FUNCTION FT_TEMPFIL( cPath, lHide )
LOCAL aRegs[ INT86_MAX_REGS ], cRet

cPath := iif( valType(cPath) != "C", ;
repl( chr(0),12) , ;
cPath += repl( chr(0), 12 ) ;
)

lHide := iif( valType(lHide) != "L", .f., lHide )

aRegs[AX] := MAKEHI( TEMPNAME )
aRegs[CX] := iif( lHide, 2, 0 )
aRegs[DS] := cPath
aRegs[DX] := REG_DS

FT_INT86( DOS, aRegs )

/* If carry flag is clear, then call succeeded and a file handle is

  • sitting in AX that needs to be closed.
    */

if !ft_isBitOn( aRegs[FLAGS], FLAG_CARRY )
fclose( aRegs[AX] )
cRet := strtran( aRegs[DS], chr(0) )
else
cRet := ""
endif

RETURN cRet

Inquiry about HB UTF8

Hello

I'm an HMG user from http://www.hmgforum.com and recently moved to UTF-8, the problem it seems the records in the database was saved using the old version, prior to Hb 3.0. The database contains accented letters, grave, circumflex, etc which is used in translation and processing. ASCII letters are ok except those letters with diacritical marks. The words are dictionary entries and International Phonetics Alphabet (IPA). It looks like the database records are needed to be modified as well to be UTF-8 compliant.

How can I test if a character or character streams are needed to be converted to UTF-8? Where can I find the complete list of HB functions that deals with UTF-8 and US-ASCII conversion?

Regards,

Danny

hbct WBox() incorrect behaviour in recent Harbour

Hello to all on the GitHub!

I have some stuff which uses CT Windows and it revealed this problem when recompiled with recent builds.

WBox() seems to not respect Box CP setting after unicode support was introduced.
http://www.fki.pl/hb/ctwbox.prg - here's a testcode for this issue, which does good on Harbour 3.0.0.

Here's a screenshot, how it looks like: http://www.fki.pl/hb/ctwbox.png

So far i have no luck in spotting the exact cause in hbct library code.

Test code pasted:

#include "hbgtinfo.ch"
#include "box.ch"

REQUEST HB_CODEPAGE_PL852
REQUEST HB_CODEPAGE_PLISO
REQUEST HB_CODEPAGE_PLMAZ
REQUEST HB_CODEPAGE_PLWIN
#if __HARBOUR__ >= 0x30200
REQUEST HB_CODEPAGE_UTF8EX
#endif

PROCEDURE ctwbox()
   LOCAL a, cCdp

   CLS 

   a := { "PLISO", "PLMAZ", "PLWIN", "PL852" }

#if __HARBOUR__ >= 0x30200
   AAdd( a , "UTF8EX" )
#endif

   HB_AIns( a, 1, HB_CdpSelect(), .T. )

   SetMode( 25, 80 )

   FOR EACH cCdp IN a

      HB_CdpSelect( cCdp )

      WOpen( 10, 5, 20, 65 )

#if __HARBOUR__ >= 0x30200
      WBox( HB_B_SINGLE_UNI ) // test for Unicode
#else
      WBox( B_SINGLE ) // test for Unicode
#endif
      WBox( B_DOUBLE )

      ? HB_Version(), "GT" + HB_GtVersion()
      ? Os()
      ? "This is:", cCdp, "Box CP is:", HB_GtInfo( HB_GTI_BOXCP )

      WAIT

      WClose()

   NEXT

   RETURN

Best regards, Aleksander Czajczyński

P.S. i've posted this one to the mailing list, but it didn't appeared... seems it's a day for GitHub debut

WBox() Issue illustration

hbclass

in PHP and others languages we have method __construct and __destruct
its called when the class is created and terminated.

is possible us have it ?

class class_test
 method __construct()
 method __destruct()
end

method  __construct()
 ? 'was created'
return self

method __destruct()
 ? 'was terminated'
return

and while i call
class_test()
automatic call the __construct ?

it already exist ? 

AS HASH not recognized (and some more)

local x as hash
x := { => }

will not compile.
Some other types are missing as well. Same is true for class definitions where this syntax is commonly used.

Use github.com releases and tags

Since harbour-project is now fully hosted on GitHub (it is, right?), I find myself confused sometimes when I need to download the latest version (3.0.0) or the dev version.

Maybe you should use the git tags for make it better for us to know what version do clone, and release the tarball for the latest stable version and for the latest version.

hb_process

Hello,

how to send command 'ping 127.0.0.1 >> ret.txt'
its no work.

Error while converting from Clipper

I have created a test project in clipper.

Here is the code for test.prg
store space(1) to mT
@ 10,10 say "hellow Time :" get mT pict "!"
read

Here is the generated hbp file code:
-3rd=hbide_version=1.0
-3rd=hbide_type=Executable
-3rd=hbide_title=test
-3rd=hbide_location=d:\hcjs
-3rd=hbide_workingfolder=
-3rd=hbide_destinationfolder=
-3rd=hbide_output=test
-3rd=hbide_launchparams=
-3rd=hbide_launchprogram=
-3rd=hbide_backupfolder=
-3rd=hbide_xhb=NO
-3rd=hbide_xpp=NO
-3rd=hbide_clp=YES

-inc
-mt
-w3
-es2
-gtwvg
-gui
-lhbwin
-lxhb

test.prg

I have followed the following steps:

  1. Open Project
  2. I select test.hbp
  3. Right-click on Select an environment
  4. Select MinGW
  5. Again Right Click then Build And Launch

Conversion is not successful. I get some errors. Errors are as follows:

  1. Warning: Ambiguous Reference 'mT'
  2. Warning: Ambiguous Reference 'GETLIST'
  3. Warning: Ambiguous Reference 'GETLIST'
  4. Warning: Ambiguous Reference 'GETLIST'
  5. Warning: Ambiguous Reference 'GETLIST'
  6. Warning: Ambiguous Reference 'GETLIST'

Sorry, cannot launch project because of errors

Crash on hbwin OLE object access when run as hbrun script

Example 1

#if defined( __HBSCRIPT__HBSHELL )
LOCAL oIE
IF ( oIE := win_oleCreateObject( "InternetExplorer.Application" ) ) != NIL
   oIE:Visible := .T.  // crashes when run as script via hbrun
ENDIF
#endif

Example 2

win_oleAuto___OnError()

Example 3

win_oleAuto___OpIndex()

Same snippets work correctly when built as an .exe.

Wrong record order with NTX

(I'm using 2.0.0, but the bug is present in 3.0.0 too)

When inserting records in a database using NTX indexes, records containing special characters (>=0x80) get inserted in the wrong place.

The problem is in src/rdd/dbfntx/dbfntx1.c, hb_ntxPageKeyFind(): the return value of hb_ntxValCompare() is an int, but it is stored in a short int. If hb_ntxValCompare() returns a value outside the range a a short int can store (as seen with gcc 4.7.2 in Debian 7), the comparison result might be wrong.

The fix is trivial:

--- dbfntx1.c.orig 2010-12-04 19:33:01.000000000 +0100
+++ dbfntx1.c 2014-02-06 10:00:00.000000000 +0100
@@ -2483,7 +2483,8 @@
char* key, HB_SHORT keylen, HB_BOOL fNext,
HB_ULONG ulRecNo, HB_BOOL *fStop )
{

  • HB_SHORT iLast = -1, iBegin = 0, iEnd = pPage->uiKeys - 1, k, i;
  • HB_SHORT iLast = -1, iBegin = 0, iEnd = pPage->uiKeys - 1, i;
  • int k;

*fStop = HB_FALSE;
while( iBegin <= iEnd )

class bug

Hi, small test, the correcty is show me 1,2,3
I have test too n:=n+1 ( n:=n+1 ) n++ ++n etc.
what wrong ? is a bug ?

include <hbclass.ch>

static n:=0
function main()
test():new()
test():new()
test():new()
return nil
class test
data id init (++n)
method new() constructor
endclass
method new()
? ::id
return self

DateTime field incorrectly handled in __dbSDF() function

dbCreate( "testdbf", {{"A","C",1,0}, {"B","T",8,0}},, .T. )
dbAppend() ; _FIELD->A := "X" ; _FIELD->B := hb_DateTime()
COPY TO test SDF      // X2014-04-11 23:07:42.903  // OK
hb_dbZap()
APPEND FROM test SDF     // Data type error: B

Error while generating RPM packages

I'm trying build Harbour RPM packages on CentOS 6.5 and OpenSUSE 13 but I get the following error:

Checking for unpackaged file(s): /usr/lib/rpm/check-files /home/raphael/RPM/BUILDROOT/harbour-3.2.0-0.1.dev.el6.i386
error: Installed (but unpackaged) file(s) found:
/usr/lib/harbour/libtiff.a

RPM build errors:
line 102: buildprereq is deprecated: BuildPrereq: gcc binutils ncurses-devel
Installed (but unpackaged) file(s) found:
/usr/lib/harbour/libtiff.a

This error can be fixed by adding this line on %install script (on harbour.spec): "rm -f $HB_INSTALL_LIB/libtiff.a" but I'm not sure if this is the correct solution.

Another possible solution is described here: http://docs.fedoraproject.org/en-US/Fedora_Draft_Documentation/0.1/html/RPM_Guide/ch09s05s07.html

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.