Project Settings for Visual C++
The following project settings enable application development in Microsoft® Visual C++®. The techniques discussed apply to any integrated development environment. For more information about a specific manufacturer's compiler and integrated development environment, see the compiler documentation.
You set up ESQL/C projects in the same way you set up projects that include any additional component libraries.
To add the needed directory names to Visual C++ environment settings
- On the Tools menu, click Options.
- Click the Directories tab.
- In the Show directories for box, click Include files.
- Enter the path for Microsoft® SQL Server™ 2000 development include files, typically x:\Program Files\Microsoft SQL Server\80\Tools\DevTools\Include.
- In the Show directories for box, click Library files.
- Enter the path for SQL Server development library files, typically x:\Program Files\Microsoft SQL Server\80\Tools\DevTools\Include.
- In the Show directories for box, click Executable files.
- Enter the path for SQL Server development binary executable files, typically C:\Program Files\Microsoft SQL Server\80\Tools\Binn.
You must change the executable directories list so Visual C++ will correctly locate the nsqlprep executable file.
The following illustration shows adding the path for header files to the Visual C++ include file path list.
As you create each ESQL/C source file, you must indicate the preprocessor steps necessary to generate the appropriate C source for compilation. Depending on the version of Visual C++, use the Build menu or the Project menu to locate the compilation settings for the project.
Compilation settings can be set at the source-file level, and the custom build steps for your ESQL/C source files are set at this level as well.
To add custom build steps for an ESQL/C source file
- On either the Project menu (Visual C++ 5.0) or the Build menu (Visual C++ 4.x), click Settings.
- Click the ESQL/C source file in the project's file list. In Visual C++ 5.0 a single instance of the file appears in the project's list. You can click All configurations in the Settings for box to set custom build commands for both debug and release versions of your project. In Visual C++ 4.x, you can expand the file list and select each occurrence of the ESQL/C source file to set the custom build commands for all project configurations.
- Click the Custom Build tab.
- In the Build commands box, enter the nsqlprep command. You can use the $(InputName) macro to specify the file.
- In the Output file(s) box, specify the name of the output file. The output file is a C source file. You can use the $(InputName) macro to specify the file.
The illustration below shows custom build settings for an ESQL/C source file.
After you've successfully preprocessed the ESQL/C source files, you can add the generated C source to your project.