include

can two classes see each other using C++?

So I have a class A, where I want to call some class B functions. So I include "b.h". But, in class B, I want to call a class A function. If I include "a.h", it ends up in an infinite loop, right? What can I do about it? ...

#include iostream in C?

In C++ we always put the following at the top of the program #include <iostream> What about for C? ...

name collision in C++

Hi all, While writing some code i came across this issue: #include <iostream> class random { public: random(){ std::cout << "yay!! i am called \n" ;} }; random r1 ; int main() { std::cout << "entry!!\n" ; static random r2; std::cout << "done!!\n" ; return 0 ; } When i try to compile this code i get the error error: ârandomâ d...

Why does `include <iostream>` end up including so *many* files?

Follow up of this question: When I do include <iostream> . It happens that it includes many files from /usr/include .A grep "\usr\include" over g++ -E prog.cpp counted to about 1260 entries ;). Is their a way to control including various files? Platform: Linux G++ version: 4.2.4 ...

including .h file from a different application/directory

I have some .h files as follows (on Linux) Source/Server/connect.h Source/Server/message.h ... I am developing another application that needs the two .h files but is in a different directory Source/App2/.. How can I include the connect.h file in the App2 application, considering that I use perforce and everyone else working on the ...

PHP Catch "Empty" Includes

We have a custom framework that we use, that allows us to include code in to other pages. However, the header for this code is always printed, even if the include code doesn't output anything. Is there a way that I can exit, or return something specific, that I can trap and catch via include/require, so that I can do the right thing? ...

How to include specific filename from multiple directories using PHP

Hello, I'm trying to include specific 'admin view' files from within a folder structure. I'm familiar with include/require or how to recursively include a folder, but all I need to do is include one filename from each directory - the admin_view.php file. So, my dir. structure looks like this: File to have includes is at root. - mods ...

OpenCV and include files

Hi - has anyone installed OpenCV 2.0 on windows? Does the installation create directories such as "...\opencv\cxcore\include"? How do you link the libraries in Visual C++ 2008 (Express) and also the include files? In short how do you use OpenCV2.0 with VC++ 2008? Any help greatly appreciated. Max. ...

Include document in joomla with PHP

Hi I'm very fresh to PHP world. Trying to do as I think very simple thing(?)- include external file in Joomla template. <?php include_once('templates/' echo $this->template '/includes/footer.php'); ?> But unfortunately it is not working. can someone please tell me how correct string should look like? Thank you in advance ...

C++ : How to include boost library header in VC++6?

I used this guide to rebuild the boost library in VC++6 under windows XP. But is having problems trying to include the header files. By default, the boost library makes use of point 1 as follows to declare the header files. But if I used point 1, I get "fatal error C1083: Cannot open include file...". I tried using point 2 to declare and...

PHP: Get PHP's variables, functions, constants from a php file

Hello All, Is there a way to get user-defined php functions, variables, constants from a php file? Following functions are not the best way to do so because they get all decalred functions/vars/constants (with hundreds of php's built-in constants and internal php functions): get_defined_vars get_defined_functions get_defined_consta...

PHP file naming conventions (.class, .inc)

I see .class and .inc included in file names a lot of the time. My current understanding is that this is just a best practice to make the purpose/contents of the file clear. Is there any instance in PHP where a .class or .inc file name has a special purpose and truly means something? ...

Why is PHP not including my file when it clearly exists?

Here is the exact problem. I have an autoload function set up with a piece of code that looks like this: if(file_exists($class_file)) { include($class_file); return true; } However, when $class_file is set to a certain value, I get an include error: Error String: include(includes/php/utilities/calendar_event_html.utility.php) [fu...

PHP - Calling Relative URL within = 'xx' apostrophe's

I'm trying to insert a relative URL in the code below before "/images" in $thumb_directory and $orig_directory however I'm not sure how to do so within 'apostrophe's'. Also, this is a WordPress website, so if anyone knows how to call the function within '/images', like so: '/images' please let me know (I realize that what I just typed ...

visual c++ include and link libraries

I have a old install of visual c++ 6.0. I'd like to bring things more nearly up to date particularly for include files. Here is a list of what my TOOLS->OPTIONS->DIRECTORIES->INCLUDE FILES shows... c:\program files\microsoft visual studio\vc98\include c:\program files\microsoft visual studio\vc98\mfc\include c:\program files\microso...

how to pre-process a PHP MVC view without using the framework?

Is there any way I can pre-process a PHP view script without using a particular MVC framework? Basically I want to render the view and pass it as an HTML string to another view. The view I'm trying to render has some references like $this->rows, and, of course, I would need to add the values of those references to the script before gen...

PHP include inside an include (different directory)

The structure for the current project I am working on is something like: root/index.php root/includes/php/first.php root/includes/php/functions.php So index.php includes first.php: <?php include_once("includes/php/first.php"); ?> Normally then my first.php would call functions like: <?php include_once("includes/php/functions.php"...

Compiled FreeImage from source. #include FreeImage.h not found.

I have compiled FreeImage 3.10.0 from source at /lib/FreeImage on Mac OS X 10.6. I can see that after compilation these files were copied: /usr/local/lib/libfreeimage-3.10.0.dylib /usr/local/lib/libfreeimage.a /usr/local/include/FreeImage.h CMake cannot find FreeImage, but I cannot even do #include <FreeImage.h> // not found I am...

Windows XP path problem

My Environmental Variables (& I crosschecked every possible place in the Registry) show my PHP include path as: "C:\PHP\" --and PHP (5.2.9-2) works fine on the system, so that is correct. However, running ini_get("include_path") shows the path as "C:\PHP5\". This causes problems with PEAR, etc. I've searched the system (i.e. php.ini...

Why can't I pass variables into an included file in PHP?

I've had this problem before before with no real resolution. It's happening again so I'm hoping you experts can help. I set a variable on my index.php based on the $_GET array. So I use this code: $admin = isset($_GET['admin']) ? $_GET['admin'] : "dashboard"; Below that, I use a function to include my layout: include_layout("admin_h...