With a document type defined all that remains is to configure in the third party tool. This can be done as following:
- Use the Workspace Close menu to close any open workspace
- Select the Workspace Options menu
- Change to the Compiler section
- Blank out the Command Line compiler string
- Apply the changes and close the workspace dialog
- Open the file to be compiled
- Use the Options, Properties menu to bring up the document type for the file
- Change to the Compiler panel
- In the Command Line entry field supply the command to compile the file
- Apply the changes and close the dialog
What are the Regular Expressions?
The information, warning, error, file and line number regular exprssions found in the Compiler section are search patterns that can be used to define what lines of the compiler output are information, warnings and errors and how to find the file and line number in a line of compiler output. If you are not sure what to enter here, just leave them all blank.
Normally you do not need to supply these strings as the default regular exprssions work in most cases. But if you find the compiler output is not coloring the errors in red or a mouse double click on the compiler output is not loading the correct file at the correct line number then these regular expressions will need to be defined for your compiler.
But what goes into the command line entry field?
The command entry field should contain the command line normally used to compile a file called $fn, including all compiler command line options.
For example:
- MSVC++ would use: cl.exe -c "$fn"
- Borland C++ would use: bcc32.exe -c "$fn"
Code: Select all
bcc32.exe +c:\projects\my_options.cfg $fn
Code: Select all
-c -w
/Ic:\bc5\include;
Code: Select all
cl.exe @c:\projects\my_options.cfg $fn
Notice how the "$fn" is enclosed in quotes. This is required to cater for the situation where the file being compiled has a space in it's name, for example C:\My Document\test.cpp.
Also notice how the command lines do not include the install directory of the compiler. This means the compile will only work if the compiler installation directory has been added to the PATH environment variable. This can be easily tested as follows:
- Tools, DOS Shell menu
- At the command prompt just type in the command line for example bcc32.exe -c test.cpp.
then the compiler installation directory is not defined in the PATH environment variable. In this case the compiler location will need to be fully defined. For example the Borland C++ entry could been redefined to be c:\bc55\bcc32.exe -c "$fn". You should repeat the DOS shell test above to make sure the fully qualified path is also correct.The name specified is not recognized as an internal or external command, operable program or batch file.
Alternatively you could add the compiler installation directory to the PATH environment variable. Here is a link that gives instructions on how modify the PATH environment variable: viewtopic.php?t=6176
Alternatively the compiler installation directory can be added to the PATH environment variable. To do this on Windows NT, XP use the Start Button, select the Settings, Control Panel menu and use the System icon to edit the environment variables.
With the compiler correctly configured you are ready to run the compiler. Just open a file to be compiled and hit the compile button on the toolbar. The results of the compilation will be displayed in the Compiler Output window.