Detailed guide to use the Visual Studio 2013 IDE with FWH
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Detailed guide to use the Visual Studio 2013 IDE with FWH
1. Create a new project from Visual Studio:
2. Select empty:
3. Click on "Finish button"
4. You will get a project like this one:
5. Right click on "Source files" and select "Add an existing item" and start adding your PRG files:
6. Your PRGs will be shown in the "Solution Explorer":
7. Right click on the PRG file and select these options and click on "OK":
8. Right click again on the PRG file and these time fill these options this way and click "OK":
Copy the bold text from here:
c:\harbour\bin\harbour %(FullPath) /n /ic:\harbour\include /ic:\fwh\include
.\%(Filename).c
Warning: For Visual Studio Community 2015 use:
c:\harbour\bin\harbour "%(FullPath)" /n /ic:\harbour\include /ic:\fwh\include
If you are using an existing PRG located at a certain folder then use:
c:\harbour\bin\harbour "%(FullPath)" /o%(RelativeDir)%(Filename).c /n /ic:\harbour\include /ic:\fwh\include
%(RelativeDir)\%(Filename).c
9. At this point you can right click on the PRG file on the "Solution Explorer" and select "compile".
Alternatively you can already click at the top on Run ("Local Windows Debugger" the button with the "green play" bitmap) and it will get compiled.
10. Now you have to add the C file that Harbour generated to the project. Again Right click on "Source files" and select "Add an existing item" and
choose your filename.c, in this example tutor01.c
The "Solution Explorer" will look like this:
11. Right click on the C file and set this value and click on "OK":
Copy the bold text from here:
c:\harbour\include;%(AdditionalIncludeDirectories)
12. Again right click on the C file, select compile and it should properly compile it:
13. Now if you click at the top on Run ("Local Windows Debugger" the button with the "green play" bitmap), Visual Studio will try to build your app but the libraries have not been added yet, so you will get this:
14. Now we are going to add the libraries, but to keep our project well structured, right click on the tutor01 in the "Solution Explorer", just below "Solution 'tutor01' (1 project) and add "New filter" (it creates a folder) and rename it as "Libraries". It will look like this:
15. Right click on the Libraries folder and select "Add an existing item" and select FiveH32.lib, same for FiveHC32.lib:
16. Now lets add the Harbour for Visual Studio 2013 libraries. You can add one by one, or simply select all of them, but VERY IMPORTANT some of them have to be removed: All that end with ..._dll.lib in their names.
You have to remove: hbnortl.lib, hbnulrdd.lib, harbour-32.lib, hbvmmt.lib, hbmaindllp.lib, hbmainstd.lib, hbmaindllp.lib. Right click on their names and delete them (you will go faster if you delete all ..._dll.lib files before adding all the libraries):
Now if you try to build your app ("Local Windows Debugger" the button with the "green play" bitmap), you will find that some Windows libraries are still missing, so we are going to add them too: OleDlg.lib, msimg32.lib, version.lib, ComCtl32.lib
look for them at c:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Lib\
Add them as you did before adding FWH libraries:
To remove the linker warnings add this options:
/NODEFAULTLIB:MSVCRT /NODEFAULTLIB:LIBCMT
17. Now build your app and yes!!!, there it is!!!
2. Select empty:
3. Click on "Finish button"
4. You will get a project like this one:
5. Right click on "Source files" and select "Add an existing item" and start adding your PRG files:
6. Your PRGs will be shown in the "Solution Explorer":
7. Right click on the PRG file and select these options and click on "OK":
8. Right click again on the PRG file and these time fill these options this way and click "OK":
Copy the bold text from here:
c:\harbour\bin\harbour %(FullPath) /n /ic:\harbour\include /ic:\fwh\include
.\%(Filename).c
Warning: For Visual Studio Community 2015 use:
c:\harbour\bin\harbour "%(FullPath)" /n /ic:\harbour\include /ic:\fwh\include
If you are using an existing PRG located at a certain folder then use:
c:\harbour\bin\harbour "%(FullPath)" /o%(RelativeDir)%(Filename).c /n /ic:\harbour\include /ic:\fwh\include
%(RelativeDir)\%(Filename).c
9. At this point you can right click on the PRG file on the "Solution Explorer" and select "compile".
Alternatively you can already click at the top on Run ("Local Windows Debugger" the button with the "green play" bitmap) and it will get compiled.
10. Now you have to add the C file that Harbour generated to the project. Again Right click on "Source files" and select "Add an existing item" and
choose your filename.c, in this example tutor01.c
The "Solution Explorer" will look like this:
11. Right click on the C file and set this value and click on "OK":
Copy the bold text from here:
c:\harbour\include;%(AdditionalIncludeDirectories)
12. Again right click on the C file, select compile and it should properly compile it:
13. Now if you click at the top on Run ("Local Windows Debugger" the button with the "green play" bitmap), Visual Studio will try to build your app but the libraries have not been added yet, so you will get this:
14. Now we are going to add the libraries, but to keep our project well structured, right click on the tutor01 in the "Solution Explorer", just below "Solution 'tutor01' (1 project) and add "New filter" (it creates a folder) and rename it as "Libraries". It will look like this:
15. Right click on the Libraries folder and select "Add an existing item" and select FiveH32.lib, same for FiveHC32.lib:
16. Now lets add the Harbour for Visual Studio 2013 libraries. You can add one by one, or simply select all of them, but VERY IMPORTANT some of them have to be removed: All that end with ..._dll.lib in their names.
You have to remove: hbnortl.lib, hbnulrdd.lib, harbour-32.lib, hbvmmt.lib, hbmaindllp.lib, hbmainstd.lib, hbmaindllp.lib. Right click on their names and delete them (you will go faster if you delete all ..._dll.lib files before adding all the libraries):
Now if you try to build your app ("Local Windows Debugger" the button with the "green play" bitmap), you will find that some Windows libraries are still missing, so we are going to add them too: OleDlg.lib, msimg32.lib, version.lib, ComCtl32.lib
look for them at c:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Lib\
Add them as you did before adding FWH libraries:
To remove the linker warnings add this options:
/NODEFAULTLIB:MSVCRT /NODEFAULTLIB:LIBCMT
17. Now build your app and yes!!!, there it is!!!
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: Detailed guide to use the Visual Studio 2013 IDE with FWH
To implement syntax highlighting in your PRG sources, please follow this topic:
http://forums.fivetechsupport.com/viewt ... =3&t=28600
http://forums.fivetechsupport.com/viewt ... =3&t=28600
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: Detailed guide to use the Visual Studio 2013 IDE with FWH
Now, if you want to skip all the previous and tedious steps, simply download the project from here and open it from your Visual Studio:
https://bitbucket.org/fivetech/visual-s ... roject.zip
https://bitbucket.org/fivetech/visual-s ... roject.zip
Re: Detailed guide to use the Visual Studio 2013 IDE with FWH
Antonio
IS this work with xHarbour too ?
I have try wiht Harbour and xHarbour
In both cases error
C:\fwh\Harbour\lib\bz2.lib : fatal error LNK1136: invalid or corrupt file
That for all libs
Some solution ?
Best regards,
IS this work with xHarbour too ?
I have try wiht Harbour and xHarbour
In both cases error
C:\fwh\Harbour\lib\bz2.lib : fatal error LNK1136: invalid or corrupt file
That for all libs
Some solution ?
Best regards,
Re: Detailed guide to use the Visual Studio 2013 IDE with FWH
You've built Harbour or xHarbour to Visual Studio 2013?
C. Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
Si alguien te dice que algo no se puede hacer, recuerda que esta hablando de sus limitaciones, no de las tuyas.
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
Si alguien te dice que algo no se puede hacer, recuerda que esta hablando de sus limitaciones, no de las tuyas.
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: Detailed guide to use the Visual Studio 2013 IDE with FWH
Avista,
Is bz2.lib for Microsoft ?
You can not use Borland's libs with Visual Studio.
Is bz2.lib for Microsoft ?
You can not use Borland's libs with Visual Studio.
Re: Detailed guide to use the Visual Studio 2013 IDE with FWH
Antonio,
Sorry my bad.
I installed harbour for vs: harbour_3.2_32bits_MSVC2013_20142906 and maded everything like in your sample
I get this error:
1>------ Build started: Project: tutor01, Configuration: Debug Win32 ------
1>FiveH32.lib(ERRSYSW.obj) : error LNK2005: _HB_FUN_ERRORSYS already defined in hbrtl.lib(errsys.obj)
1>FiveH32.lib(ERRSYSW.obj) : error LNK2005: _HB_FUN_HB_GTSYS already defined in hbrtl.lib(gtsys.obj)
1> Creating library C:\myapp\tutor01\Debug\tutor01.lib and object C:\myapp\tutor01\Debug\tutor01.exp
1>LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library
1>C:\myapp\tutor01\Debug\tutor01.exe : fatal error LNK1169: one or more multiply defined symbols found
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Regards,
Sorry my bad.
I installed harbour for vs: harbour_3.2_32bits_MSVC2013_20142906 and maded everything like in your sample
I get this error:
1>------ Build started: Project: tutor01, Configuration: Debug Win32 ------
1>FiveH32.lib(ERRSYSW.obj) : error LNK2005: _HB_FUN_ERRORSYS already defined in hbrtl.lib(errsys.obj)
1>FiveH32.lib(ERRSYSW.obj) : error LNK2005: _HB_FUN_HB_GTSYS already defined in hbrtl.lib(gtsys.obj)
1> Creating library C:\myapp\tutor01\Debug\tutor01.lib and object C:\myapp\tutor01\Debug\tutor01.exp
1>LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library
1>C:\myapp\tutor01\Debug\tutor01.exe : fatal error LNK1169: one or more multiply defined symbols found
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Regards,
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: Detailed guide to use the Visual Studio 2013 IDE with FWH
Please go to samples folder and try this:
buildh32 tutor02
if it works, then please review buildh32.bat
buildh32 tutor02
if it works, then please review buildh32.bat
Re: Detailed guide to use the Visual Studio 2013 IDE with FWH
Intresting project for use Visual Studio Ide but is/will possible Create a Language Compiler for habour in the .NET Framework?
http://msdn.microsoft.com/en-us/magazine/cc136756.aspx
http://msdn.microsoft.com/en-us/magazine/cc136756.aspx
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact: