Page 1 of 1

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

Posted: Mon Jan 12, 2004 10:38 am
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

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

Posted: Mon Jan 12, 2004 11:06 am
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?

Posted: Mon Jan 12, 2004 11:09 am
by delley
Hi tallyrand,

Yes - I have no problems with gcc in my DOS environment.

Posted: Mon Jan 12, 2004 11:40 am
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).

Posted: Mon Jan 12, 2004 12:31 pm
by delley
:D :D :D :D :D
THANK YOU!!!
:D :D :D :D :D

gcc and gdb tools

Posted: Fri Jan 16, 2004 11:05 am
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

Posted: Fri Jan 16, 2004 2:36 pm
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.