Developing a traditional Synergy application

This topic includes the following sections:

 

Synergy DBL Integration for Visual Studio (SDI) includes support for traditional Synergy development. This means you can use Visual Studio to develop traditional Synergy libraries and executables for Windows, Linux, and OpenVMS desktop and server systems. (For information on limitations to Linux and OpenVMS development, see Development steps for traditional Synergy below.)

1. Using Visual Studio and SDI to develop traditional Synergy executables and libraries.

Using Visual Studio to develop traditional Synergy executables and libraries

Note the following:

For information on moving existing traditional Synergy code into Visual Studio, see Migrating Traditional Synergy Projects to Visual Studio in the Resource Center on the Synergex website.

Development steps for traditional Synergy

The following steps outline the process for creating projects for a traditional Synergy application. Note the following:

Most of the following steps are for Visual Studio procedures, so see Visual Studio documentation for more information.

1. Set options for your Visual Studio environment. For example, you can control the behavior of the Visual Studio code editor (indentation, tab size, etc.) and the way IntelliSense works for Synergy DBL files. See Options for Synergy/DE projects for more information.
2. Use the following Synergy project templates in Visual Studio to create a project for each program and library in your application, and optionally create a project for each repository used by your application. Use these same templates for Windows, Linux, and OpenVMS development (e.g., use the Executable Library template for code that will become a shared library on OpenVMS). See Synergy/DE project templates for more information.

For example, to create a traditional Synergy program with a single .dbr file, select File > New Project. Then select Synergy/DE from the Installed Templates area of the New Project dialog, and select “Traditional Application (DBR)” from the list of project types. You’ll then need to set a few options for the project (name, location, and so forth) in the New Project dialog.

See Synergy files, projects, and solutions for more information on projects and solutions, and note the following:

3. Add code and other items to your projects. For example, you can add a new code file by right-clicking the project node in Solution Explorer and selecting Add > New Item from the context menu. Note the following:
4. Add references to other projects or files as necessary. References enable a project to use other libraries, repositories, and external files. Referencing a library is equivalent to linking to a library (i.e., adding a library to a dblink command) when developing outside of Visual Studio. You can add a reference by right-clicking the Reference node in Solution Explorer and selecting Add Reference from the context menu. Note the following:
5. Set environment variables needed for developing and running the application. See Environment variables and Visual Studio development for information on where you can set environment variables, when they are used, and precedence for different locations.
6. Set project properties, which include settings for building (compiling).
7. Build the solution or an individual project by using a build or rebuild command in Visual Studio. For example, you can rebuild the entire solution by selecting Build > Rebuild Solution from the Visual Studio menu. To build or rebuild (or clean) a project without affecting other projects in the solution (even referenced projects), use a Project Only menu entry — e.g., Build > Project Only > Rebuild Only Project. See SDI features for information on these menu entries.
8. Debug the project or solution. To debug a project or solution, it must be built in Debug mode. See Debugging traditional Synergy with Visual Studio for more information, and note the following:

Adding a platform configuration for Linux or OpenVMS

If you have an existing project you want to port to Linux or OpenVMS, you can use the Visual Studio Configuration Manager to create a configuration that targets Linux or OpenVMS.

1. Open Configuration Manager (e.g., select Build > Configuration Manager from the Visual Studio menu) and select New from the “Active solution platform” drop-down list.
2. In the New Solution Platform window, select linux32, linux64, or vms in the "Type or select the new platform" field, and select x64 or x86 for the "Copy settings from" option.

2. Selecting a platform for a new configuration.

Selecting a platform for a new configuration

3. Make sure the “Create new project platforms” option is selected, and click OK. Then, in the “Project contexts…” table, select the new platform for each project in your solution (see figure 3).

3. Selecting the new configuration for a project.

Selecting the new configuration for a project

You can now select the new solution platform when you build the solution and when you set options in Project Designer (e.g., on the Build page). For the example illustrated in figure 3, the new solution platform (linux32) would be available when building Application6 in Debug mode (i.e., when the Debug configuration is selected) and when setting options for the Debug configuration in Project Designer.

Common project settings

Visual Studio’s Project Designer enables you to set project-level settings (i.e., project properties), and it enables you to set environment variables. The following are some of the most commonly used features in Project Designer. Other pages and settings are available for Synergy projects. See Synergy/DE project properties for more information.

Application page

The Application page enables you to configure various application-level settings for a project.

Note that if your code files have .INCLUDE statements that don’t specify a path (e.g., .INCLUDE myfile.def), you’ll need to set the "Working directory" option to the directory with the included files (e.g., the directory with myfile.def).

See Application page, Project Designer (traditional Synergy) for more information.

Build page

The Build page enables you to configure build settings for a project.

Although you can use Visual Studio to build files for Linux, you can’t run Linux applications on Windows because of path differences. So for Linux, set the output path for the project to a network share on a Linux machine. This will enable you to build the project in Visual Studio and then run and debug the program on the Linux machine.

See Build page, Project Designer for more information.

Compile page

The Compile page enables you to set compiler options for a project. See Compile page, Project Designer (traditional Synergy) for more information.

Debug page

The Debug page enables you to set debugging behavior for a project. See Debug page, Project Designer for more information.

Environment Variables page

The Environment Variables page enables you to set project-specific environment variables that are used at build time. Locations specified by environment variables set here are used to populate the Synergy tab of the Reference Manager for Visual Studio. See Environment Variables page, Project Designer.

Common Properties page

The Common Properties page enables you to set environment variables that are used at build time and that can be applied to any project in the solution. Locations specified by environment variables set here are used to populate the Synergy tab of the Reference Manager for Visual Studio. See Common Properties page, Project Designer.