Building Harbour + FWH apps from Visual Studio 2012

Re: Building Harbour + FWH apps from Visual Studio 2012

Postby Antonio Linares » Wed Jul 17, 2013 3:54 pm

This is the right fix:

Code: Select all  Expand view
#if _MSC_VER < 1700 // Before Visual Studio 2012
#include <tmschema.h>
#else
#include <vsstyle.h>
#endif
regards, saludos

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

Re: Building Harbour + FWH apps from Visual Studio 2012

Postby Antonio Linares » Wed Jul 17, 2013 4:38 pm

FWH already built using VS2012 :-)

A much simpler and more VS2012 friendly buildh32.bat

buildh32.bat
Code: Select all  Expand view
@ECHO OFF
CLS
ECHO ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
ECHO ³ FiveWin for Harbour 13.06 (MSVC++) Jun. 2013     Harbour development power ³Ü
ECHO ³ (c) FiveTech, 1993-2013   for Microsoft Windows 9X/NT/200X/ME/XP/Vista/7/8 ³Û
ECHO ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙÛ
ECHO ÿ ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß

if A%1 == A GOTO :SINTAX
if NOT EXIST %1.prg GOTO :NOEXIST

call "%ProgramFiles(x86)%\Microsoft Visual Studio 11.0\VC\vcvarsall.bat"
if "%FWDIR%" == "" set FWDIR=.\..
if "%HBDIR%" == "" set HBDIR=c:\harbour

ECHO Compiling...

set fwh=%FWDIR%
set hdir=%HBDIR%
set hdirl=%hdir%\lib\vc32
set sdkdir=%Windowssdkdir%Lib\win8\um\x86

%hdir%\bin\harbour %1 /n /i%fwh%\include;%hdir%\include /w /p %2 %3 > comp.log 2> warnings.log
IF ERRORLEVEL 1 GOTO COMPILEERROR
@type comp.log
@type warnings.log

cl -TP -W3 -c /I%hdir%\include /GA %1.c
:ENDCOMPILE

IF EXIST %1.rc rc.exe -r -d__FLAT__ %1

echo %1.obj  > msvc.tmp

echo %fwh%\lib\FiveH32.lib %fwh%\lib\FiveHC32.lib  >> msvc.tmp

echo %hdirl%\hbrtl.lib  >> msvc.tmp
echo %hdirl%\hbvm.lib  >> msvc.tmp
echo %hdirl%\gtgui.lib  >> msvc.tmp
echo %hdirl%\hblang.lib  >> msvc.tmp
echo %hdirl%\hbmacro.lib  >> msvc.tmp
echo %hdirl%\hbrdd.lib  >> msvc.tmp
echo %hdirl%\rddntx.lib  >> msvc.tmp
echo %hdirl%\rddcdx.lib  >> msvc.tmp
echo %hdirl%\rddfpt.lib  >> msvc.tmp
echo %hdirl%\hbsix.lib  >> msvc.tmp
echo %hdirl%\hbdebug.lib  >> msvc.tmp
echo %hdirl%\hbcommon.lib  >> msvc.tmp
echo %hdirl%\hbpp.lib  >> msvc.tmp
echo %hdirl%\hbcpage.lib  >> msvc.tmp
echo %hdirl%\hbwin.lib  >> msvc.tmp
echo %hdirl%\hbcplr.lib  >> msvc.tmp
echo %hdirl%\hbpcre.lib >> msvc.tmp
echo %hdirl%\hbct.lib  >> msvc.tmp
echo %hdirl%\xhb.lib  >> msvc.tmp
echo %hdirl%\png.lib  >> msvc.tmp
echo %hdirl%\hbzlib.lib  >> msvc.tmp

rem Uncomment these two lines to use Advantage RDD
rem echo %hdirl%\rddads.lib >> msvc.tmp
rem echo %hdirl%\ace32.lib >> msvc.tmp

echo kernel32.lib  >> msvc.tmp
echo user32.lib    >> msvc.tmp
echo gdi32.lib     >> msvc.tmp
echo winspool.lib  >> msvc.tmp
echo comctl32.lib  >> msvc.tmp
echo comdlg32.lib  >> msvc.tmp
echo advapi32.lib  >> msvc.tmp
echo shell32.lib   >> msvc.tmp
echo ole32.lib     >> msvc.tmp
echo oleaut32.lib  >> msvc.tmp
echo uuid.lib      >> msvc.tmp
echo odbc32.lib    >> msvc.tmp
echo odbccp32.lib  >> msvc.tmp
echo iphlpapi.lib  >> msvc.tmp
echo mpr.lib       >> msvc.tmp
echo version.lib   >> msvc.tmp
echo wsock32.lib   >> msvc.tmp
echo msimg32.lib   >> msvc.tmp
echo oledlg.lib    >> msvc.tmp
echo psapi.lib     >> msvc.tmp
echo gdiplus.lib   >> msvc.tmp
echo winmm.lib     >> msvc.tmp

IF EXIST %1.res echo %1.res >> msvc.tmp

link @msvc.tmp /nologo /subsystem:windows /force:multiple /NODEFAULTLIB:libc

IF ERRORLEVEL 1 GOTO LINKERROR
ECHO * Application successfully built *
%1
GOTO EXIT
ECHO

rem delete temporary files
@del %1.c
@del msvc.tmp

:COMPILEERROR
@type comp.log
@type warnings.log
ECHO * Compiling errors *
GOTO EXIT

:LINKERROR
ECHO * Linking errors *
GOTO EXIT

:SINTAX
ECHO    SYNTAX: Build [Program]     {-- No especifiques la extensi¢n PRG
ECHO                                {-- Don't specify .PRG extension
GOTO EXIT

:NOEXIST
ECHO The specified PRG %1 does not exist

:EXIT
regards, saludos

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

Re: Building Harbour + FWH apps from Visual Studio 2012

Postby Antonio Linares » Wed Jul 17, 2013 11:01 pm

Hakan,

Already tested and the same problem: release version does not show, debug version runs fine.

And right now I just realized that we can't debug the release version from the VS2012 IDE. Only the debug version can be debugged.

I think traces should be placed in the Harbour boot to check how far we go, and why it is not showing. Thinking about
the best way to do this.
regards, saludos

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

Re: Building Harbour + FWH apps from Visual Studio 2012

Postby Antonio Linares » Wed Jul 17, 2013 11:42 pm

Hakan,

Solved! It is working fine :-)

I compared the debug and release versions options that VS2012 use and noticed this difference:
"No whole program optimization" used in the debug version and not in the release. Just change that option in the
release version and it will work fine :-)

Image
regards, saludos

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

Re: Building Harbour + FWH apps from Visual Studio 2012

Postby Antonio Linares » Wed Jul 17, 2013 11:53 pm

Hakan,

Here it is the full project with the release and debug versions included (EXEs) so you can run them :-)

https://code.google.com/p/fivewin-contributions/downloads/detail?name=tutor02_msvc2012_ok.zip
regards, saludos

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

Re: Building Harbour + FWH apps from Visual Studio 2012

Postby Horizon » Thu Jul 18, 2013 7:27 pm

Hi Antonio,

Thank you very much for your effort.

Now, it is time to port a small project to vs2012. I will start tomorrow.
Regards,

Hakan ONEMLI

Harbour & MSVC 2022 & FWH 23.04
Horizon
 
Posts: 1322
Joined: Fri May 23, 2008 1:33 pm

Re: Building Harbour + FWH apps from Visual Studio 2012

Postby Antonio Linares » Fri Jul 19, 2013 6:25 am

Hakan,

Please share with us your steps, difficulties, etc. thanks :-)
regards, saludos

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

Re: Building Harbour + FWH apps from Visual Studio 2012

Postby shri_fwh » Thu Jul 25, 2013 12:29 pm

Hi Antonio,

Thanks a lot for giving news ideas to us..!

So if this IDE works fine with FiveWin + Harbour + MSVC then we do not need any other IDE like xMate, USTUDIO. Please correct this if it is worng.

Thanks
Shridhar
Thanks
Shridhar
FWH 19.12, BCC 7 32 bit, MariaDB
shri_fwh
 
Posts: 301
Joined: Mon Dec 07, 2009 2:49 pm

Re: Building Harbour + FWH apps from Visual Studio 2012

Postby Antonio Linares » Thu Jul 25, 2013 12:49 pm

Shridhar,

yes, thats right. You can edit, build and run your app from Visual Studio 2012 Express :-)

if you use the Visual Studio 2012 Pro then you can also edit your resources from it :-) (this is not available in the Visual Studio 2012 Express).
regards, saludos

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

Re: Building Harbour + FWH apps from Visual Studio 2012

Postby shri_fwh » Sun Jul 28, 2013 11:37 am

Hi Antonio,

Thanks a lot for the valuable information...!

I was about to buy USTUDIO IDE but now, first I have to try the MSVC IDE env. After I canl decide whether USTUDIO have to buy or not.

Thanks
Shridhar
Thanks
Shridhar
FWH 19.12, BCC 7 32 bit, MariaDB
shri_fwh
 
Posts: 301
Joined: Mon Dec 07, 2009 2:49 pm

Re: Building Harbour + FWH apps from Visual Studio 2012

Postby Antonio Linares » Sun Jul 28, 2013 12:08 pm

Shridhar,

Still it is missing the implementation of syntax coloring for PRGs. Surely there is a way but we need to google for it and see how easy or difficult it is :-)
regards, saludos

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

Previous

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 18 guests