LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

naming a header file the same as one of the standard library (or #include "time.h" vs #include (left angle bracket)time.h(right angle bracket))

for a project, i had to define a whole lot of time-related function and had the great idea of aggregating them into a header named "time.h"...

i added the header file into my project, and now toolbox.h does not compile anymore with an error related to time_t type being not defined. toolbox.h is including time.h using #include <time.h>, and it uses my own time.h which, of course, does not define time_t.

now i am wondering: originally, i recall there was a difference between #include "time.h" and #include <time.h>. the former would look for a relative path into the project folder, while the later would look into the system include files (here CVI standard lib path as well as pathes defined in the "include paths" IDE option). this way #include <time.h> would find the standard library header file, and #include "time.h" would find my own header. am i right ? is it really defined this way or am i misleading ?

(ha, if only the C standard was available for free. no wonder nobody really knows how it works... and no compiler is really standard compliant)

ps: this question is only informative. i will rename my header to make the error disappear. not a good idea to name it time.h.
pss: the forum software is buggy: if no HTML is allowed into the subject line, then why search the subject for '<' and '>' ? and <time.h> is not valid html anyway... and the error gives a link about a "limited set of HTML" but the target of the link explains how to post a message, not what limited set of html you can use.
0 Kudos
Message 1 of 1
(3,078 Views)