FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Full working project for Visual Studio 2012 IDE
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Full working project for Visual Studio 2012 IDE
Posted: Sat Jun 07, 2014 07:42 AM
Here you have a working project to build a FWH + Harbour app from the Visual Studio 2012 IDE itself:

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

just unzip it and double click on the sln file.

When trying to build it I faced this bug:
https://github.com/glfw/glfw/issues/205

But fortunately we can bypass it using the flag /arch:SSE to call the Visual Studio C compiler to build FWH (notice: FWH 14.04 does not include this fix, so you will need an updated FiveHC32.lib)



Actually I just have this pending unresolved external:
1>------ Build started: Project: tutor02, Configuration: Debug Win32 ------
1> Creating library C:\temp\tutor02\Debug\tutor02.lib and object C:\temp\tutor02\Debug\tutor02.exp
1>hbct.lib(ctmath2.obj) : error LNK2019: unresolved external symbol __HUGE referenced in function _HB_FUN_LOG10
1>hbrtl.lib(math.obj) : error LNK2001: unresolved external symbol __HUGE
1>C:\temp\tutor02\Debug\tutor02.exe : fatal error LNK1120: 1 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Full working project for Visual Studio 2012 IDE
Posted: Sat Jun 07, 2014 07:51 AM
This flag is required to avoid a linker warning: /NODEFAULTLIB:LIBCMT
(it is not included in the project that I have provided. I will be providing updated versions of it)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Full working project for Visual Studio 2012 IDE
Posted: Sat Jun 07, 2014 08:10 AM
Problem solved: We can't use /NODEFAULTLIB:LIBCMT or we get the unresolved external __HUGE, that requires a Harbour built using this compiler flag /MD:

http://social.msdn.microsoft.com/Forums/vstudio/en-US/2c526d90-fbd3-40c1-89b4-1e35ca521818/dll-with-static-lib-dependency

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 3022
Joined: Fri Oct 07, 2005 01:45 PM
Re: Full working project for Visual Studio 2012 IDE
Posted: Sat Jun 07, 2014 02:12 PM

Two quick observations

1) You need to update your version. I'm on the latest ( free ) update so there may be differences. I got the warning that I had to update your source files

2) In your sample, where are your .prg files ? Following your earlier instructions, I have both .prg and .c files under Source Files

Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
Posts: 3022
Joined: Fri Oct 07, 2005 01:45 PM
Re: Full working project for Visual Studio 2012 IDE
Posted: Sat Jun 07, 2014 02:15 PM

Also, I will need the updated library ...

Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Full working project for Visual Studio 2012 IDE
Posted: Sat Jun 07, 2014 02:31 PM

Tim,

is it possible to ask for the update from the IDE itself ?

Yes, my sources are in the same "source files" folder

I am emailing you the modified lib :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 3022
Joined: Fri Oct 07, 2005 01:45 PM
Re: Full working project for Visual Studio 2012 IDE
Posted: Sat Jun 07, 2014 03:46 PM

Antonio,

Under Tools on the menu, select Extensions and Updates. On the popup, look at Updates, and then Product Updates. It's now at VS 2013, update 2. They keep adding new features.

When working in Visual Studio, take a look at LightSwitch. It's a true RAD tool. They are pouring a lot of resources into it so it is improving every month.

Tim

Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Full working project for Visual Studio 2012 IDE
Posted: Sat Jun 07, 2014 04:09 PM

Tim,

Cool, thanks. Already updating it :-)

Yes, I remember I review it once and the first idea that came to my mind is that we could easily build the same tool using FiveWin ;-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 3022
Joined: Fri Oct 07, 2005 01:45 PM
Re: Full working project for Visual Studio 2012 IDE
Posted: Sat Jun 07, 2014 04:48 PM

Right now I want to get my "application" fully buildable in the Visual Studio IDE.

After that, I will be curious to see if we can build other elements of it using other VS languages and mix them together in one application. Wouldn't it be nice if we could access some of the more recent capabilities written for VB or C# coding, compile them into .obj code, and link them all together in one .exe ? In theory, that would appear to be the ultimate opportunity. That would make it so easy to incorporate integration with other 3rd party products.

Or perhaps I dream to much ( or is it an old man's fantasies ? )

Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Full working project for Visual Studio 2012 IDE
Posted: Sat Jun 07, 2014 04:50 PM
Tim,

it is a nice wish but you forgot .NET

We can not mix .NET code and native C code. The only way I found to do it was this:

https://code.google.com/p/fivenet/
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 3022
Joined: Fri Oct 07, 2005 01:45 PM
Re: Full working project for Visual Studio 2012 IDE
Posted: Sat Jun 07, 2014 04:57 PM

True, but not all code is .net.

Programming is like a train going uphill. It's a hard journey, but once you get to the top, the view is great, and the trip down the other side is so much fun.

Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Full working project for Visual Studio 2012 IDE
Posted: Sat Jun 07, 2014 05:02 PM

Well, the .NET app could call Harbour code, and to do it the other way round we should use FiveNet way.

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 3022
Joined: Fri Oct 07, 2005 01:45 PM
Re: Full working project for Visual Studio 2012 IDE
Posted: Sat Jun 07, 2014 06:17 PM
Antonio,

I've come a long way. I can now see my resources ( and open them ), though I think there will be some re-working necessary because they were originally built in Borland, and can probably be optimized in Visual Studio for cleaner controls. I haven't used any resource editor for awhile ... preferring to modify dialogs manually.

HOWEVER

I still have the following errors. I realize you got a build with a simple program ( 1 PRG ) but I'm building a full blown application that was building in UE Studio with VS 2012. I think we are likely missing a library for functions I'm calling in the FiveHC lib, but are not tapped in your sample build.

Here are the errors:
Code (fw): Select all Collapse
1>     Creating library C:\Users\TimsAIO\Documents\Visual Studio 2013\Projects\MLS2015\Debug\MLS2015.lib and object C:\Users\TimsAIO\Documents\Visual Studio 2013\Projects\MLS2015\Debug\MLS2015.exp
1>LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library
1>LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
1>FiveHC32.lib(BRUSHES.obj) : error LNK2019: unresolved external symbol __imp__AlphaBlend@44 referenced in function _HB_FUN_ABPAINT
1>FiveHC32.lib(RICHEDIT.obj) : error LNK2019: unresolved external symbol _GetFileVersionInfoSizeA@8 referenced in function _HB_FUN_REDLLVERSION
1>FiveHC32.lib(RICHEDIT.obj) : error LNK2019: unresolved external symbol _GetFileVersionInfoA@16 referenced in function _HB_FUN_REDLLVERSION
1>FiveHC32.lib(RICHEDIT.obj) : error LNK2019: unresolved external symbol _VerQueryValueA@16 referenced in function _HB_FUN_REDLLVERSION
1>FiveHC32.lib(RICHEDIT.obj) : error LNK2019: unresolved external symbol _OleUIPasteSpecialA@4 referenced in function _HB_FUN_REPASTESPECIAL
1>C:\Users\TimsAIO\Documents\Visual Studio 2013\Projects\MLS2015\Debug\MLS2015.exe : fatal error LNK1120: 5 unresolved externals

This is built using the libs you just sent me, but note the WARNING on LIBCMT is still here.

TIm
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Full working project for Visual Studio 2012 IDE
Posted: Sat Jun 07, 2014 07:49 PM

Tim,

Are you linking OleDlg.lib ?

Don't worry for these warnings:
1>LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library
1>LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library

We will find a way to avoid those reports, but they are fine.

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 3022
Joined: Fri Oct 07, 2005 01:45 PM
Re: Full working project for Visual Studio 2012 IDE
Posted: Sun Jun 08, 2014 04:50 AM

Yes, I did link in that file.

The errors seem related to RichEdit ( which I'm not using yet ) and brush painting ( which I do use ).

Tim

Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit