I have a project in CodeBlocks (MinGW32) which is setup like this :
Foo/src/somefile1.cpp
Foo/src/somefile2.cpp
Foo/src/somefile1.h
...
Headers are included that way :
#include "somefile1.h"
In order to be able to compile I have added the following directory in "Project options" > "Search directories" (as a relative path) :
src
After adding that folder, the project compiles. However, if I include a standard header like <ctime>
the following errors appears in ctime header file :
'::clock_t' has not been declared
'::time_t' has not been declared
...
and so on for all lines inside the std namespace
brackets of ctime. If I remove the src
folder from search directories, I can compile again.
I have reduced the code to the bare minimum, removed all files except main.cpp
, but the problem is still there :
#include <ctime> //errors if "src" folder added in search folders
int main(int argc, char **argv) {
time(NULL); //does not compile
return(0);
}
std::time_t
instead of::time_t
? – clickMe