🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

I am a newbie. Please help me.

Started by
6 comments, last by mx1 22 years, 6 months ago
I just recently got Borlands free demo edition of C++. I have been playing around with it for a couple days and reading a few tutorials. I can''t seem to figure out exactly how to compile. I write something, then click compile and it does compile but it doesn''t generate an executable file. I am very new to all this with no prior experience. I read somewhere that you have to do it with the command line or something,but im not sure how. Can someone please tell me exactly how to do this?
Advertisement
Well, I have Microsoft Visual C++, but in that, clicking on compile JUST compiles, it doesn''t run the program. To run, you click on some button that says "run" or something.
You need to look for something labelled "Build." "Compile" usually just compiles the current file (useful way to check for errors in the current module); "Build" compiles any modified sources in the project and links them together to yield the output file (be that executable, static/dynamic library, etc); "Run" launches the executable from within the development environment.

Look for your compiler''s documentation. That''s what it''s there for.
A compiler compiles the code from source to objective code and a linker takes the objective code and turns it into an executable.

IF you are using Borland's free command line compiler(v5.5), then you need to set up the paths for the includes and .lib files before attempting to compile your code.

i think the compiler was bcc? and the linker was tlink??
I'm rusty and have not been coding for a few months.

if you are pulling your hair out, then try a different C++ compiler, such as www.bloodshed.net (DevC). Don't worry.. it's free.

BTW guys the free Borland compiler is just the command line one.. it does not have a IDE

Edited by - GoofProg on December 3, 2001 12:20:48 PM

The nightmare travels across the cosmos with his burning mane. The trail of ash that is produced.

?Have a nice day!?

Ya definitely man. Try to pick up a copy of Microsoft Visual Studio / Visual C++ 6.0. We are using Borland at school and I do not like it at all. MSVS 6.0 is sOoooooo much better.

RoB~
you can download VIDE for free at http://www.objectcentral.com... it can use bcc32, or mingw (sp?), and possibly some other compiler (i dunno because i use the borland one).

--- krez (krezisback@aol.com)
--- krez ([email="krez_AT_optonline_DOT_net"]krez_AT_optonline_DOT_net[/email])
VIDE was ok, but I didn''t like it that much. IDEs are kindof a very personal preference thing. Personally, I like JFE about the best of all the free ones I''ve tried. I use it with Borland''s Free command-line compiler version 5.5. Anyway, if you''re using this IDE (though probably would be considered more of an editor), then I could tell you exactly what you need to do to get it up and running good. Nice thing about this one is it''s simple yet pretty customizable. It doesn''t appear to be able to generate makefiles like VIDE, but I kind of like that in a way. I guess I''d rather generate one manually.

Anyway. As far as compiling with BCC (borland C++ compiler), the simplest way if you''re not using an IDE (if using an IDE it comes down to how you configure the IDE) is to go where your source file is and type "BCC32 <sourcefile name>". This is assuming alot though. When you''re dealing with larger projects and multiple files different methods come into play. Things like using a makefile. I''m assuming you mainly just want to compile simple things at this point, and are learning. The .exe file should default to the directory where the source file is. For extra command line options check out the online help that came with the compiler. Also make sure you''ve followed the directions that were in the readme.txt. They''re a little confusing though.

If you''re just writing out a simple single source file BCC32 should suffice, but if when you''re dealing with multiple source files and more complex linking you''ll want to turn to using "ilink32.exe" that is the linker for Borland C++ compiler that comes with it.

Here''s a link that steps you through what they''re trying to tell you in the readme.txt a little more clearly.

http://www.pharo.onlinehome.de/Setup.html

Personally, I feel it''s good to learn how to do things at the command line, that way you can adjust regardless of IDE since you''ll be more in touch with what''s going on behind the GUI interface. Then when you use an IDE it''s just a matter of configuring it to do what you would want at the command line. It also keeps you from being dependant upon a specific environment less.

Hope this helps. It was a little confusing for me too at first, because there is just so many different options. Best bet is to start off simple, then as need arises, see if you can figure out how to get more complex projects to compile and link properly. Anyway, hang in there, it will sink in as you experiment more. The most important thing making sure you setup what''s outlined in the web page and what the readme.txt, I gave you, said. That very well may be what''s giving you problems with compiling.

Also remember if you don''t want to use an IDE or special editor, there''s nothing wrong with that. Some programmers swear by dos edit, and or notepad, and doing everything by the command-line. Command is a little less intuitive at first, but once you figure out what''s going on, it makes total sense and gives you something you can always revert to if you''re stuck with only having some unfamiliar IDE available to you. Like at work or something. Essentially more universal approach, whereas an IDE tends to be a little more specific to the IDE in question.

In case you''re wondering what an IDE is, it stands for Integrated Development Environment. Essentially it''s a fancy editor and a little more that the idea is to make things like compiling, debugging, linking etc quicker and easier. Quicker and easier if you''re familiar with the IDE in question. They''re more of convenience than a necessity though, and you''re going to find IDEs comes down to personal preference. Everyone seems to have their own favorite one to use. There''s even many old school programmers that hate IDEs and feel they hinder them more than make things handy. So the best thing to do is whatever you feel is your personal preference. That''s hard to tell at first though. I had to go through trying a bunch of different ones before I found one that satisfied what I wanted. They all seem to have their pros and cons.
Shouldnt the words "I write something, then click to compile" indicate to you that he is in fact not using the free commandline tools, but a trial version of BCB?

Psalm 137:9: "Happy shall he be, that taketh and dasheth thy little ones against the stones."
--AnkhSVN - A Visual Studio .NET Addin for the Subversion version control system.[Project site] [IRC channel] [Blog]

This topic is closed to new replies.

Advertisement