Annoying issue w/ Borland C++ compiler

General questions about using TextPad

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

Post Reply
NasaGuru
Posts: 6
Joined: Thu Mar 12, 2009 11:09 pm

Annoying issue w/ Borland C++ compiler

Post by NasaGuru »

Hello! I have used TextPad for Java programming for months now, and I want to use it for C++ too. I downloaded the borland c++ compiler and did the steps outlined by TextPad to let TextPad use it. I made a new file, and typed in:

Code: Select all

#include <iostream.h>

void main()
{
cout << "SUP";
}
Just as a test. Then when I compiled it, it made me save it first so I did as HelloWorld.cpp. Then all the code turned into REALLY weird symbols, but when I copy and paste them somewhere else they come out as my code :/. Anyway, the compiler gave me a whole bunch of errors too:

Code: Select all

C:\Users\unknown\Desktop\3D Arm Program\HelloWorld.cpp:
Error E2133: Unable to execute command 'ilink32.exe'

Tool completed with exit code 1
Image
What is going on here? Any help would be great, thanks!
User avatar
helios
Posts: 710
Joined: Sun Mar 02, 2003 5:52 pm
Location: Helios Software Solutions
Contact:

Post by helios »

Please check the post-installation instructions in README.TXT, in the BCC55 installation folder. Here is the relevant section, of which 2.a. is the reason why ilink32.exe cannot be found:

Installing and running the Command Line Tools
-----------------------------------------------

1. Run freecommandlinetools.exe; choose the
drive and folder into which you want to
install the free C++Builder 5 command line
tool development system.

2. From the bin directory of your installation:
a. Add "c:\Borland\Bcc55"
to the existing path environment variable.
b. Create a bcc32.cfg file which will set
the compiler options for the Include
and Lib paths (-I and -L switches to
compiler) by adding these lines:
-I"c:\Borland\Bcc55\include"
-L"c:\Borland\Bcc55\lib"
c. Create an ilink32.cfg file which will set
the linker option for the Lib path by
adding this line:
-L"c:\Borland\Bcc55\lib"

I hope this helps.
Helios Software Solutions
NasaGuru
Posts: 6
Joined: Thu Mar 12, 2009 11:09 pm

Post by NasaGuru »

Thank you for that. Any idea at all about the weird symbols?
NasaGuru
Posts: 6
Joined: Thu Mar 12, 2009 11:09 pm

Post by NasaGuru »

cmon Im sure someone has had this problem before!
User avatar
Bob Hansen
Posts: 1516
Joined: Sun Mar 02, 2003 8:15 pm
Location: Salem, NH
Contact:

Post by Bob Hansen »

You are probably correct, someone has seen this before.

I did a search here for "strange characters" and got 973 results. I am sure you could filter this down for fewer relevant hits.
Hope this was helpful.............good luck,
Bob
NasaGuru
Posts: 6
Joined: Thu Mar 12, 2009 11:09 pm

Post by NasaGuru »

None of the results have anything to do with my issue however. Thanks anyway.
User avatar
helios
Posts: 710
Joined: Sun Mar 02, 2003 5:52 pm
Location: Helios Software Solutions
Contact:

Post by helios »

As it was saved from your "new document" class (.txt?) to a .cpp class, there may have been some character translation. You should check that the corresponding font scripts are what you intended.

From the Configure menu choose:

1. Preferences
2. "+" sign next to Document classes
3. "+" sign next to C/C++
4. Font
Helios Software Solutions
NasaGuru
Posts: 6
Joined: Thu Mar 12, 2009 11:09 pm

Post by NasaGuru »

Ah thank you that worked! Funny thing: I do modding for GTA:SA and for some reason it had GTASAWEAPONMOD as the font 0.o (those symbols, when magnified, are m16s and katanas hahaha). And of course now there is a new issue: compiling works fine, but when I try to run, it opens the command prompt and says:
' .exe' is not a recognized internal or external command, operable program or batch file
Press any key to continue...
Then when I try to run it again right after that it works. Why is this happening?
I followed the instructions from this page: http://www.comp.dit.ie/guide2cpp/TPCONFIG.HTM
What's goin on?
shaqmeister
Posts: 18
Joined: Sun Feb 15, 2009 12:50 pm

Post by shaqmeister »

NasaGuru wrote:And of course now there is a new issue: compiling works fine, but when I try to run, it opens the command prompt and says:
' .exe' is not a recognized internal or external command, operable program or batch file
Press any key to continue...
Then when I try to run it again right after that it works. Why is this happening?
I'm guessing your compilation goes something along the following lines: You have a code file $FileName and you are sending this to the compiler so that it creates an executable called $BaseName.exe (where $BaseName is $FileName stripped of the extenstion) which you then intend to run from the code file as the active document using your 'run' tool, however that is set up. That this works when you "run it again" shows that you have it set up correctly, but what's happening the first time?

Well, to get access to the $BaseName parameter so that your executable will run, the code file needs to be the 'active document' in TextPad. However, having just performed a compile immediately prior to wanting to launch, this file 'loses focus' which goes to the tool output window so, when you press run the $BaseName is lost, and as the tool output window has no name, your run tool is trying to launch "".exe, which of course it can't. After you click on the error dialog box and dismiss it, your code file becomes the active window again and so, the next time you press run ... it works.

What you need to do to avoid this little frustration is, immediately after compiling your .exe, click anywhere in your code file (or on the document tab at the top) and then select run.

It's important to understand fully how TextPad passes parameters to tools based on the name/directory/etc of the active document. As your projects get more sophisticated, this method can appear somewhat limiting - especially if you find yourself generating executables whose base name does not match the base name of any available open file; in which case, you have to think about setting up your tools to use some form of intermediary, such as a .bat file to launch your .exe.

Another issue requiring a more sophisticated solution is when your executable is built in a directory other than the current one, in which case a .bat file is practically necessary for launch. (Having said that, another trick is to create a dummy file in the target directory called MyExeName.anything and then use this as the active file to launch your .exe from using the $BaseName parameter. All interesting stuff!)

Hope this helps you to get a sense of what's going on.
Post Reply