link problem with fivewin 25.01 64 bit and VS2022

marzio
Posts: 144
Joined: Wed Apr 04, 2007 6:54 am
Been thanked: 3 times

Re: link problem with fivewin 25.01 64 bit and VS2022

Post by marzio »

How can I modify buildh64.bat to compile 3 files at once?
have you an example?
thanks
User avatar
Antonio Linares
Site Admin
Posts: 42715
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 93 times
Been thanked: 103 times
Contact:

Re: link problem with fivewin 25.01 64 bit and VS2022

Post by Antonio Linares »

You have a working example at FWH\makes\hbmk2.zip:

go64.bat and test64.hbp
regards, saludos

Antonio Linares
www.fivetechsoft.com
marzio
Posts: 144
Joined: Wed Apr 04, 2007 6:54 am
Been thanked: 3 times

Re: link problem with fivewin 25.01 64 bit and VS2022

Post by marzio »

thanks Antonio per the working example hbmk2.zip

but i have substitute %1 with @FileComp.txt for harobur compilation in buildh64.bat
%hdir%\bin\win\msvc64\harbour @FileComp.txt /n /i%fwdir%\include;%hdir%\include /w /p /d__64__ %2 %3 > comp.log 2> warnings.log
and i obtain 3 .c files.

I have modify cl.exe inserting the 3 files .c instead of %1.c
cl -TC -W3 -O2 -c -I%hdir%\include -D_WIN64 -D__FLAT__ -I%fwdir%\include -I-I"%ProgramFiles(x86)%\Windows Kits"\10\Include\10.0.18362.0\ucrt scuola.c functscl.c TcBrowse.c

i have modify: echo %1.obj > msvc.tmp with echo scuola.obj functscl.obj TcBrowse.obj > msvc.tmp
and now it generate a msvc.tmp file with 3 obj file and the necessary lib files.

now i have new problem:
some functions called from scuola.prg but residents in funcscl.prg give this errors:

scuola.c
functscl.c
TcBrowse.c
Generazione del codice in corso...
functscl.obj : error LNK2005: HB_FUN_LGETPASSWORD just defined in scuola.obj
functscl.obj : error LNK2005: HB_FUN_MOVE_FILE già definito in scuola.obj
TcBrowse.obj : error LNK2005: HB_FUN_TCBROWSE già definito in scuola.obj
ecc
scuola.exe : fatal error LNK1169: rilevato uno o più simboli definiti più volte
* Linking errors *


is there a flag to put to avoid this errors?
thanks
User avatar
Antonio Linares
Site Admin
Posts: 42715
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 93 times
Been thanked: 103 times
Contact:

Re: link problem with fivewin 25.01 64 bit and VS2022

Post by Antonio Linares »

Use this linker flag:

/force:multiple
regards, saludos

Antonio Linares
www.fivetechsoft.com
marzio
Posts: 144
Joined: Wed Apr 04, 2007 6:54 am
Been thanked: 3 times

Re: link problem with fivewin 25.01 64 bit and VS2022

Post by marzio »

Many thanks Antonio,

now all works fine!

i have also correct this string for harbor compile with 3 files:
%hdir%\bin\win\msvc64\harbour scuola functscl TcBrowse /n /i%fwdir%\include;%hdir%\include /p /d__64__ %2 %3 > comp.log 2> warnings.log

thanks to all.
Marzio
Post Reply