LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 05-21-2006, 02:26 AM   #1
ArthurHuang
Member
 
Registered: Jan 2006
Posts: 174

Rep: Reputation: 30
C++ standard problem


Have you guys ever read this article:

http://www.possibility.com/Cpp/CppCo...d.html#classes

What are "SYSTEM INCLUDES,PROJECT INCLUDES, LOCAL INCLUDES,FORWARD REFERENCES"? Which are introduced in " Include Statement Documentation" part
 
Old 05-21-2006, 08:47 AM   #2
graemef
Senior Member
 
Registered: Nov 2005
Location: Hanoi
Distribution: Fedora 13, Ubuntu 10.04
Posts: 2,379

Rep: Reputation: 148Reputation: 148
System includes are those provided by the system, typically by the C++ language such as iostream angle brackets are used:

#include <iostream>

Project includes are those which are written for the project, double quotes are used:

#include "myClass.h"

Forward references are where the compilers is told that a variable will be used but it has not been defined yet.

class myClass;
class myOtherClass
{
// uses myClass
};

class myClass
{
// possibly uses myOtherClass
};
 
Old 05-21-2006, 09:49 AM   #3
ArthurHuang
Member
 
Registered: Jan 2006
Posts: 174

Original Poster
Rep: Reputation: 30
Thanks a lot! But what is local include?
 
Old 05-21-2006, 10:25 AM   #4
graemef
Senior Member
 
Registered: Nov 2005
Location: Hanoi
Distribution: Fedora 13, Ubuntu 10.04
Posts: 2,379

Rep: Reputation: 148Reputation: 148
I'm not familiar with the term local include. I would guess that the way the author uses it is that project includes are for project wide data - such as globals whilst local includes are includes for more local definitions such as the class.

I don't believe that is standard terminology so there are possibly different ways to interpret it. Another order could be:

System Includes
3rd Party Libraries
Project Libraries
Project includes
 
Old 05-21-2006, 10:48 PM   #5
xhi
Senior Member
 
Registered: Mar 2005
Location: USA::Pennsylvania
Distribution: Slackware
Posts: 1,065

Rep: Reputation: 45
a local include would be a header file that should be accessible only by the lib that it resides in. consider a structure like

/
-libA
+ libA.h
+ libA_local.h
+ libA.c
+ libA_utils.c
-libB
+ libB.h
+ libB_local.h
+ libB.c
+ libB_utils.c


libA will have functions/vars in libA.h that should be visible to libB, while libA_local.h will have functions/vars that for one reason or another will be visible only within the libA library. this is then enforced by having your makefile copy the public headers to a project include file that everything is included from for the build. this prevents other libs from just using an absolute path to the *_local header.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
when will 64bit be standard? SlipAway172 Linux - Hardware 1 10-16-2005 02:11 PM
Standard Aesthetics chadman Linux - Software 1 12-24-2004 08:29 AM
SUSE Standard Server 8, SCSI problem sparks_vfr Linux - Distributions 0 08-12-2004 09:29 AM
standard vs Expert install? Standard flubs up! Frost Linux - Software 1 03-27-2002 07:55 AM
Mandrake Standard 8.1 Karen Linux - Software 2 03-02-2002 04:28 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:19 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration