multiple definition error

multiple definition error

Postby marzio » Tue Jan 24, 2017 9:42 am

i am trying to compile a simple program in hbide with fivewin libraries for window
and the hbmk2 give me an output console error:
multiple definition of 'HB_FUN_ERRORSYS'
multiple definition of 'HB_FUN_HB_GTSYS'

It seems that FiveWin has its own ErrorSys and Get System implementation
which is clashing with Harbour's implementation.

i have added 2 lib of fivewin 1507
-ld:\winclip\fwh1507\lib\FiveHGC.lib
-ld:\winclip\fwh1507\lib\FiveHG.lib

#include "FiveWin.ch"

PROCEDURE Main()

LOCAL oWnd

DEFINE WINDOW oWnd FROM 0, 0 TO 30, 80 TITLE "prova"
ACTIVATE WINDOW oWnd
oWnd:End()

Return(NIL)


what can i do to avoid the error?
thanks, marzio
marzio
 
Posts: 129
Joined: Wed Apr 04, 2007 6:54 am

Re: multiple definition error

Postby Antonio Linares » Tue Jan 24, 2017 10:22 am

Marzio,

Please provide the flag -trace to hbmk2 and post here what you get, thanks
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42118
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: multiple definition error

Postby Antonio Linares » Tue Jan 24, 2017 10:23 am

oWnd:End() is not needed in your code
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42118
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: multiple definition error

Postby marzio » Tue Jan 24, 2017 10:59 am

# hbmk2 Flags
#
-hbexe


# GT Requested
#
-gtwin
#-w
#-p
#-gtgui

-ic:\winclip\fwh1507\include

-lc:\winclip\fwh1507\lib\FiveHGC.lib
-lc:\winclip\fwh1507\lib\FiveHG.lib

# Compilable Sources
#
#
# .prg
#
hello.prg
marzio
 
Posts: 129
Joined: Wed Apr 04, 2007 6:54 am

Re: multiple definition error

Postby marzio » Tue Jan 24, 2017 11:14 am

[43995.532] ----------------------------------------------------------------------------------------------------
[43995.548] Project [ Prj00001 ] Launch [ Yes ] Rebuild [ Yes ] Started [ 12:13:15 ]
[43995.548] ----------------------------------------------------------------------------------------------------
[43995.564] Batch File Exists => C:\Users\marzio\AppData\Local\Temp\l38z2z.bat
[43995.564] Batch File Contents =>
[43995.595] SET PATH=C:\Winclip\qtcontrib\bin;%PATH% C:\Winclip\qtcontrib\bin\hbmk2.exe C:\Winclip\prova\prj00001.hbp -q -trace -info -lang=en -width=512 -rebuild
[43995.595] Command => C:\Windows\system32\cmd.exe
[43995.595] Arguments => /C C:\Users\marzio\AppData\Local\Temp\l38z2z.bat
[43995.595] ----------------------------------------------------------------------------------------------------
[43995.595] CurDir() => Winclip\QtContrib\bin Starting in => C:\Winclip\prova\
[43995.659]
[43995.660] C:\Winclip\prova>SET PATH=C:\Winclip\qtcontrib\bin;C:\Program Files (x86)\Common Files\Intel\Shared Files\cpp\bin\Intel64;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Two Pilots\PDF2Text Pilot\;C:\Program Files (x86)\PDFtk\bin\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\Windows\system32\config\systemprofile\.dnx\bin;C:\Program Files\Microsoft DNX\Dnvm\
[43995.660] C:\Winclip\prova>C:\Winclip\qtcontrib\bin\hbmk2.exe C:\Winclip\prova\prj00001.hbp -q -trace -info -lang=en -width=512 -rebuild
[43995.660]
[43995.701] hbmk2: Autodetected platform: win
[43995.701]
[43995.722] hbmk2: Autodetected C compiler: mingw
[43995.723] hbmk2: Using Harbour: C:\Winclip\qtcontrib\bin C:\Winclip\qtcontrib\include C:\Winclip\qtcontrib\lib\win\mingw C:\Winclip\qtcontrib\bin C:\Winclip\qtcontrib\contrib C:\Winclip\qtcontrib\addons
[43995.723] hbmk2: Using C compiler: C:\Winclip\qtcontrib\comp\mingw\bin
[43995.723] hbmk2[prj00001]: Warning: Non-portable parameter: '-lc:\winclip\fwh1507\lib\FiveHGC.lib' in C:\Winclip\prova\prj00001.hbp:26. Use '-Lc:\winclip\fwh1507\lib -lFiveHGC' option(s) instead.
[43995.724] hbmk2[prj00001]: Warning: Non-portable parameter: '-lc:\winclip\fwh1507\lib\FiveHG.lib' in C:\Winclip\prova\prj00001.hbp:27. Use '-Lc:\winclip\fwh1507\lib -lFiveHG' option(s) instead.
[43995.724] hbmk2: Compiling Harbour sources...
[43995.724] hbmk2: Harbour compiler command (embedded):
[43995.725] (C:\Winclip\qtcontrib\bin\harbour.exe) -n2 C:\Winclip\prova\hello.prg -q -o.hbmk\win\mingw\ -iC:\Winclip\qtcontrib\include -ic:\winclip\fwh1507\include
[43995.725] Harbour 3.2.0dev (r1508011114)
[43995.725] Copyright (c) 1999-2015, http://harbour-project.org/
[43995.725]
[43995.926] hbmk2: Compiling...
[43995.927] hbmk2: 'cd' to: .hbmk\win\mingw
[43995.927] hbmk2: C/C++ compiler command:
[43995.927] C:\Winclip\qtcontrib\comp\mingw\bin\gcc.exe -c -O3 -march=i586 -mtune=pentiumpro -fomit-frame-pointer -W -Wall -pipe -IC:/Winclip/qtcontrib/include -Ic:/winclip/fwh1507/include ../../../.hbmk/win/mingw/hello.c ../../../.hbmk/win/mingw/_hbmkaut_hello.c
[43995.928]
[43996.470] hbmk2: 'cd' back.
[43996.471] hbmk2: Linking... hello.exe
[43996.471] hbmk2: Linker command:
[43996.471] C:\Winclip\qtcontrib\comp\mingw\bin\gcc.exe .hbmk/win/mingw/hello.o .hbmk/win/mingw/_hbmkaut_hello.o -mconsole -Wl,--start-group -lhbextern -lhbdebug -lhbvm -lhbrtl -lhblang -lhbcpage -lgtcgi -lgtpca -lgtstd -lgtwin -lgtwvt -lgtgui -lhbrdd -lhbuddall -lhbusrrdd -lrddntx -lrddcdx -lrddnsx -lrddfpt -lhbrdd -lhbhsx -lhbsix -lhbmacro -lhbcplr -lhbpp -lhbcommon -lhbmainstd -lkernel32 -luser32 -lgdi32 -ladvapi32 -lws2_32 -liphlpapi -lwinspool -lcomctl32 -lcomdlg32 -lshell32 -luuid -lole32 -loleaut32 -lmpr -lwinmm -lmapi32 -limm32 -lmsimg32 -lwininet -lhbpcre -lhbzlib c:/winclip/fwh1507/lib/FiveHGC.lib c:/winclip/fwh1507/lib/FiveHG.lib -Wl,--end-group -ohello.exe -LC:/Winclip/qtcontrib/lib/win/mingw
[43996.472]
[43998.969] c:/winclip/fwh1507/lib/FiveHG.lib(ERRSYSW.o):ERRSYSW.c:(.text+0x39): multiple definition of `HB_FUN_ERRORSYS'
[43998.970] C:/Winclip/qtcontrib/lib/win/mingw/libhbrtl.a(errsys.o):errsys.c:(.text+0x0): first defined here
[43998.970] c:/winclip/fwh1507/lib/FiveHG.lib(ERRSYSW.o):ERRSYSW.c:(.text+0x15b): multiple definition of `HB_FUN_HB_GTSYS'
[43998.971] C:/Winclip/qtcontrib/lib/win/mingw/libhbrtl.a(gtsys.o):gtsys.c:(.text+0x10): first defined here
[43998.971] c:/winclip/fwh1507/lib/FiveHG.lib(WINDOW.o):WINDOW.c:(.data+0x26d8): undefined reference to `HB_FUN_NOTIFY'
[43998.972] C:/Winclip/qtcontrib/comp/mingw/bin/../lib/gcc/i686-w64-mingw32/4.9.2/../../../../i686-w64-mingw32/bin/ld.exe: c:/winclip/fwh1507/lib/FiveHG.lib(ERRSYSW.o): bad reloc address 0x0 in section `.data'
[43998.972] C:/Winclip/qtcontrib/comp/mingw/bin/../lib/gcc/i686-w64-mingw32/4.9.2/../../../../i686-w64-mingw32/bin/ld.exe: final link failed: Invalid operation
[43998.973] collect2.exe: error: ld returned 1 exit status
[43998.974] hbmk2[prj00001]: Error: Running linker. 1
[43998.974] C:\Winclip\qtcontrib\comp\mingw\bin\gcc.exe .hbmk/win/mingw/hello.o .hbmk/win/mingw/_hbmkaut_hello.o -mconsole -Wl,--start-group -lhbextern -lhbdebug -lhbvm -lhbrtl -lhblang -lhbcpage -lgtcgi -lgtpca -lgtstd -lgtwin -lgtwvt -lgtgui -lhbrdd -lhbuddall -lhbusrrdd -lrddntx -lrddcdx -lrddnsx -lrddfpt -lhbrdd -lhbhsx -lhbsix -lhbmacro -lhbcplr -lhbpp -lhbcommon -lhbmainstd -lkernel32 -luser32 -lgdi32 -ladvapi32 -lws2_32 -liphlpapi -lwinspool -lcomctl32 -lcomdlg32 -lshell32 -luuid -lole32 -loleaut32 -lmpr -lwinmm -lmapi32 -limm32 -lmsimg32 -lwininet -lhbpcre -lhbzlib c:/winclip/fwh1507/lib/FiveHGC.lib c:/winclip/fwh1507/lib/FiveHG.lib -Wl,--end-group -ohello.exe -LC:/Winclip/qtcontrib/lib/win/mingw
[43998.975]
[43999.118]
[43999.119] hbmk2: Error: Referenced, missing, but unknown function(s): NOTIFY()
[43999.119]
[43999.120] ----------------------------------------------------------------------------------------------------
[43999.124] Exit Code [ 7 ] Exit Status [ 0 ] Finished at [ 12:13:19 ] Done in [ 3.53 Secs ]
[43999.125] ----------------------------------------------------------------------------------------------------
[43999.136] [...C:\Winclip\prova\hello.exe..]
[43999.138]
[43999.141] Detected executable => C:\Winclip\prova\hello.exe
[43999.173]
[43999.173] Sorry, cannot launch project because of errors...
marzio
 
Posts: 129
Joined: Wed Apr 04, 2007 6:54 am

Re: multiple definition error

Postby marzio » Wed Feb 01, 2017 10:05 am

Antonio,
i have posted the hbmk2 Flags and all the error message that i receive.
missing something?
how can i resolve this problem?

thanks in advance
Marzio
marzio
 
Posts: 129
Joined: Wed Apr 04, 2007 6:54 am

Re: multiple definition error

Postby Antonio Linares » Wed Feb 01, 2017 11:05 am

Please add this dummy function to your PRG and try it again:

function Notify()

return nil
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42118
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: multiple definition error

Postby marzio » Wed Feb 01, 2017 11:20 am

Ii have the same error plus this message:
c:/winclip/fwh1507/lib/FiveHG.lib(WINDOW.o):WINDOW.c:(.data+0x26d8): undefined reference to `HB_FUN_NOTIFY'

thanks
marzio
marzio
 
Posts: 129
Joined: Wed Apr 04, 2007 6:54 am

Re: multiple definition error

Postby marzio » Wed Feb 01, 2017 11:25 am

sorry Antonio,
i have the same error WITHOUT this message:
c:/winclip/fwh1507/lib/FiveHG.lib(WINDOW.o):WINDOW.c:(.data+0x26d8): undefined reference to `HB_FUN_NOTIFY'

I had wrong.
marzio
 
Posts: 129
Joined: Wed Apr 04, 2007 6:54 am

Re: multiple definition error

Postby Antonio Linares » Wed Feb 01, 2017 11:26 am

Please copy here your hello.prg source code
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42118
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: multiple definition error

Postby marzio » Wed Feb 01, 2017 11:29 am

#include "FiveWin.ch"


PROCEDURE Main()

LOCAL oWnd

DEFINE WINDOW oWnd FROM 0, 0 TO 30, 80 TITLE "prova"
ACTIVATE WINDOW oWnd
oWnd:End()

Return(NIL)


function Notify()

return nil
marzio
 
Posts: 129
Joined: Wed Apr 04, 2007 6:54 am

Re: multiple definition error

Postby Antonio Linares » Wed Feb 01, 2017 11:30 am

Please change these lines in the hbmk2 file:

-lc:\winclip\fwh1507\lib\FiveHGC.lib
-lc:\winclip\fwh1507\lib\FiveHG.lib

into:

-Lc:\winclip\fwh1507\lib -lFiveHG
-Lc:\winclip\fwh1507\lib -lFiveHGC
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42118
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: multiple definition error

Postby Antonio Linares » Wed Feb 01, 2017 11:32 am

You have to use gtgui and not gtwin
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42118
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: multiple definition error

Postby marzio » Wed Feb 01, 2017 11:33 am

changed,
i have the same error.
marzio
 
Posts: 129
Joined: Wed Apr 04, 2007 6:54 am

Re: multiple definition error

Postby marzio » Wed Feb 01, 2017 11:35 am

also with gtgui same error.
marzio
 
Posts: 129
Joined: Wed Apr 04, 2007 6:54 am

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 47 guests