From: Mohamed A. <mh...@gm...> - 2011-01-09 08:21:19
|
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: *** ["../Users/Mohamed Elhady/AppData/Local/Temp/node.o"] Error 1 Execution terminated |
From: Derek C. <de...@ci...> - 2011-01-09 12:08:05
|
struct timezone is obsolete and shouldn't be used. See http://www.delorie.com/gnu/docs/glibc/libc_442.html for replacement facilities. On 9 January 2011 08:21, Mohamed Ayed <mh...@gm...> wrote: > 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: *** ["../Users/Mohamed Elhady/AppData/Local/Temp/node.o"] Error 1 > > Execution terminated > > > ------------------------------------------------------------------------------ > Gaining the trust of online customers is vital for the success of any > company > that requires sensitive data to be transmitted over the Web. Learn how to > best implement a security strategy that keeps consumers' information secure > and instills the confidence they need to proceed with transactions. > http://p.sf.net/sfu/oracle-sfdevnl > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > |
From: Michal M. <mol...@se...> - 2011-01-09 13:23:50
|
Hello, struct timezone is in sys/time.h . The rest is not anywhere, because mingw (dev-c++'s compiler) does not contain posix emulation layer. Either use e.g. cygwin or rewrite the code to use winapi functions. Regards, Michal Dne Ne 9. ledna 2011 09:21:12 Mohamed Ayed napsal(a): > 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: *** ["../Users/Mohamed Elhady/AppData/Local/Temp/node.o"] Error 1 > > Execution terminated |
From: Mohamed a. <mh...@gm...> - 2011-01-09 20:23:54
|
I ran this program ok on my solaris box using gcc but when I used it on my Vista server it created some issues which I have resolved except this one. I want to use Dev C++ but I want to be able able to go across platforms . is there a replacement for this function . This is part of my reseach paper on Cognitive radio technology and felxability will be a big advanatge. Thank you in advance. Thanks Mohamed On Jan 9, 2011, at 8:02 AM, Michal Molhanec <mol...@se...> wrote: > Hello, > struct timezone is in sys/time.h . > The rest is not anywhere, because mingw (dev-c++'s compiler) does > not contain > posix emulation layer. Either use e.g. cygwin or rewrite the code to > use > winapi functions. > Regards, > Michal > > Dne Ne 9. ledna 2011 09:21:12 Mohamed Ayed napsal(a): >> 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: *** ["../Users/Mohamed Elhady/AppData/Local/Temp/node.o"] >> Error 1 >> >> Execution terminated |
From: Mohamed A. <mh...@gm...> - 2011-01-10 00:09:01
|
Hi, I have downloaded the following library to fix the problem below but really have no idea who to get in action. I would really apreciate your help. http://gnuwin32.sourceforge.net/packages/libgw32c.htm Mohamed On Sun, Jan 9, 2011 at 3:21 AM, Mohamed Ayed <mh...@gm...> wrote: > 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: *** ["../Users/Mohamed Elhady/AppData/Local/Temp/node.o"] Error 1 > > Execution terminated > > |
From: Mohamed A. <mh...@gm...> - 2011-01-10 05:18:55
|
I am getting the following when compiling the program...I have copied the file to the BIN directory and the LIB directory is in the library path for the compiler .... * Compiler: Default compiler Building Makefile: "C:\Dev-Cpp\Makefile.win" Executing make... make.exe -f "C:\Dev-Cpp\Makefile.win" all gcc.exe node.o -o "Project1.exe" -L"C:/Dev-Cpp/lib" -L"C:/Dev-Cpp/libexec" -L"C:/Dev-Cpp/bin" -L"C:/GetGnuWin32/gnuwin32/lib" -L"C:/GetGnuWin32/gnuwin32/libexec" -L"C:/GetGnuWin32/gnuwin32/include" ld: crt2.o: No such file: No such file or directory make.exe: *** [Project1.exe] Error 1 Execution terminated * On Sun, Jan 9, 2011 at 7:08 PM, Mohamed Ayed <mh...@gm...> wrote: > Hi, > > I have downloaded the following library to fix the problem below but really > have no idea who to get in action. I would really apreciate your help. > > > http://gnuwin32.sourceforge.net/packages/libgw32c.htm > > Mohamed > > > On Sun, Jan 9, 2011 at 3:21 AM, Mohamed Ayed <mh...@gm...> wrote: > >> 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: *** ["../Users/Mohamed Elhady/AppData/Local/Temp/node.o"] Error >> 1 >> >> Execution terminated >> >> > |
From: Mohamed A. <mh...@gm...> - 2011-01-14 20:21:53
|
I am not sure why it works on Solaris and not on windows. I know it is looking for some libraries and headers but I have included everything that I know. On Mon, Jan 10, 2011 at 12:18 AM, Mohamed Ayed <mh...@gm...> wrote: > I am getting the following when compiling the program...I have copied the > file to the BIN directory and the LIB directory is in the library path for > the compiler .... > * > > Compiler: Default compiler > Building Makefile: "C:\Dev-Cpp\Makefile.win" > Executing make... > make.exe -f "C:\Dev-Cpp\Makefile.win" all > gcc.exe node.o -o "Project1.exe" -L"C:/Dev-Cpp/lib" -L"C:/Dev-Cpp/libexec" > -L"C:/Dev-Cpp/bin" -L"C:/GetGnuWin32/gnuwin32/lib" > -L"C:/GetGnuWin32/gnuwin32/libexec" -L"C:/GetGnuWin32/gnuwin32/include" > > ld: crt2.o: No such file: No such file or directory > > make.exe: *** [Project1.exe] Error 1 > > Execution terminated > > * > > On Sun, Jan 9, 2011 at 7:08 PM, Mohamed Ayed <mh...@gm...> wrote: > >> Hi, >> >> I have downloaded the following library to fix the problem below but >> really have no idea who to get in action. I would really apreciate your >> help. >> >> >> http://gnuwin32.sourceforge.net/packages/libgw32c.htm >> >> Mohamed >> >> >> On Sun, Jan 9, 2011 at 3:21 AM, Mohamed Ayed <mh...@gm...> wrote: >> >>> 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: *** ["../Users/Mohamed Elhady/AppData/Local/Temp/node.o"] Error >>> 1 >>> >>> Execution terminated >>> >>> >> > -- Thanks Mohamed |