473,387 Members | 1,766 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,387 software developers and data experts.

Included file not found, but I don't know why

I have declared an include file:

// gsl.config must be included for correct build with inline correctly
defined etc.
#include "gsl/config.h"

And the compiler says:
Error 4 fatal error C1083: Cannot open include file: 'gsl/config.h': No
such file or directory

But it's in the subfolder c:\MYPROJECT\gsl\gsl\config.h

Additionally I have set this directory to be included by going to the
VC++ Project settings and defining the path
C:\MYPROJECT\gsl\
and
C:\MYPROJECT\gsl\gsl

Can somebody tell me how he would go on now?

Thanks again.
Anna

Oct 24 '08 #1
8 2561
It only works when I specify full paths... something like that:

#include "C:\MyProject\gsl\gsl\config.h"

But not if I do it like this:
#include "gsl/config.h"

I don't know what I did wrong.

Anna
Oct 25 '08 #2
>It only works when I specify full paths... something like that:
>
#include "C:\MyProject\gsl\gsl\config.h"

But not if I do it like this:
#include "gsl/config.h"

I don't know what I did wrong.
Perhaps the relative path isn't quite right - does it need ..\
prepending perhaps?

Dave
Oct 25 '08 #3
Anna Smidt wrote:
I have declared an include file:

// gsl.config must be included for correct build with inline correctly
defined etc.
#include "gsl/config.h"

And the compiler says:
Error 4 fatal error C1083: Cannot open include file:
'gsl/config.h': No such file or directory

But it's in the subfolder c:\MYPROJECT\gsl\gsl\config.h

Additionally I have set this directory to be included by going to the
VC++ Project settings and defining the path
C:\MYPROJECT\gsl\
and
C:\MYPROJECT\gsl\gsl
Anna:

Where is the file that contains the statement

#include "gsl/config.h"

If config.h is in

c:\MYPROJECT\gsl\gsl

then the originating file should be in

c:\MYPROJECT\gsl

When you define additional directories you would need to specify

C:\MYPROJECT\gsl

Note that the trailing backslash is not needed here, and could be the cause of
the problem.

Note also that if you add this directory (either in the project or the VC
settings) then you can (I would say should) use the angle bracket form

#include <gsl/config.h>

--
David Wilkinson
Visual C++ MVP
Oct 25 '08 #4
What do you mean by "originating file", please? Do you mean "config.h"
or do you mean the file where #include <gsl/config.his written?
If config.h is in

c:\MYPROJECT\gsl\gsl

then the originating file should be in

c:\MYPROJECT\gsl

When you define additional directories you would need to specify

C:\MYPROJECT\gsl

Note that the trailing backslash is not needed here, and could be the
cause of the problem.

Note also that if you add this directory (either in the project or the
VC settings) then you can (I would say should) use the angle bracket form

#include <gsl/config.h>
Oct 25 '08 #5
Anna Smidt wrote:
What do you mean by "originating file", please? Do you mean "config.h"
or do you mean the file where #include <gsl/config.his written?
Yes, I mean the file where the #include statement is written. Wasn't this
obvious from the part of my post that you did not quote?

Also, if config.h is in c:\MYPROJECT\gsl\gsl then it is not in c:\MYPROJECT\gsl,
so that could not have been my meaning.

--
David Wilkinson
Visual C++ MVP
Oct 25 '08 #6
I have managed to make it, but I don't understand why it works.
At first I had these additional include directories:

\PROGRA~1\OpenCV\cv\include;\PROGRA~1\OpenCV\cxcor e\include;\PROGRA~1\OpenCV\otherlibs\highgui;..\re gex;..\gsl;..\gsl\gsl;..\image;..\jpeg;..\mat;..\r owley;..\stasm;..\tasm;

Then I added the explicit path (see end of line), and it worked:

\PROGRA~1\OpenCV\cv\include;\PROGRA~1\OpenCV\cxcor e\include;\PROGRA~1\OpenCV\otherlibs\highgui;..\re gex;..\gsl;..\gsl\gsl;..\image;..\jpeg;..\mat;..\r owley;..\stasm;..\tasm;"C:\MyProject\gsl";"C:\MyPr oject\gsl\gsl"

It is unclear to me why

...\gsl;..\gsl\gsl;..

doesn't did resolve to

"C:\MyProject\gsl\gsl"
"C:\MyProject\gsl"

Anna
Oct 25 '08 #7
Anna Smidt wrote:
I have managed to make it, but I don't understand why it works.
At first I had these additional include directories:

\PROGRA~1\OpenCV\cv\include;\PROGRA~1\OpenCV\cxcor e\include;\PROGRA~1\OpenCV\otherlibs\highgui;..\re gex;..\gsl;..\gsl\gsl;..\image;..\jpeg;..\mat;..\r owley;..\stasm;..\tasm;
Then I added the explicit path (see end of line), and it worked:

\PROGRA~1\OpenCV\cv\include;\PROGRA~1\OpenCV\cxcor e\include;\PROGRA~1\OpenCV\otherlibs\highgui;..\re gex;..\gsl;..\gsl\gsl;..\image;..\jpeg;..\mat;..\r owley;..\stasm;..\tasm;"C:\MyProject\gsl";"C:\MyPr oject\gsl\gsl"
It is unclear to me why

..\gsl;..\gsl\gsl;..

doesn't did resolve to

"C:\MyProject\gsl\gsl"
"C:\MyProject\gsl"
Anna:

When you add additional directories to the project, relative paths are relative
to the project file (.vcproj). If this file is in C:\MyProject then ..\gsl is
C:\gsl (which does not exist).

What happens if you just add "gsl" to the directory list?

--
David Wilkinson
Visual C++ MVP
Oct 25 '08 #8
Relative paths in includes, etc. are relative to the directory of the
..vcproj file.
Maybe your .vcproj is located not in same directory with the .cpp files

--PA
"Anna Smidt" <a.*****@nospamgmail.comwrote in message
news:#v**************@TK2MSFTNGP02.phx.gbl...
I have declared an include file:

// gsl.config must be included for correct build with inline correctly
defined etc.
#include "gsl/config.h"

And the compiler says:
Error 4 fatal error C1083: Cannot open include file: 'gsl/config.h': No
such file or directory
But it's in the subfolder c:\MYPROJECT\gsl\gsl\config.h

Additionally I have set this directory to be included by going to the VC++
Project settings and defining the path
C:\MYPROJECT\gsl\
and
C:\MYPROJECT\gsl\gsl

Can somebody tell me how he would go on now?

Thanks again.
Anna
Oct 25 '08 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Peter Redding | last post by:
Forgive me if this doesn't make too much sense but I've been working on this project all day and my brain is a bit fried. To make some of my code more readable I made a file (called urls.inc)...
19
by: aa | last post by:
Is a PHP variable supposed to be seen in a .js file included into a .php file? I have a client side javascript code stored in a .js file which is included into a PHP file using <script...
6
by: o'seally | last post by:
solaris/linux admins/rookie_developers that battle with this error are probably all frustrated when it happens. i bet you're also somehow frustrated by this seemingly unsolvable error :-) ...take...
26
by: TomB | last post by:
I have a function on an "included" page. For reasons unknown to me I frequently will get an error - to the effect that the function can't be found. If I hit refresh/F5 it loads the page just...
0
by: georgel | last post by:
:shock: SmartNav.js problem solved for now... After some research I've concluded that replacing my old SmartNav.js file for the one included in the sp1 release remedies my issue of the 404...
19
by: Martin Oddman | last post by:
Hi, I have a compiling problem. Please take a look at the code below. I have an application that is built upon three tiers: one data tier (Foo.DataManager), one business tier (Foo.Kernel) and...
9
by: Daz | last post by:
Hi everyone. I am a little stumped at why when I try to include a file in same directory as the script being processed, it looks in the same directory as the script that included it to begin...
27
by: Jon Slaughter | last post by:
Can I modify code that I have included using <?php include("../Index.php"); ?> The Index.php file contains links that need to be modified to work. Index.php is basically an html file uses a...
5
by: =?Utf-8?B?V2lsbGlhbSBGb3N0ZXI=?= | last post by:
Good evening all, I am trying to write a process that uses a while loop to cycle multiple files from an array throught the StreamReader Process. The whole thing works using: Dim...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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,...

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.