Hi.
I've spent about 90 minutes researching this and haven't found a
solution yet...
I'm running a 32bit SuSe and trying to compile my first Harbour
program into a Linux executable.
It compiles and runs perfectly fine without parameters, but it needs
the Harbour libraries to run, so it's not portable yet.
If I try:
hbmk test3 -static
I get the following error output:
Harbour 2.0.0 (Rev. -1)
Copyright (c) 1999-2010,
http://www.harbour-project.org/
Compiling 'test3.prg'...
Lines 3, Functions/Procedures 1
Generating C source output to 'test3.c'... Done.
/usr/lib/gcc/i586-suse-linux/4.5/../../../crt1.o: In function
`_start':
/usr/src/packages/BUILD/glibc-2.11.2/csu/../sysdeps/i386/elf/start.S:
115: undefined reference to `main'
./test3.o: In function `HB_FUN_MAIN':
test3.c:(.text+0x17): undefined reference to `hb_vmExecute'
./test3.o: In function `hb_vm_SymbolInit_TEST3':
test3.c:(.text+0x4e): undefined reference to `hb_vmProcessSymbols'
./test3.o:(.data+0x38): undefined reference to `HB_FUN_QOUT'
/tmp/cc5KcKMd.o: In function `hb_lnk_SetDefault_build':
hb-build-root-24212.c:(.text+0x1e): undefined reference to
`hb_vmSetDefaultGT'
/tmp/cc5KcKMd.o: In function `_hb_lnk_ForceLink_build':
hb-build-root-24212.c:(.text+0x8): undefined reference to
`HB_FUN_HB_GT_STD'
collect2: ld returned 1 exit status
My code at this time is extremely simple and dumbed down:
function main()
? "All done."
return nil
From all I was able to gather, this error tends to show up either when
there is no function 'main' (which is clearly there in the .prg file)
or until the gcc compiler is run with the -g parameter.
I don't have any c experience at all, so all of what I found out was
learned on-the-fly and may be completely wrong.
Our Linux expert tried to uninstall and update the GCC compiler
without any change.
Also, the path in the second error line does not exist:
/usr/src/packages/BUILD is empty
I don't know if the file structure that the error is referring to is
created by the compiler or not.
So I figured I'd try to compile into a c file and compile that
separately using GCC - and that failed, too.
First off, I can't create a file test3.c - it always creates test3.o
instead (an object file, I guess). When I compile that with GCC, it
doesn't recognize it at all.
When I try to create a plain c file, the output says that it is
generating a file called test3.c, but then it doesn't show up
anywhere...
So yea, I tried a bunch of things, and I'm completely stumped at this
point.
I did notice on looking at the crt1.o file that it is hard-coded with
the paths sysdeps/i386/elf/start.S and /usr/src/packages/BUILD/
glibc-2.11.2/. There is no file start.S anywhere on the computer, and
as I said the BUILD folder is always empty, so I have no idea anymore
where to look for a solution here.
I hope someone here can help me out.
Thanks in advance!