Re: [harbour-users] How to use "--allow-multiple-definition"

4,404 views
Skip to first unread message

Fernando Yurisich

unread,
May 29, 2012, 11:17:17 AM5/29/12
to harbou...@googlegroups.com
Rossine:

The correct syntax is

-ldflag=-Wl,--allow-multiple-definition

Regards
Fernando Yurisich
--
Q.P.M. is the continuation of Q.A.C. project manager for (x)Harbour and OOHG/Minigui based projects.
Visit us at http://sourceforge.net/p/qpm and join the user list.
Please support me with a donation via PayPal.



2012/5/29 Rossine <qii...@ig.com.br>
Hello,

I'm trying to use "--allow-multiple-definition" and I can not in my
file .hbc

See:

c:/hrb_ming/lib/libminigui.a(ErrorSys.o):ErrorSys.c:(.text+0x120):
multiple definition of `HB_FUN__LSHOWDETAILERROR'
.hbmk/win/mingw/ERRORSYS.o:ERRORSYS.c:(.text+0xdec0): first defined
here
collect2: ld returned 1 exit status
hbmk2: Erro: Executando linkeditor. 1
gcc.exe .hbmk/win/mingw    ....   -lwinmm -lmapi32 -limm32 -lmsimg32 -
lwininet -l"harbour-32"   -Wl,--end-group

I tried with:

-ldflag==--allow-multiple-definition

with:

-ldflag==--allow-multiple-definition

and not work.

Note that "--allow-multiple-definition" is not inserted in the line
compilation. What would be the correct way to deifinir this?

Best Regards,

Rossine.

--
You received this message because you are subscribed to the Google
Groups "Harbour Users" group.
Unsubscribe: harbour-user...@googlegroups.com
Web: http://groups.google.com/group/harbour-users

Rossine

unread,
May 29, 2012, 11:27:46 AM5/29/12
to Harbour Users
Hello Fernando,

> The correct syntax is
>
> -ldflag=-Wl,--allow-multiple-definition

Not work here :(

I create this sample:

TEST.PRG

function main

cls

? hb_valtoexp( .T. )

return NIL

FUNCTION hb_valtoexp( lNewValue )

return lNewValue

and TEST.HBC

-ldflag=-Wl,--allow-multiple-definition

and this is the return of compiling:

hbmk2: Processando opções do ambiente: -compiler=mingw
Harbour 3.2.0dev (Rev. 17513)
Copyright (c) 1999-2012, http://harbour-project.org/
Compiling 'tes3.prg'...
Lines 11, Functions/Procedures 2
Generating C source output to 'C:\TMP\hbmk_fjnfm6.dir\tes3.c'... Done.
c:/hrb_ming/lib/libhbrtl.a(valtoexp.o):(.text+0x5c0): multiple
definition of `HB_FUN_HB_VALTOEXP'
C:/TMP/hbmk_fjnfm6.dir/tes3.o:tes3.c:(.text+0x0): first defined here
collect2: ld returned 1 exit status
hbmk2: Erro: Executando linkeditor. 1
gcc.exe C:/TMP/hbmk_fjnfm6.dir/tes3.o C:/TMP/hbmk_fjnfm6.dir/
hbmk_u6govm.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 -lwi
nspool -lcomctl32 -lcomdlg32 -lshell32 -luuid -lole32 -loleaut32 -lmpr
-lwinmm -lmapi32 -limm32 -lms
img32 -lwininet -lhbpcre -lhbzlib -Wl,--end-group -otes3.exe -Lc:/
hrb_ming/lib -Lc:/hrb_ming/bin

Any other suggestions ?

Best Regards,

Rossine.

Rossine

unread,
May 29, 2012, 11:39:14 AM5/29/12
to Harbour Users
Hi,

So it worked:

hbmk2 tes3 -ldflag=-Wl,--allow-multiple-definition

but this not work:

hbmk2 tes3

or

hbmk2 tes3 tes3.hbc

Will this be a bug in hbmk2 ?

Best Regards,

Rossine.

Rossine

unread,
May 29, 2012, 11:44:21 AM5/29/12
to Harbour Users
Hi,

Setting in tes3.hbp work :)

-ldflag=-Wl,--allow-multiple-definition
tes3.prg

and

hbmk2 tes3.hbp

and it´s work´s,

Many thank´s,

Rossine.
Reply all
Reply to author
Forward
0 new messages