Hello everyone.
Posting my progress on migrating to MSVC, I first decided to learn about generating the project build.
Starting from the example in the folder fw \ makes I managed to build my first executable in MSVC 2019 written in .prg. The most important step was to correctly locate the necessary files, in my case:
Harbour folder: HBDIR = D: \ Tools \ Harbour32MSVC2017
FiveWin folder: FWDIR = D: \ Tools \ FWH1709
Compiler folder C: VCDIR = C: \ "Program Files (x86) \ Microsoft Visual Studio" \ 2019 \ Community \ VC \ Tools \ MSVC \ 14.26.28801 \ bin \ Hostx86 \ x86
Include C folder: VCDIRINC = "C: \ Program Files (x86) \ Microsoft Visual Studio \ 2019 \ Community \ VC \ Tools \ MSVC \ 14.26.28801 \ include"
SDK folder: SDKDIR = "C: \ Program Files (x86) \ Windows Kits \ 10 \ Lib \ 10.0.18362.0 \ um \ x86"
SDK include folder: SDKDIRINC = "C: \ Program Files (x86) \ Windows Kits \ 10 \ Include \ 10.0.18362.0 \ um"
RC compiler folder: RCDIR = "C: \ Program Files (x86) \ Windows Kits \ 10 \ bin \ 10.0.18362.0 \ x86"
Modifying the test.mak file I generated the executable successfully, however, to adapt to my project, I need to change the structure of the folders:
Source files: folder. \ Source
.C and .obj files: \ obj folder
When making this change, I was no longer able to generate the exe, looking at the log files, I realized that the .obj files are not being located correctly.
Makefile:
- Code: Select all Expand view
HBDIR=D:\Tools\Harbour32MSVC2017
FWDIR=D:\Tools\FWH1709
VCDIR=C:\"Program Files (x86)\Microsoft Visual Studio"\2019\Community\VC\Tools\MSVC\14.26.28801\bin\Hostx86\x86
VCDIRINC="C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include"
SDKDIR="C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\um\x86"
SDKDIRINC="C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um"
RCDIR="C:\Program Files (x86)\Windows Kits\10\bin\10.0.18362.0\x86"
.SUFFIXES: .PRG .C .OBJ .RC .RES
PRG = \
source\one.PRG \
source\two.PRG \
source\three.PRG
#place here as many PRGs as needed
OBJ=$(PRG:.PRG=.OBJ)
OBJS=$(OBJ:.\=.\obj\)
PROJECT: ONE.EXE
one.exe : $(OBJS) one.res
echo $(OBJS) > msvc.tmp
echo $(FWDIR)\lib\FiveH32.lib $(FWDIR)\lib\FiveHC32.lib >> msvc.tmp
echo $(HBDIR)\lib\hbrtl.lib >> msvc.tmp
echo $(HBDIR)\lib\hbvm.lib >> msvc.tmp
echo $(HBDIR)\lib\gtgui.lib >> msvc.tmp
echo $(HBDIR)\lib\hblang.lib >> msvc.tmp
echo $(HBDIR)\lib\hbmacro.lib >> msvc.tmp
echo $(HBDIR)\lib\hbrdd.lib >> msvc.tmp
echo $(HBDIR)\lib\rddntx.lib >> msvc.tmp
echo $(HBDIR)\lib\rddcdx.lib >> msvc.tmp
echo $(HBDIR)\lib\rddfpt.lib >> msvc.tmp
echo $(HBDIR)\lib\hbsix.lib >> msvc.tmp
echo $(HBDIR)\lib\hbdebug.lib >> msvc.tmp
echo $(HBDIR)\lib\hbcommon.lib >> msvc.tmp
echo $(HBDIR)\lib\hbpp.lib >> msvc.tmp
echo $(HBDIR)\lib\hbcpage.lib >> msvc.tmp
echo $(HBDIR)\lib\hbwin.lib >> msvc.tmp
echo $(HBDIR)\lib\hbcplr.lib >> msvc.tmp
echo $(HBDIR)\lib\hbpcre.lib >> msvc.tmp
echo $(HBDIR)\lib\hbct.lib >> msvc.tmp
echo $(HBDIR)\lib\xhb.lib >> msvc.tmp
echo $(HBDIR)\lib\png.lib >> msvc.tmp
echo $(HBDIR)\lib\hbzlib.lib >> msvc.tmp
echo $(HBDIR)\lib\hbziparc.lib >> msvc.tmp
echo $(HBDIR)\lib\hbmzip.lib >> msvc.tmp
echo $(HBDIR)\lib\minizip.lib >> msvc.tmp
echo $(HBDIR)\lib\hbtip.lib >> msvc.tmp
echo $(HBDIR)\lib\hbzebra.lib >> msvc.tmp
echo $(SDKDIR)\kernel32.lib >> msvc.tmp
echo $(SDKDIR)\user32.lib >> msvc.tmp
echo $(SDKDIR)\gdi32.lib >> msvc.tmp
echo $(SDKDIR)\winspool.lib >> msvc.tmp
echo $(SDKDIR)\comctl32.lib >> msvc.tmp
echo $(SDKDIR)\comdlg32.lib >> msvc.tmp
echo $(SDKDIR)\advapi32.lib >> msvc.tmp
echo $(SDKDIR)\shell32.lib >> msvc.tmp
echo $(SDKDIR)\ole32.lib >> msvc.tmp
echo $(SDKDIR)\oleaut32.lib >> msvc.tmp
echo $(SDKDIR)\uuid.lib >> msvc.tmp
echo $(SDKDIR)\odbc32.lib >> msvc.tmp
echo $(SDKDIR)\odbccp32.lib >> msvc.tmp
echo $(SDKDIR)\iphlpapi.lib >> msvc.tmp
echo $(SDKDIR)\mpr.lib >> msvc.tmp
echo $(SDKDIR)\version.lib >> msvc.tmp
echo $(SDKDIR)\wsock32.lib >> msvc.tmp
echo $(SDKDIR)\msimg32.lib >> msvc.tmp
echo $(SDKDIR)\oledlg.lib >> msvc.tmp
echo $(SDKDIR)\psapi.lib >> msvc.tmp
echo $(SDKDIR)\gdiplus.lib >> msvc.tmp
echo $(SDKDIR)\winmm.lib >> msvc.tmp
IF EXIST one.res echo one.res >> msvc.tmp
$(VCDIR)\link @msvc.tmp /out:One.exe /nologo /subsystem:windows /force:multiple /NODEFAULTLIB:msvcrt > link.log
@type link.log
one.res : one.rc
$(RCDIR)\rc.exe -r -d__FLAT__ one.rc
.PRG.OBJ:
$(HBDIR)\bin\harbour $< /n /w /Oobj\ /i$(FWDIR)\include;$(HBDIR)\include
$(VCDIR)\cl.exe -TP -W3 -c /GS- /I$(HBDIR)\include /GA -Foobj\ obj\*.c
Part of compiler.log file error:
- Code: Select all Expand view
one.c
three.c
two.c
Gerando C¢digo...
echo source\one.OBJ source\two.OBJ source\three.OBJ > msvc.tmp
echo D:\Tools\FWH1709\lib\FiveH32.lib D:\Tools\FWH1709\lib\FiveHC32.lib >> msvc.tmp
echo D:\Tools\Harbour32MSVC2017\lib\hbrtl.lib >> msvc.tmp
echo D:\Tools\Harbour32MSVC2017\lib\hbvm.lib >> msvc.tmp
echo D:\Tools\Harbour32MSVC2017\lib\gtgui.lib >> msvc.tmp
Problem is here: "echo source\one.OBJ source\two.OBJ source\three.OBJ > msvc.tmp"
Would anyone know how to fix this?
Thankful in advance.