Need help setting up gcc as tool in textpad!!!

General questions about using TextPad

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

Post Reply
User avatar
delley
Posts: 13
Joined: Mon Jan 12, 2004 10:26 am

Need help setting up gcc as tool in textpad!!!

Post by delley »

Hi all,

I currently trying to setup gcc as a tool in textpad but I'm running into some problems...

This is what I've done so far:

1. Added gcc to my path environment

2. Add gcc as tool in textpad with following:
Command = gcc $File -o $BaseName.exe
Initial Folder = $FileDir

When I try to execute the tool i get a error box with following:

[gcc C:\dir\Hello.cpp -o Hello.exe]
The filename, directory name, or volume label syntax is incorrect

What is wrong !?! Since the path to Hello.cpp is 100% correct (I have checked and double checked) I can't see where else the issue lies.

I've also tried:
gcc $File -o $FileDir\$BaseName.exe

and

C:\cygwin\bin\gcc.exe $File -o $FileDir\$BaseName.exe

Same result...


In advance thanks,

delley
User avatar
talleyrand
Posts: 624
Joined: Mon Jul 21, 2003 6:56 pm
Location: Kansas City, MO, USA
Contact:

Re: Need help setting up gcc as tool in textpad!!!

Post by talleyrand »

delley wrote: C:\cygwin\bin\gcc.exe $File -o $FileDir\$BaseName.exe
I'm about to run out but glancing at my settings, I'd say that'd be the correct one to use. If you drop down to a DOS prompt (not the actual CygWin prompt) and execute your gcc command, does it work as intended?
I choose to fight with a sack of angry cats.
User avatar
delley
Posts: 13
Joined: Mon Jan 12, 2004 10:26 am

Post by delley »

Hi tallyrand,

Yes - I have no problems with gcc in my DOS environment.
ben_josephs
Posts: 2461
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

The

Code: Select all

$File -o $BaseName.exe
bit goes in the Parameters box. The text in the Command box is expanded and used as a filename. What you entered expands to something that isn't a filename (and it includes a colon, which is why you get that particular error message).
User avatar
delley
Posts: 13
Joined: Mon Jan 12, 2004 10:26 am

Post by delley »

:D :D :D :D :D
THANK YOU!!!
:D :D :D :D :D
User avatar
delley
Posts: 13
Joined: Mon Jan 12, 2004 10:26 am

gcc and gdb tools

Post by delley »

4 anyone interested this is my tools set-up for gcc and gdb:

GCC setup as Program
---------------------------
Command = gcc (this requires that gcc has been put into your path variable!!!)
Parameters = $File -o $BaseName.exe
Initial Folder = $FileDir
Capture output checked

GDB as DOS command
---------------------------
Parameters = gdb $BaseName.exe
Initial Folder = $FileDir


The GCC tool will compile the file into filename + .exe (ex. hello.exe)

The GDB tool will open the file hello.exe for debugging. A DOS window will pop-up.

If you want more debug information try adding -g option to gcc (this will create a bigger .exe file - so when compiling for "production" don't use the -g option).

That's it - happy programming :D
User avatar
s_reynisson
Posts: 939
Joined: Tue May 06, 2003 1:59 pm

Post by s_reynisson »

Good post, thx for taking the time to share your results!
This would be a good addition to the HOW-TOs forum.
Then I open up and see
the person fumbling here is me
a different way to be
Post Reply