Page 1 of 6

MSVS 2012

PostPosted: Wed May 08, 2013 12:42 pm
by cdmmaui
Dear Antonio,

Is it possible to compile and link FWH/Harbour applications with MSVS 2012? I have purchased MSVS 2012 Professional and would like to port an application over.

Sincerely,

Re: MSVS 2012

PostPosted: Wed May 08, 2013 3:32 pm
by TimStone
Right now I'm doing it with 2010 but will work on using 2012 soon. I tried earlier this week but had problems ... but that led to other issues that needed to be resolved. I've now done that and will work on 2012, likely on Monday. I'm sure its just a matter of libraries that need to be updated.

Tim

Re: MSVS 2012

PostPosted: Wed May 08, 2013 6:45 pm
by Antonio Linares
Darrell,

I have not tried to build Harbour and FWH with VS2012 yet, but today I will try it.

There should be no problems, and will comment the results here asap.

Re: MSVS 2012

PostPosted: Wed May 08, 2013 9:32 pm
by Antonio Linares
Harbour has been properly built with VS2012 :-)

Anyhow, this is the first error that I have faced:
http://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/7abc7f63-c3a6-4a55-babc-6914870d4959/

This is also to be resolved: (several functions starting with this name)
unresolved external symbol __libm_sse2_...

Re: MSVS 2012

PostPosted: Wed May 08, 2013 10:25 pm
by Antonio Linares
This seems related:

http://msdn.microsoft.com/en-us/library/bb531344.aspx

The default architecture for x86 builds is changed to SSE2; therefore, the compiler may emit SSE instructions, and will use the XMM registers to perform floating-point calculations. If you want to revert to previous behavior, then use the /arch:IA32 compiler flag to specify the architecture as IA32.

Re: MSVS 2012

PostPosted: Thu May 09, 2013 11:24 pm
by ADutheil
I installed MSVS 2012 Express and noticed it broke my 2010 installation. I could not build anymore any of my apps. The error message was:

LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt

The workaroud was to copy cvtres.exe from 2012 \VC\bin to 2010 bin directory.

Re: MSVS 2012

PostPosted: Fri May 10, 2013 12:40 pm
by cdmmaui
Thank you Antonio, I will start converting to MSVS 2012

Re: MSVS 2012

PostPosted: Fri May 10, 2013 1:55 pm
by Antonio Linares
Darrell,

My advice is to keep waiting. as nobody have answered yet in the Harbour devel list:
https://groups.google.com/forum/?fromgroups=#!topic/harbour-devel/rYY1eYS3hfA

and I have not found yet a solution for the sse2 issue

If you want to start using Visual Studio, my advice is to install Visual Studio 2010 Express (it is free) and start working with it. When we solve these issues, then you will be ready (and used) to migrate to your new VS2012.

Re: MSVS 2012

PostPosted: Fri May 10, 2013 4:59 pm
by Richard Chidiak
Darrell

Antonio's advice is the good one

I have converted all my legacy application from xharbour/bcc 5.82 to harbour/msvc 2010 , wasn't easy but Antonio's help made it possible.

it has gone into production 10 days ago, and so far so good.

MSVC 2010 is ok , we are using it.

As far as i know no one in this forum has real experience in 2012, so let us make it step by step.

I plan to try msvc 2012 in the future, but it is not a priority for the moment. Msvc 2010 makes the job.

Hth

Richard

Re: MSVS 2012

PostPosted: Sat May 11, 2013 1:11 am
by TimStone
Richard,

I will be curious if your calendar is stable. I got mine working, but now it throws an error and does some damage to my database which requires I replace it with a backup. Its not just on my machine ... it happened on a test machine.

Sometimes it works, and sometimes it starts throwing errors.

Tim

Re: MSVS 2012

PostPosted: Sat May 11, 2013 3:43 am
by Richard Chidiak
Tim

I had errors on my calendar especially on exit

Now it is ok

No dammage on the database however

Richard

Re: MSVS 2012

PostPosted: Sat May 11, 2013 10:07 am
by Antonio Linares
Richard, Tim,

I think we could go one step further and build our apps from the Visual Studio IDE, in fact I already do that on my FiveWin for WinRT development (in my case it works fine as I build Harbour myself, with my own makefile).

The main advantage of this, is that we can use the Visual Studio Debugger which it is very good :-)

Re: MSVS 2012

PostPosted: Sat May 11, 2013 10:48 am
by Richard Chidiak
Antonio

It is a good idea moving to the ide.

One imortant thing to mention, all problems i had were more related to Harbour than Msvc. I had exactly the same problems with Harbour/Bcc than Harbour/Msvc. probably Xharbour is more permissive in different ways, it is a fact , my application was rock solid. I faced strange problems going to Harbour.

1. Ini file nor found by Harbour, no problem with Xharbour, the file was present .... Solution delete the file and create it again !
2. Ole complete different syntax.
3. Mdi windows exit ... completely different from Harbour to Xharbour
4. Calling a dialog twice in a mdi window crashed the application... had to modify the class and the way to end the window to have it working properly.
5. Still have a problem with a dialog (settings) in a mdi window, closing the dialog, window = OK, come back again enter dialog = crash at validate.... This is the ennoying part related to Harbour, i am not sure the ide's debugger will help us with it.
6. Resources : static texts that are > 256 chars are truncated to 256 , Bcc does not have this limitation

As per Tim's problems with Database crashing in the component , better check if odbf is Ok with Harbour or if some extra syntax or parameter is needed. The problem here is neither codejock or Msvc but Harbour. I use dbfcdx and fully tested this part with customers, OK. Maybe some friends using Harbour and Odbf can comment on this one, it can help Tim.

As a conclusion moving from xharbour to harbour is probably the way to go but we need to asure 100% compatibility. Lots of tests are needed. Not as simple as we could imagine.

My 2 cents.

Antonio how to build Harbour from the Ide ?

Richard

Re: MSVS 2012

PostPosted: Sat May 11, 2013 1:36 pm
by norberto
HI, i have MSVC 2012 Pro/ultimate, can i use to compile my fwh appl? thanks

Re: MSVS 2012

PostPosted: Sat May 11, 2013 2:05 pm
by Antonio Linares
Richard, Norberto,

Here you have some explanations about how to build Harbour for VS2012 with the purpose of using it from the Visual Studio IDE itself:

https://code.google.com/p/fivewinrt/wiki/How_to_build_Harbour_for_WinRT

It is not finished yet (for Harbour on WinRT is fine). So please be aware that trying this is just an exercise at your own risk.
You will not get a functional Harbour (yet)