Using VS with EPICS
Some of the EPICS modules are written in C++ and so it makes sense to use Visual Studio to edit these. To correctly set up Visual Studio to edit a project you should do the following:
Start an EPICS terminal e.g.
C:\Instrument\Apps\epics\EPICSTerm.batStart Visual Studio in this EPICS terminal by running
devenvGo to File -> New -> Project from Existing Code
Select C++ and press Next
Select the top directory for the project file location e.g.
C:\Instrument\Apps\epics\support\sampleChanger\masterGive the project a sensible name and press Next
Select
Use external build systemand press NextAs the build command line type
makeand as the clean command typemake clean uninstalland press Finish
The code will now be in Visual Studio and you should be able to Build it from the Build menu at the top. To point Visual Studio at the dependencies of the code do the following:
Open the RELEASE file for the project e.g.
C:\Instrument\Apps\epics\support\sampleChanger\master\configure\RELEASEIn VS right click on the project and select properties -> VC++ Directories
In the include directories add an entry for each line in the RELEASE file (apart from the optional extras ones) that points to the include directory of that submodule (remembering that
$(SUPPORT)isC:\Instrument\apps\epics\support) e.g. you will addC:\Instrument\Apps\epics\support\asyn\master\include(note that in reality a lot of these includes will not be needed for the C++ code, the following will definitely not:AUTOSAVE,CAPUTLOG,DEVIOCSTATS,ICPCONFIG,MYSQL,SQLITE,PVDUMP)Add
C:\Instrument\Apps\epics\base\includeto the include directories
Visual Studio should now pick up all the dependencies and so give you intellisense/autocomplete etc.