include-path

C++ include with full path

♀尐吖头ヾ 提交于 2019-12-03 12:30:28
I find #include "../app/thing.h" very ugly and I would like to be able to import from the main root of my project, like this: #include <project/app/submodule/thing.h> (I know <> is generally used for external but I find it very cleaner) How can I do that, from anywhere in my project? You simply need to ensure that your build process sets an option to specify the starting point of the search. For example, if your header is in: /work/username/src/project/app/submodule/thing.h then you need to include (assuming a POSIX-compliant compiler; AFAICR, even MSVC uses /I as the analogue of -I ): -I/work

How to append a path to PHP's include_path in .htaccess

为君一笑 提交于 2019-12-03 08:14:30
问题 Currently on my site I'm using statements like: include 'head.php'; include '../head.php'; include '../../head.php'; depending on how many nested folders deep I am. I'm sure there is a better way to do this. I'm convinced .htaccess is the solution, but I'm not sure how to go about implementing it. If I insert: php_value include_path "public/html/root" ... I lose the rest of my paths ( /usr/lib/php , etc). I naively tried: php_value include_path $include_path . "(path)" but of course this didn

How does include path resolution work in require_once?

走远了吗. 提交于 2019-12-03 01:48:37
I was writing an web app in PHP, when I encountered a strange situation. To illustrate my problem, consider a web app of this structure: / index.php f1/ f1.php f2/ f2.php Contents of these files: index.php: <?php require_once("f1/f1.php"); ?> f1.php: <?php require_once("../f2/f2.php"); ?> f2.php: blank now when I try to open index.php in my browser I get this error: Warning: require_once(../f2/f2.php) [function.require-once]: failed to open stream: No such file or directory in /var/www/reqtest/f1/f1.php on line 2 Fatal error: require_once() [function.require]: Failed opening required '../f2/f2

Use of external C++ headers in Objective-C

我是研究僧i 提交于 2019-12-02 19:21:04
In my iOS project I need to use an external library written in C++. The C++ header files are all in one directory. I've added these C++ headers to my Xcode project, and also specified a header search path (in Build Settings). The issue is that these C++ headers include each other using < > angle brackets. This results in: 'filename.h' file not found with <angled> include, use "quotes" instead. The weird thing is that Xcode does not complain about all headers. Also the same header #include'd in one file is fine, while an issue when #include'd in another. I think this is caused by the fact that

how to set include paths with autotools

徘徊边缘 提交于 2019-12-02 19:20:34
I'm working on a C++ project that uses autoconf & automake , and I'm struggling to correctly set up the include paths in *CPPFLAGS . I've read about 3 hours worth of documents, and I can't figure it out yet. I'm not looking for a hack, but for the correct way to do this. Here is my conundrum. As I see it, there are 3 completely different sources for include paths: External libraries that must be installed along with my package, which are configured by configure --with-XXX=<PATH> . Within my package, some source files use #include <file.h> even when file.h is part of the package, so to compile

Why do projects use the -I include switch given the dangers?

醉酒当歌 提交于 2019-12-02 18:52:09
Reading the fine print of the -I switch in GCC, I'm rather shocked to find that using it on the command line overrides system includes. From the preprocessor docs "You can use -I to override a system header file, substituting your own version, since these directories are searched before the standard system header file directories." They don't seem to be lying. On two different Ubuntu systems with GCC 7, if I create a file endian.h : #error "This endian.h shouldn't be included" ...and then in the same directory create a main.cpp (or main.c, same difference): #include <stdlib.h> int main() {}

failed to open stream error message while trying to include phpseclib

谁说胖子不能爱 提交于 2019-12-02 04:59:07
问题 I'm trying to follow the instructions for installing phpseclib. I unpackaged everything and created a new phpseclib folder into /usr/share/pear . So I have the following stucture: /usr/share/pear/phpseclib/ Net Crypt File Math I determined the /usr/share/pear path by checking the get_include_path method. And now i'm trying to create a page that uses the phpsec library. Here's the php page I'm playing with: <?php set_include_path(get_include_path() . PATH_SEPARATOR . 'phpseclib'); include('Net

include-paths in included file fail

独自空忆成欢 提交于 2019-12-02 00:42:28
问题 I have some troubles with PHP include-paths and do not understand, what wrong there. First, I’d like to show you my file/dir structure: File/Dir structure |index.php |foo/ |baz.php |bar.inc.php |asdf/ |qwerty.inc.php /index.php: include('foo/baz.php'); /foo/baz.php: include('bar.inc.php'); include('../asdf/qwerty.inc.php') The content of the .inc.php -files is irrelevant here. Here’s the problem: If I call /foo/baz.php directly, the two includes work fine. But if I call /index.php , then the

Why does this PHP relative include fail?

一笑奈何 提交于 2019-12-01 22:13:22
disc@puff:~/php$ ls a.php data include disc@puff:~/php$ tree . ├── a.php ├── data │ └── d.php └── include ├── b.php └── c.php 2 directories, 4 files disc@puff:~/php$ cat a.php a.php is including include/b.php ... <?php include "include/b.php" ?> disc@puff:~/php$ cat include/b.php b.php is including c.php and ../data/d.php ... <?php include "c.php" ?> <?php include "../data/d.php" ?> disc@puff:~/php$ cat include/c.php c.php disc@puff:~/php$ cat data/d.php d.php disc@puff:~/php$ php a.php a.php is including include/b.php ... b.php is including c.php and ../data/d.php ... c.php PHP Warning:

How do I add the PHP libraries to my basic remote project in eclipse?

风格不统一 提交于 2019-12-01 07:36:24
I have a basic project that was created from a remote system using the eclipse tools to setup that connection. I right clicked on the folder on my remote system and chose create a new project. Now, I want to add PHP to the build path, but it is just a basic project. How do I quickly add those libraries with Eclipse PDT or Zend Studio installed? Not sure if this what you are looking for, but try Right click the project folder in the Explorer and click Open Project . Right click the project folder again. Find and click Configure from the Context Menu In the submenu find and click Add PHP Support