Page 1 of 1
How do I set up TextPad4 to compile and run C++ programs
Posted: Wed Aug 28, 2002 11:03 pm
by Eric
I currently use Visual C++ 6.0 but want to compile and run my code in TextPad. I have searched the net but found nothing. If someone could please send or reply it would be greatly appreciated.
Thanks
Re: How do I set up TextPad4 to compile and run C++ programs
Posted: Thu Aug 29, 2002 12:21 am
by Josh
Re: How do I set up TextPad4 to compile and run C++ programs
Posted: Thu Aug 29, 2002 1:41 am
by Eric
Not sure what your telling me look at on the link as it does not explain anything. Also in the tips there is nothing regarding running C++ programs in TextPad.
Oh might want to get that cough looked at.
Re: How do I set up TextPad4 to compile and run C++ programs
Posted: Thu Aug 29, 2002 4:42 pm
by Josh
You want to run C++, as I understand it C is a subset of C++ so if I can compile C programs with Borland's free compiler, then you should be able to compile C++ in the Tips area it talks about how to configure TextPad to work with Borland's free compiler and debugger.
At this link:
http://www.textpad.com/support/tips/borlandtip.html
It is described as:
Getting Started with Borland C++ Free Command Line Tools and Turbo Debugger
So basically yes, that tip talks about C++ in TextPad.
Unless what you want to do is not realted to compiling and editing code in TextPad.
Re: How do I set up TextPad4 to compile and run C++ programs
Posted: Mon Sep 09, 2002 7:47 pm
by S Ghosh
Open a command prompt.
In Visual C++ installation, execute vc6\bin\vcvars32.bat to set up the environment.
launch textpad from the command prompt after the environment is setup.
Add a Tool- to vc6\bin\cl.exe
Parameters: $FileName
I haven't figured out if it is possible to put the variables in startup and still have textpad respect them.
-sg
Re: How do I set up TextPad4 to compile and run C++ programs
Posted: Tue Oct 15, 2002 7:01 pm
by chuck nelson
Trying also to get vc++6.0 to compile from within Textpad.
Ran the batch file as you recommended
Have the preferences/tools set to bin/cl.exe, etc.
In textpad, got the following error msg when I selected tools, Compile C++
Tool completed with exit code 128
Are there other parms needed? Any advice appreciated. Thanks
Re: How do I set up TextPad4 to compile and run C++ programs
Posted: Tue Oct 15, 2002 7:04 pm
by chuck nelson
Did you find a solution that works?
Mine comes back with error 128.
Any suggestions? Thanks!
Re: How do I set up TextPad4 to compile and run C++ programs
Posted: Mon Dec 16, 2002 6:23 pm
by Thomas Henry
After twelve hours of non-stop screwing around, I finally was able to pull together an answer to the above. I hope you find this helpful. (Now if only someone would help me with my Netscape problem!) Some of the longer pathnames and parameters might be split below, so read carefully.
These notes explain how to set up the Visual C++ 6.0 compiler and linker to perform from within TextPad. You will end up with four new tools: Compile C++, Link C++, Run C++ and Capture C++. The last two give you the option to run the resulting C++ program normally, as a console program, or to capture its output to a results file.
STEP A: SET UP THE ENVIRONMENT VARIABLES
First, you need to make sure certain environment variables are set properly. To automate this, look for the batch file called Vcvars32.bat. Here's where to find it in a typical setup:
C:\Program Files\Microsoft Visual Studio\VC98\Bin\Vcvars32.bat
Copy and paste its contents to your autoexec.bat file (which lives in the root directory of your hard drive) so that its lines are run every time you turn on the computer. Two things to note:
1. I already had a path command in my autoexec.bat file (for the Free Pascal compiler); I had to change it so that the new paths from the Vcvars32.bat file were appended to what was already in place.
2. You might get an "out of environment space" error message (like I did) when this is run. The solution is to add the following line to your config.sys file (which also lives in the root directory of the hard drive):
SHELL=C:\COMMAND.COM /E:1024 /P
This bumps the environment space up to 1024 bytes.
STEP B: CREATE THE COMPILER TOOL
From the Configure/Preferences/Tools menu, create a new Program tool and name it Compile C++.
Command: C:\Program Files\Microsoft Visual Studio\VC98\Bin\Cl.exe
Parameters: -I"C:\Program Files\Microsoft Visual Studio\VC98\Include" -EHsc -c $File
Initial Folder: $FileDir
Regular Expression: ^\([^(]+\)(\([0-9]+\))
File: 1
Line: 2
Column: leave blank
Capture Output and Sound Alert are checked; all others unchecked.
STEP C: CREATE THE LINKER TOOL
From the Configure/Preferences/Tools menu, create a new Program tool and name it Link C++.
Command: C:\Program Files\Microsoft Visual Studio\VC98\Bin\Link.exe
Parameters: -LIBPATH:"C:\Program Files\Microsoft Visual Studio\VC98\Lib" $BaseName.obj
Initial Folder: $FileDir
Regular Expression: ^\([^(]+\)(\([0-9]+\)):
File: 1
Line: 2
Column: leave blank
Capture Output and Sound Alert are checked; all others unchecked.
STEP D: CREATE THE RUN TOOL
From the Configure/Preferences/Tools menu, create a new DOS Command tool and name it Run C++.
Command: (grayed out)
Parameters: $BaseName.exe
Initial Folder: $FileDir
Regular Expression: (grayed out)
File: (grayed out)
Line: (grayed out)
Column: (grayed out)
All boxes are unchecked.
STEP E: CREATE THE CAPTURE TOOL
From the Configure/Preferences/Tools menu, create a new Program tool and name it Capture C++.
Command: C:\WINDOWS\Command.com
Parameters: /C $BaseName.exe
Initial Folder: $FileDir
Regular Expression: ^\([^(]+\)(\([0-9]+\)):
File: 1
Line: 2
Column: leave blank
Capture Output and Sound Alert are checked; all others unchecked.
STEP F: TO USE THE SYSTEM
Create a .cpp source code file. To compile it, choose the Compile C++ tool. After compiling, make sure you are back in the source code window and not the results window. Then link with the Link C++ tool. Again, make sure you are in the source code window and choose either Run C++ to run as a normal DOS program or Capture C++ to capture any output to the results window.