473,396 Members | 2,068 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Include Question

I am trying to compile someone else's code and compiler is giving an error on a statement

#include "$INCLUDE"

Can someone please tell me what this statement does? Does it mean that INCLUDE is defined in some other file as a file name? But then one could just do #include INCLUDE I suppose. I have tried searching all files for where INCLUDE may have been defined (using GREP), however I haven't found this which leads me to believe this is doing something else.

Thanks
Vipin
Dec 28 '07 #1
3 1355
sicarie
4,677 Expert Mod 4TB
I'm not sure I understand you. Are you looking for your header files, or are you trying to include a specific library?

#include is a compiler directive - it tells (I'm guessing that using grep, you're using Linux and GCC/G++) GCC/G++ to look in it's library files for the name specified (where your '$INCLUDE' is located - GCC would look for a library named $INCLUDE, which I'm pretty sure doesn't exist). The most common is dependent on your language (GCC or G++). If you are using C, it's #include <stdio.h>, and C++ is #include <iostream>.

Does that help? What are you trying to do?
Dec 28 '07 #2
weaknessforcats
9,208 Expert Mod 8TB
This doesn't look like standard C or C++.

Normally, you just include the file name. The file is searched for along a pre-defined path if you use < > in the include. The file is searched for in the present working directory (PWD) if you use " " in the include. In this second case, if the file is not in the PWD, the search continues as though you had used < >.

You are allowed to use a token sequence. Here you include the token leaving you free to redefine the token without having to alter the source file:

#include MYFILE

Somehwhere earlier you have:

#define MYFILE "C:/DooDah/MyStuff/hotwater.h"

And presto, hotwater.h is included.

But the token is not inside double quotes as your example shows. A token inside quote is invalid preprocessor syntax. That is, the token name must resolve to a name between " " or < >.
Dec 28 '07 #3
oler1s
671 Expert 512MB
You know what I thought when I saw that include line? PHP. Because "$something" is basically a form of string substitution in PHP.

There's three forms of comments in PHP. Yes, # is a single line comment.
PHP has includes. It's just include "something". Include is a function, so you can apply string substitution to the argument.
PHP can do string substitution if double quoted strings are used. And $something gets replaced by whatever the variable $something is for.

I'm not saying that's a PHP line of code. I'm saying, I get the feeling the OP is not a programmer, and doesn't know what he's dealing with.
Dec 28 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

13
by: mark | last post by:
IF I have something like this: <title><?php print($pagetitle); ?></title> <body> <?php include("folders/my_include.php"); ?> </body> </html> and my_include.php contains the value to the...
4
by: michaaal | last post by:
I have two folders in my website... Folder1 (this is where my #include file is, this is where the style.css is) --Folder2 (Folder2 is inside of Folder1) Folder2 contains a file that has...
6
by: qaz | last post by:
I run a web site on both a testing server and a "production" server. I noticed that references to the include file do not work on the testing server but they do work on the production server. I...
6
by: Simon Elliott | last post by:
(Note: this is a real C++ question and not an MS Windows question. The window handle I introduce is just an example of OS specific data, which I've used to illustrate my question.) I have some...
3
by: Arpi Jakab | last post by:
I have a main project that depends on projects A and B. The main project's additional include directories list is: ...\ProjectA\Dist\Include ...\ProjectB\Dist\Include Each of the include...
3
by: sunnylele | last post by:
Hi, all, I have a question on the use of #include: #include <unistd.h> #include <asm/unistd.h> #include "nn.h" What are the differences between the above three usages? It seems the third...
2
by: key9 | last post by:
Hi all look at the organize tree main.c ------ #include lib_adapter.c main() { foo();
12
by: TMN | last post by:
Hi All I am new to PHP and I do not understand why the following works ?? $file=urlencode("displayIncidents.php"); echo "<a href=statistics.php?fileName=$file&delete=true>Delete...
8
by: The Cool Giraffe | last post by:
One thing i do know for sure. When one creates a CPP file, one needs to include the H file. Now, having said that, i wonder if there are some general hints, requirements or standard guide lines on...
25
by: Mark | last post by:
so, i'm making a website. let's say i have header.php, footer.php and content.php. now in index.php I simply want to include the 3 pages. easy enough to do. but let's say the user navigates to...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.