I get the following error when compiling my program. I have added all
necessary header files that I know but still getting the error.I would
appreciate your help.
here is the portion of my code that it does not like
printf("%s time is %i:%i.%ld\n", note, tm->tm_min, tm->tm_sec, ts.tv_nsec);
}
here is the error
Compiler: Default compiler
Building Makefile: "C:\Dev-Cpp\Makefile.win"
Executing make...
make.exe -f "C:\Dev-Cpp\Makefile.win" all
gcc.exe -c "../Users/Mohamed Elhady/AppData/Local/Temp/node.c" -o
"../Users/Mohamed Elhady/AppData/Local/Temp/node.o" -I"C:/Dev-Cpp/include"
-I"C:/Dev-Cpp/bin" -I"C:/Dev-Cpp/lib" -I"C:/Dev-
Cpp/lib/gcc/mingw32/3.4.2/include" -I"C:/Dev-Cpp/include/sys"
../Users/Mohamed Elhady/AppData/Local/Temp/node.c: In function print_time':
../Users/Mohamed Elhady/AppData/Local/Temp/node.c:151: error: storage size of
'tz' isn't known
../Users/Mohamed Elhady/AppData/Local/Temp/node.c:152: error: storage size of
'ts' isn't known
../Users/Mohamed Elhady/AppData/Local/Temp/node.c:156: error:CLOCK_REALTIME'
undeclared (first use in this function)
../Users/Mohamed Elhady/AppData/Local/Temp/node.c:156: error: (Each undeclared
identifier is reported only once
../Users/Mohamed Elhady/AppData/Local/Temp/node.c:156: error: for each
function it appears in.)
make.exe: *** Error 1
Execution terminated
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am getting the following error when I try to compile hello world program...
Compiler: Default compiler
Executing gcc.exe...
gcc.exe "D:\prog\hello.c" -o "D:\prog\hello.exe" -I"C:\Dev-Cpp\include" -L"C
:\Dev-Cpp\lib"
Could not execute gcc using
C:\DOCUME~1\fmas\LOCALS~1\Temp\Rar$EX01.734\gcc\bin\g++.exe this means that
gcc has probably been moved or deleted, please reinstall it.
Execution terminated
Compilation successful
I checked the compiler settings in Dev-Cpp but they are alright. Re-
installation ( I have check the option to remove all the configuration files
while uninstalling...) too is not solving this problem. I think this has
something to do with setting the environment variables and paths.... please
help..
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi All,
I get the following error when compiling my program. I have added all
necessary header files that I know but still getting the error.I would
appreciate your help.
here is the portion of my code that it does not like
print_time(char note) {
struct tm tm;
struct timeval tv;
struct timezone tz;
struct timespec ts;
gettimeofday(&tv, &tz);
tm = localtime(&tv.tv_sec);
clock_gettime(CLOCK_REALTIME, &ts);
printf("%s time is %i:%i.%ld\n", note, tm->tm_min, tm->tm_sec, ts.tv_nsec);
}
here is the error
Compiler: Default compiler
Building Makefile: "C:\Dev-Cpp\Makefile.win"
Executing make...
make.exe -f "C:\Dev-Cpp\Makefile.win" all
gcc.exe -c "../Users/Mohamed Elhady/AppData/Local/Temp/node.c" -o
"../Users/Mohamed Elhady/AppData/Local/Temp/node.o" -I"C:/Dev-Cpp/include"
-I"C:/Dev-Cpp/bin" -I"C:/Dev-Cpp/lib" -I"C:/Dev-
Cpp/lib/gcc/mingw32/3.4.2/include" -I"C:/Dev-Cpp/include/sys"
../Users/Mohamed Elhady/AppData/Local/Temp/node.c: In function
print_time': ../Users/Mohamed Elhady/AppData/Local/Temp/node.c:151: error: storage size of 'tz' isn't known ../Users/Mohamed Elhady/AppData/Local/Temp/node.c:152: error: storage size of 'ts' isn't known ../Users/Mohamed Elhady/AppData/Local/Temp/node.c:156: error:
CLOCK_REALTIME'undeclared (first use in this function)
../Users/Mohamed Elhady/AppData/Local/Temp/node.c:156: error: (Each undeclared
identifier is reported only once
../Users/Mohamed Elhady/AppData/Local/Temp/node.c:156: error: for each
function it appears in.)
make.exe: *** Error 1
Execution terminated
Is that linux code?
1) What version of Windows are you compiling under ?
2) What header files, that pertain to this specific function, are you
including ?
Steve
Hi all
I am getting the following error when I try to compile hello world program...
Compiler: Default compiler
Executing gcc.exe...
gcc.exe "D:\prog\hello.c" -o "D:\prog\hello.exe" -I"C:\Dev-Cpp\include" -L"C
:\Dev-Cpp\lib"
Could not execute gcc using
C:\DOCUME~1\fmas\LOCALS~1\Temp\Rar$EX01.734\gcc\bin\g++.exe this means that
gcc has probably been moved or deleted, please reinstall it.
Execution terminated
Compilation successful
I checked the compiler settings in Dev-Cpp but they are alright. Re-
installation ( I have check the option to remove all the configuration files
while uninstalling...) too is not solving this problem. I think this has
something to do with setting the environment variables and paths.... please
help..