Questions tagged [include]

A provision that many programming languages provide to allow functionality defined in one file to be used in another.

include is a provision that many programming languages provide to allow functionality (code such as functions, classes, objects etc.) in one file or package to be referenced and used in another.

Example (PHP)

include './dir/file.php';

Resources

9740 questions
3
votes
2 answers

Why clang on Mac automatically includes some missing headers?

I noticed that clang++ includes a missing header - on Mac, while g++ shows errors about it on Linux. Now I wonder why clang does it, and gcc not. And how I can force clang to not do it. Here is a sample code which compiles by clang on Mac,…
3
votes
2 answers

How to include() functions into a class in PHP

Possible Duplicate: Can I include code into a PHP class? Hello, I have some third-part php files that I would like to include as classes in my application. The problem is those files keep changing and they are not OOP, just a bunch of functions.…
Fernando Barrocal
  • 12,584
  • 9
  • 44
  • 51
3
votes
3 answers

PHP - Find URL of script that included current document

I have a template I made that sets variables that rarely change, call my headers, calls my banner and sidebar, loads a variable which shows the individual pages, then calls the footer. In one of my headers, I want the URL of the page in the user's…
Canadian Luke
  • 397
  • 1
  • 13
  • 33
3
votes
4 answers

How do I view the hierarchy of which Unit USES another? (Delphi)

There is a large project, and I need to see the hierarchy of Units which each file references in it's USES clause. ex. Project Source (program.dpk) HelperUnit Forms …
Daisetsu
  • 4,846
  • 11
  • 50
  • 70
3
votes
2 answers

How many other files does include affect aside from the one it's in?

I'm just learning C++, and I was under the presumption that including something would only affect the file that included it, but I appear to be wrong. My setup is like so: If I don't include BaseClass.h in either Main or Subclass (extends…
Drew
  • 670
  • 8
  • 26
3
votes
1 answer

Include a php file, but return output as a string instead of printing

I want to include a file, but instead of printing output I want to get it as string. For example, I want include a file: world! But instead of printing Hello world! while including the file I want to get it as a string. I…
user5147563
3
votes
2 answers

When I include files in PHP, it gives me a blank screen?

I'm trying to include the header at the top of my pages, but it gives me a blank screen. When I remove it the PHP file runs and shows the content: What's going wrong?
getaway
  • 8,792
  • 22
  • 64
  • 94
3
votes
1 answer

How To specify Where in Include in entity framework

I have faced this issue many times and I wanted to know the best approach to deal with Where clause in Include. Here is my sample code IEnumerable dataStoreMenus = _context.StoreMenus .Include(sm =>…
Jay
  • 299
  • 1
  • 5
  • 20
3
votes
2 answers

Don't including class header when only declaration exists

I have the following case: class_a.hpp: #include "class_b.hpp" // is this "include" mandatory? class class_a{ private: class_b b; }; class_a.cpp: #include "class_b.hpp" //code that uses member variables and functions from class_b…
Humam Helfawi
  • 19,566
  • 15
  • 85
  • 160
3
votes
3 answers

The ambiguous error occurs while using the models.sequelize.col () in the include in sequelize(node.js express)

mariadb, show tables; Board Comment my code, models.Board.findAll({ attributes: [ '_no', 'title', 'content', 'createdAt' ], include: [ { model: models.Comment, tableAlias: 'Comment', attributes: [ [models.sequelize.fn('count',…
hyeokluv
  • 377
  • 2
  • 8
  • 18
3
votes
1 answer

Cmake: check if system include directory

Is it possible with cmake 2.6 (or higher, if not possible in this version) to check whether an include directory is marked as SYSTEM (e.g. compile with the isystem gcc flag, see 2.8 System Headers)? For example, I get the include directories of the…
Carmellose
  • 4,815
  • 10
  • 38
  • 56
3
votes
4 answers

Basic stucture of a C/C++ project (header files and cpp files)

This is a brain-dead newbie question, but here goes: What determines what files get included in a C/C++ project? My understanding is that the compiler starts with the file that has main() in it and that file will contain #include's to get various h…
Russel
  • 3,609
  • 8
  • 33
  • 32
3
votes
3 answers

Rails .includes not returning association

I have the following setup: Company has_many :locations Location belongs_to :company When I call Company.includes(:locations), I'm getting the company returned back, but none of the associated locations. Any ideas are appreciated!
Shelby S
  • 400
  • 4
  • 17
3
votes
2 answers

#ifndef in Common Lisp

In C, to make sure we don't re-include headers that are included we use the following structure: #ifndef UTILS #define UTILS #include "my_utils.h" #endif I've broken my Lisp program into separate files; multiple files sometimes use the same file…
audrow
  • 143
  • 1
  • 9
3
votes
3 answers

#includes in C files for processor specific implementations

I'm working on a 'C' code base that was written specifically for one type of embedded processor. I've written generic 'psuedo object-oriented' code for things like LEDs, GPIO lines and ADCs (using structs, etc). I have also written a large amount of…
Arsinio
  • 159
  • 8