List:MySQL++« Previous MessageNext Message »
From:Chris Frey Date:January 26 2011 9:37pm
Subject:Re: error C3861: 'time': identifier not found
View as plain text  
On Wed, Jan 26, 2011 at 10:53:26AM +0000, Tomalak Geret'kal wrote:
> On 26/01/2011 10:47, Jonathan Wakely wrote:
> >On 26 January 2011 10:38, dan g. wrote:
> >>
> >>
> >>Wow, thank you, I did accidentally have an include path that went one too 
> >>deep
> >>into ZThread's includes structure.. and there was a Time.h in there.
> >
> >Eurgh - the perils of case independent filesystems!
> >
> 
> And of stupid header names. And of having broken include 
> paths. :)

I dare to diverge from the MySQL++ topic to say that there's nothing
stupid about having a header named time.h.

You just need to realize that, to use it, use:

	#include "time.h"

And to use the system version, use:

	#include <time.h>

If you keep your application or library headers in their own subdirectory,
such as:

	mylib/mylib.h
	mylib/time.h
	mylib/help.h

Then you can include properly, like:

	#include "mylib/time.h"

or, if the directory in which the mylib/ directory resides is in your include
search path:

	#include <mylib/mylib.h>

Note that when mylib.h itself needs to include its own time.h, it just
does the same thing:

	#include "time.h"

And everything works out as it should.

It is when programmers don't understand the flexibility of these include
rules that problems occur.  There is nothing magical about the filenames.

The rule is:

	#include "something.h"

searches first in the same directory as the file that is doing the including.
That is, any quoted includes inside mylib/mylib.h will first be searched for
in the mylib/ directory, even if some .c file in some other random directory
was the file that first included <mylib/mylib.h>.

While:

	#include <something.h>

will search first in the compiler's include path list.

Have fun,
- Chris

Thread
error C3861: 'time': identifier not founddan g.26 Jan
  • Re: error C3861: 'time': identifier not foundTomalak Geret'kal26 Jan
  • Re: error C3861: 'time': identifier not foundJonathan Wakely26 Jan
    • Re: error C3861: 'time': identifier not founddan g.26 Jan
      • Re: error C3861: 'time': identifier not foundJonathan Wakely26 Jan
        • Re: error C3861: 'time': identifier not foundTomalak Geret'kal26 Jan
          • Re: error C3861: 'time': identifier not foundChris Frey26 Jan
            • Re: error C3861: 'time': identifier not foundTomalak Geret'kal27 Jan
              • Re: error C3861: 'time': identifier not foundJonathan Wakely27 Jan