Page 1 of 1

Compile tbfuncs.c

PostPosted: Thu Feb 09, 2012 4:35 pm
by AHF
How can I compile (Peles c, Bcc, ?) tbfuncs.c to be used with xharbour ?

Cheers,

Antonio Ferreira

Re: Compile tbfuncs.c

PostPosted: Thu Feb 09, 2012 8:11 pm
by Antonio Linares
If you use Borland, then do:

bcc32.exe -c -ic:\xharbour\include tbfuncs.c

If you get errors, please post here the source code for tbfuncs.c and we will help you :-)

Re: Compile tbfuncs.c

PostPosted: Thu Feb 09, 2012 9:13 pm
by AHF
Antonio,

I need Obj to use with xarbour builder.

Is the Bcc obj compatible with it? Should I use Pelles instead ?

With bcc32 i get this:

C:\fw21\WINH32\WINH32 xbset08>c:\fw21\borland\bcc55\bin\bcc32 -c -Ic;\fw21\fwh_8
\include tcbfuncs.c
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
tcbfuncs.c:
Error E2209 tcbfuncs.c 2: Unable to open include file 'Windows.h'
Error E2139 \fw21\fwh_8\include\ClipApi.h 77: Declaration missing ;
Error E2238 \fw21\fwh_8\include\ClipApi.h 78: Multiple declaration for 'WORD'
Error E2344 \fw21\fwh_8\include\ClipApi.h 77: Earlier declaration of 'WORD'
Error E2139 \fw21\fwh_8\include\ClipApi.h 78: Declaration missing ;
Error E2238 \fw21\fwh_8\include\ClipApi.h 79: Multiple declaration for 'WORD'
Error E2344 \fw21\fwh_8\include\ClipApi.h 77: Earlier declaration of 'WORD'
Error E2139 \fw21\fwh_8\include\ClipApi.h 79: Declaration missing ;
Error E2139 \fw21\fwh_8\include\ClipApi.h 80: Declaration missing ;
Error E2238 \fw21\fwh_8\include\ClipApi.h 81: Multiple declaration for 'LPBYTE'
Error E2344 \fw21\fwh_8\include\ClipApi.h 80: Earlier declaration of 'LPBYTE'
Error E2139 \fw21\fwh_8\include\ClipApi.h 81: Declaration missing ;
Error E2139 \fw21\fwh_8\include\ClipApi.h 87: Declaration missing ;
Error E2139 \fw21\fwh_8\include\ClipApi.h 88: Declaration missing ;
Error E2238 \fw21\fwh_8\include\ClipApi.h 89: Multiple declaration for 'LONG'
Error E2344 \fw21\fwh_8\include\ClipApi.h 88: Earlier declaration of 'LONG'
Error E2139 \fw21\fwh_8\include\ClipApi.h 89: Declaration missing ;
Error E2238 \fw21\fwh_8\include\ClipApi.h 90: Multiple declaration for 'LONG'
Error E2344 \fw21\fwh_8\include\ClipApi.h 88: Earlier declaration of 'LONG'
Error E2139 \fw21\fwh_8\include\ClipApi.h 90: Declaration missing ;
Error E2139 \fw21\fwh_8\include\ClipApi.h 95: Declaration missing ;
Error E2139 \fw21\fwh_8\include\ClipApi.h 103: Declaration missing ;
Error E2139 \fw21\fwh_8\include\ClipApi.h 104: Declaration missing ;
Error E2139 \fw21\fwh_8\include\ClipApi.h 112: Declaration missing ;
Error E2139 \fw21\fwh_8\include\ClipApi.h 113: Declaration missing ;
Error E2228 \fw21\fwh_8\include\ClipApi.h 113: Too many error or warning message
s
*** 26 errors in Compile ***


Antonio

Re: Compile tbfuncs.c

PostPosted: Thu Feb 09, 2012 10:04 pm
by AHF
Antonio,

Sorry I miss it.

This is the correct output

C:\fw21\WINH32\WINH32 xbset08>c:\fw21\borland\bcc55\bin\bcc32 -c -Ic:\fw21\xharb
ourinc\xhbset08\xhb\c_include\win tcbfuncs.c
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
tcbfuncs.c:
Error E2209 c:\fw21\xharbourinc\xhbset08\xhb\c_include\win\Windows.h 66: Unable
to open include file 'excpt.h'
Error E2209 c:\fw21\xharbourinc\xhbset08\xhb\c_include\win\Windows.h 67: Unable
to open include file 'stdarg.h'
Error E2209 c:\fw21\xharbourinc\xhbset08\xhb\c_include\win\winnt.h 10: Unable to
open include file 'wchar.h'
Error E2209 c:\fw21\xharbourinc\xhbset08\xhb\c_include\win\winnt.h 11: Unable to
open include file 'ctype.h'
Error E2257 c:\fw21\xharbourinc\xhbset08\xhb\c_include\win\winnt.h 100: , expect
ed
Error E2257 c:\fw21\xharbourinc\xhbset08\xhb\c_include\win\winnt.h 101: , expect
ed
Error E2209 c:\fw21\xharbourinc\xhbset08\xhb\c_include\win\guiddef.h 105: Unable
to open include file 'string.h'
Error E2211 c:\fw21\xharbourinc\xhbset08\xhb\c_include\win\winnt.h 1767: Inline
assembly not allowed in inline and template functions
Error E2209 c:\fw21\xharbourinc\xhbset08\xhb\c_include\win\winnt.h 2038: Unable
to open include file 'pshpack4.h'
Error E2209 c:\fw21\xharbourinc\xhbset08\xhb\c_include\win\winnt.h 2045: Unable
to open include file 'poppack.h'
Error E2209 c:\fw21\xharbourinc\xhbset08\xhb\c_include\win\winnt.h 2464: Unable
to open include file 'pshpack4.h'
Error E2209 c:\fw21\xharbourinc\xhbset08\xhb\c_include\win\winnt.h 2466: Unable
to open include file 'pshpack2.h'
Error E2209 c:\fw21\xharbourinc\xhbset08\xhb\c_include\win\winnt.h 2577: Unable
to open include file 'poppack.h'
Error E2209 c:\fw21\xharbourinc\xhbset08\xhb\c_include\win\winnt.h 2722: Unable
to open include file 'pshpack2.h'
Error E2209 c:\fw21\xharbourinc\xhbset08\xhb\c_include\win\winnt.h 2795: Unable
to open include file 'poppack.h'
Error E2209 c:\fw21\xharbourinc\xhbset08\xhb\c_include\win\winnt.h 2834: Unable
to open include file 'pshpack8.h'
Error E2209 c:\fw21\xharbourinc\xhbset08\xhb\c_include\win\winnt.h 2846: Unable
to open include file 'poppack.h'
Error E2209 c:\fw21\xharbourinc\xhbset08\xhb\c_include\win\winnt.h 3095: Unable
to open include file 'poppack.h'
Error E2209 c:\fw21\xharbourinc\xhbset08\xhb\c_include\win\winnt.h 3126: Unable
to open include file 'string.h'
Error E2209 c:\fw21\xharbourinc\xhbset08\xhb\c_include\win\wingdi.h 1642: Unable
to open include file 'pshpack1.h'
Error E2209 c:\fw21\xharbourinc\xhbset08\xhb\c_include\win\wingdi.h 1648: Unable
to open include file 'poppack.h'
Error E2209 c:\fw21\xharbourinc\xhbset08\xhb\c_include\win\wingdi.h 1783: Unable
to open include file 'pshpack2.h'
Error E2209 c:\fw21\xharbourinc\xhbset08\xhb\c_include\win\wingdi.h 1791: Unable
to open include file 'poppack.h'
Error E2209 c:\fw21\xharbourinc\xhbset08\xhb\c_include\win\wingdi.h 1829: Unable
to open include file 'pshpack2.h'
Error E2209 c:\fw21\xharbourinc\xhbset08\xhb\c_include\win\wingdi.h 1841: Unable
to open include file 'poppack.h'
Error E2228 c:\fw21\xharbourinc\xhbset08\xhb\c_include\win\wingdi.h 1841: Too ma
ny error or warning messages
*** 26 errors in Compile ***

Re: Compile tbfuncs.c

PostPosted: Thu Feb 09, 2012 11:44 pm
by AHF
I forgot the include clauses.

I got now these errors


C:\fw21\WINH32\WINH32 xbset08>c:\fw21\borland\bcc55\bin\bcc32 -c -Ic:\fw21\xharb
ourinc\xhbset08\xhb\c_include\win -Ic:\fw21\fwh_8\include -Ic:\fw21\xharbourinc\
xhbset08\xhb\c_include tcbfuncs.c
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
tcbfuncs.c:
Error E2238 c:\fw21\xharbourinc\xhbset08\xhb\c_include\wchar.h 49: Multiple decl
aration for 'restrict'
Error E2238 c:\fw21\xharbourinc\xhbset08\xhb\c_include\wchar.h 50: Multiple decl
aration for 'restrict'
Error E2238 c:\fw21\xharbourinc\xhbset08\xhb\c_include\wchar.h 51: Multiple decl
aration for 'restrict'
Error E2238 c:\fw21\xharbourinc\xhbset08\xhb\c_include\wchar.h 52: Multiple decl
aration for 'restrict'
Error E2238 c:\fw21\xharbourinc\xhbset08\xhb\c_include\wchar.h 53: Multiple decl
aration for 'restrict'
Error E2238 c:\fw21\xharbourinc\xhbset08\xhb\c_include\wchar.h 54: Multiple decl
aration for 'restrict'
Error E2238 c:\fw21\xharbourinc\xhbset08\xhb\c_include\wchar.h 55: Multiple decl
aration for 'restrict'
Error E2238 c:\fw21\xharbourinc\xhbset08\xhb\c_include\wchar.h 56: Multiple decl
aration for 'restrict'
Error E2238 c:\fw21\xharbourinc\xhbset08\xhb\c_include\wchar.h 64: Multiple decl
aration for 'restrict'
Error E2238 c:\fw21\xharbourinc\xhbset08\xhb\c_include\wchar.h 66: Multiple decl
aration for 'restrict'
Error E2238 c:\fw21\xharbourinc\xhbset08\xhb\c_include\wchar.h 75: Multiple decl
aration for 'restrict'
Error E2238 c:\fw21\xharbourinc\xhbset08\xhb\c_include\wchar.h 76: Multiple decl
aration for 'restrict'
Error E2238 c:\fw21\xharbourinc\xhbset08\xhb\c_include\wchar.h 77: Multiple decl
aration for 'restrict'
Error E2238 c:\fw21\xharbourinc\xhbset08\xhb\c_include\wchar.h 78: Multiple decl
aration for 'restrict'
Error E2176 c:\fw21\xharbourinc\xhbset08\xhb\c_include\wchar.h 79: Too many type
s in declaration
Error E2238 c:\fw21\xharbourinc\xhbset08\xhb\c_include\wchar.h 79: Multiple decl
aration for 'restrict'
Error E2238 c:\fw21\xharbourinc\xhbset08\xhb\c_include\wchar.h 80: Multiple decl
aration for 'restrict'
Error E2176 c:\fw21\xharbourinc\xhbset08\xhb\c_include\wchar.h 81: Too many type
s in declaration
Error E2238 c:\fw21\xharbourinc\xhbset08\xhb\c_include\wchar.h 81: Multiple decl
aration for 'restrict'
Error E2238 c:\fw21\xharbourinc\xhbset08\xhb\c_include\wchar.h 82: Multiple decl
aration for 'restrict'
Error E2238 c:\fw21\xharbourinc\xhbset08\xhb\c_include\wchar.h 83: Multiple decl
aration for 'restrict'
Error E2238 c:\fw21\xharbourinc\xhbset08\xhb\c_include\wchar.h 84: Multiple decl
aration for 'restrict'
Error E2238 c:\fw21\xharbourinc\xhbset08\xhb\c_include\wchar.h 85: Multiple decl
aration for 'restrict'
Error E2238 c:\fw21\xharbourinc\xhbset08\xhb\c_include\wchar.h 89: Multiple decl
aration for 'restrict'
Error E2238 c:\fw21\xharbourinc\xhbset08\xhb\c_include\wchar.h 97: Multiple decl
aration for 'restrict'
Error E2228 c:\fw21\xharbourinc\xhbset08\xhb\c_include\wchar.h 97: Too many erro
r or warning messages
*** 26 errors in Compile ***

Re: Compile tbfuncs.c

PostPosted: Fri Feb 10, 2012 8:32 am
by AHF
If I try in Pelles C for windows I get:


Building tcbfuncs.obj.
C:\fw21\FWH_8\include\ClipApi.h(60): error #2121: Redeclaration of 'WORD'.
C:\fw21\FWH_8\include\ClipApi.h(65): error #2121: Redeclaration of 'PWORD'.
C:\fw21\FWH_8\include\ClipApi.h(66): error #2121: Redeclaration of 'LPWORD'.
C:\fw21\FWH_8\include\ClipApi.h(71): error #2025: Expected an enumerator identifier.
C:\fw21\FWH_8\include\ClipApi.h(71): error #2001: Syntax error: expected '}' but found 'integer constant'.
C:\fw21\FWH_8\include\ClipApi.h(71): error #2121: Redeclaration of 'BOOL'.
C:\fw21\WINH32\WINH32 xbset08\tcbfuncs.c(127): warning #1063: Single-line comment contains escaped new-line.
C:\fw21\WINH32\WINH32 xbset08\tcbfuncs.c(130): warning #1063: Single-line comment contains escaped new-line.
C:\fw21\FWH_8\include\ClipApi.h(463): error #2120: Redeclaration of 'strlen', previously declared at C:\fw21\xHarbourinc\XHB Set 08\xHB\c_include\string.h(30); expected 'unsigned int __cdecl function(const char *)' but found 'unsigned int __cdecl function(char *)'.
C:\fw21\FWH_8\include\ClipApi.h(464): error #2120: Redeclaration of 'strcpy', previously declared at C:\fw21\xHarbourinc\XHB Set 08\xHB\c_include\string.h(27); expected 'char * __cdecl function(char *, const char *)' but found 'void __cdecl function(unsigned char *, unsigned char *)'.
C:\fw21\FWH_8\include\ClipApi.h(465): error #2120: Redeclaration of 'strcmp', previously declared at C:\fw21\xHarbourinc\XHB Set 08\xHB\c_include\string.h(25); expected 'int __cdecl function(const char *, const char *)' but found 'BOOL __cdecl function(char *, char *)'.
C:\fw21\FWH_8\include\ClipApi.h(466): error #2120: Redeclaration of 'strcat', previously declared at C:\fw21\xHarbourinc\XHB Set 08\xHB\c_include\string.h(23); expected 'char * __cdecl function(char *, const char *)' but found 'unsigned char * __cdecl function(unsigned char *, unsigned char *)'.
C:\fw21\FWH_8\include\ClipApi.h(511): warning #2099: Missing type specifier; assuming 'int'.
C:\fw21\WINH32\WINH32 xbset08\tcbfuncs.c(182): warning #2027: Missing prototype for 'MoveTo'.
C:\fw21\WINH32\WINH32 xbset08\tcbfuncs.c(41): warning #2114: Local 'HeaderHeight' is not referenced.
C:\fw21\WINH32\WINH32 xbset08\tcbfuncs.c(261): warning #2114: Local 'HeaderHeight' is not referenced.
C:\fw21\WINH32\WINH32 xbset08\tcbfuncs.c(323): warning #2114: Local 'HeaderHeight' is not referenced.
*** Error code: 1 ***
Done.

Re: Compile tbfuncs.c

PostPosted: Fri Feb 10, 2012 9:51 am
by AHF
I've managed to compile it with Pelles C with following messages:

C:\fw21\WINH32\WINH32 xbset08\tcbfuncs.c(127): warning #1063: Single-line comment contains escaped new-line.
C:\fw21\WINH32\WINH32 xbset08\tcbfuncs.c(130): warning #1063: Single-line comment contains escaped new-line.
C:\fw21\FWH_8\include\ClipApi.h(511): warning #2099: Missing type specifier; assuming 'int'.
C:\fw21\WINH32\WINH32 xbset08\tcbfuncs.c(41): warning #2114: Local 'HeaderHeight' is not referenced.
C:\fw21\WINH32\WINH32 xbset08\tcbfuncs.c(261): warning #2114: Local 'HeaderHeight' is not referenced.
C:\fw21\WINH32\WINH32 xbset08\tcbfuncs.c(323): warning #2114: Local 'HeaderHeight' is not referenced.

Building it with xharbour builder I got:

xLINK: error: Unresolved external symbol '__parnl'.
xLINK: error: Unresolved external symbol '__parni'.
xLINK: error: Unresolved external symbol '__parc'.
xLINK: error: Unresolved external symbol '__parclen'.
xLINK: error: Unresolved external symbol '__parinfo'.
xLINK: error: Unresolved external symbol '__retni'.
xLINK: error: Unresolved external symbol '__reta'.
xLINK: error: Unresolved external symbol '__storni'.
xLINK: fatal error: 8 unresolved external(s).

Re: Compile tbfuncs.c

PostPosted: Fri Feb 10, 2012 3:43 pm
by Antonio Linares
Antonio,

Borland is not compatible with xHB.com so as you have discovered yourself, you have to use PellesC or MS Visual C.

Change the header files in the C file this way:

#include <windows.h>
#include <hbapi.h>

before all _par... and _ret... functions place hb:

hb_par...
hb_ret...

Re: Compile tbfuncs.c

PostPosted: Fri Feb 10, 2012 4:10 pm
by carlos vargas
what version of tsbrowse using you
this is my xmate project for compile tsbrowse library
this zip contains th xhb.com and xharbour.org lib
the harbour version is not compiling :-(

www.donboscocorp.com/carlos/libsbrowse.zip


salu2

Re: Compile tbfuncs.c

PostPosted: Fri Feb 10, 2012 4:25 pm
by AHF
Thanks Antonio I've discovered that.

Its an old project with our own class inerith from Tcbrowse.

The probelm is that the client wants a bigger space beteewn each row on the browse thus I decided to alter tbfuncs.c in order to do that.

At the present I only have a problem to control the highlite not to go behind the bottom of the browse.

I thing the problem is within GetWindowRow