C++ Flags

R

Rolf Magnus

Andry said:
What kind of flag's I should Use to compile a C++ Program?

Even though most CPUs make use of "flags" to maintain some internal state
that describes (often among other things) the result of the last arithmetic
or logic instruction, C++ doesn't offer such a concept. You should just
forget about them unless you need some inline assembler. Then, your CPU's
data sheet our assembler instruction manual might be of use.
 
R

Ron AF Greve

Hi,

If you use gnu c++ and you have all the source in one C++ file optimization
level2

g++ -Wall -O2 myprogram.cc -o myprogram

In Visual C++ just hit F7
Or select release build and hit F7 (for the release version without
debugging stuff)

Regards, Ron AF Greve

http://www.InformationSuperHighway.eu
 
S

Sherman Pendley

Andry said:
What kind of flag's I should Use to compile a C++ Program?

They vary from one compiler to another - you'll need to ask in a forum,
group, list, or some other resource that's dedicated to the compiler you
happen to be using.

sherm--
 
J

James Kanze

(By flags, I'm assuming that he means options.)
They vary from one compiler to another - you'll need to ask in
a forum, group, list, or some other resource that's dedicated
to the compiler you happen to be using.

More likely, he'll have to read the documentation. The options
you want will depend heavily on context: what you're doing, and
how you're organized.

For a beginner, it's a bit of a hassle, since of course, you
don't know how you want to organize until you've actually
learned some programming. (For one thing, without some
understanding of C++ and the programming process, you probably
won't be able to understand the documentation.) Regretfully,
I've yet to see a compiler where the default options are useful
for anything, so your suggestion of asking in a dedicated forum
is probably the best he can do. Followed by choosing one of the
conflicting answers randomly, and hoping for the best.

If he's learning in an educational institution, of course, his
teacher should tell him which options to use. And if it's part
of on the job training, the company should have some established
standards for them.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top