Solved

what "PRAGMA   , "implementation  "" means?

Posted on 2001-07-02
6
588 Views
Last Modified: 2012-06-27
#ifdef PRAGMA
#pragma implementation "OtEchoMae_Actor.h"



0
Comment
Question by:she25
  • 3
  • 2
6 Comments
 
LVL 30

Expert Comment

by:Axter
ID: 6246704
"#pragma" are directives that are specific to the compiler.
What compiler are you using, and what OS?
0
 

Author Comment

by:she25
ID: 6246707
I am not sure, unix, sloris!
0
 
LVL 30

Expert Comment

by:Axter
ID: 6246713
What is the command line that you use to compile your code?
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 30

Accepted Solution

by:
Axter earned 50 total points
ID: 6246718
Because the #pragma are compiler specific, you should check the man-page to find the specific meaning for your compiler.

On the commandline, type the following:
man c++
or
man cc
or
man gpp
or
man gcc

Depending on which of the above you use to compile you code, would depend on which man page you should type in.
0
 

Author Comment

by:she25
ID: 6246742
I am not sure, unix, sloris!
0
 

Expert Comment

by:MichelHermier
ID: 6252220
Pragmas are specific to each compiler, but somes are common.

On the short part of code you have done it says :

#ifdef PRAGMA
     if the preprocessor as the macro PRAGMA definied
     then do all to the next #endif

#pragma implementation "OtEchoMae_Actor.h"
     then preprocessor do implemetation of file...

for an explanation of pragma implementation, take a look at this extract of the web page http://www.cis.ksu.edu/Systems/Info/develop/gcc.info.C++_Interface.html

`#pragma implementation'
`#pragma implementation "OBJECTS.h"'
     Use this pragma in a *main input file*, when you want full output
     from included header files to be generated (and made globally
     visible).  The included header file, in turn, should use `#pragma
     interface'.  Backup copies of inline member functions, debugging
     information, and the internal tables used to implement virtual
     functions are all generated in implementation files.

     `#pragma implementation' is *implied* whenever the basename(1) of
     your source file matches the basename of a header file it
     includes.  There is no way to turn this off (other than using a
     different name for one of the two files).  In the same vein, if
     you use `#pragma implementation' with no argument, it applies to an
     include file with the same basename as your source file.  For
     example, in `allclass.cc', `#pragma implementation' by itself is
     equivalent to `#pragma implementation "allclass.h"'; but even if
     you do not say `#pragma implementation' at all, `allclass.h' is
     treated as an implementation file whenever you include it from
     `allclass.cc'.

     If you use an explicit `#pragma implementation', it must appear in
     your source file *before* you include the affected header files.

     Use the string argument if you want a single implementation file to
     include code from multiple header files.  (You must also use
     `#include' to include the header file; `#pragma implementation'
     only specifies how to use the file--it doesn't actually include
     it.)

     There is no way to split up the contents of a single header file
     into multiple implementation files.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now