Help setting up gpp with TextPad

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
Ellen

Help setting up gpp with TextPad

Post by Ellen »

I'm in the process of teaching myself c++ and am using TextPad to write my programs. I would like to use the Tools feature of TextPad to hook to the gpp compiler that I'm using. When I compile and link at the DOS prompt, I enter something like the following:

gpp hello.cpp -o hello.exe

Can any of you give me suggestions on how to set up TextPad to do the same? I've been able to add gpp as a tool but so far haven't been able to figure how to tell it to name the executable.

Any hints would be greatly appreciated.
Ellen

Re: Help setting up gpp with TextPad

Post by Ellen »

Okay, after poking thru the help, I figured out how to specify the executable file name. I ended up placing

$File -o $BaseName.exe

in the Parameters box for the compiler tool.

Now, the help says "If the output is from a compiler, or Grep type of program, it can be used to jump directly to the corresponding source line using left double-click." It also gives several examples of Expressions to use with various compilers that I presume make the double click business work. I used the GNU C++ compiler example as I am using the DJGPP DOS port of the GNU compiler. However, double clicking on error messages does not take me to the line number specified by the error message.

Here is a sample program with several errors:

#include <iostrem.h>

int main()
{
cout << "Hello world!\n\";
return 0;
{


Here are the compiler error messages from the tool window:

C:\DJGPP\MYPROGS\hello.cpp:1: iostrem.h: No such file or directory (ENOENT)
C:\DJGPP\MYPROGS\hello.cpp:5: unterminated string or character constant
C:\DJGPP\MYPROGS\hello.cpp:5: possible real start of unterminated constant

Tool completed with exit code 1


Any suggestions on the Expression I should be using?
Andreas

Re: Help setting up gpp with TextPad

Post by Andreas »

Use
\(.:[^:]+\):\([0-9]+\):

Register 1 for file, 2 for line
Ellen

Re: Help setting up gpp with TextPad

Post by Ellen »

Thanks Andreas, that was just the ticket!
Post Reply