Thread: [Dev-C++] Thanks and Another question (windows/linux)
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Pukara R. <puk...@ya...> - 2003-08-02 12:52:10
|
Thank you for helping me. Yes actualy the file contains the following: #ifdef linux #include <stdio.h> #endif which I guess means the include is done only for linux but since I wortk for windows... I wonder why the designers of that system put that line. Any idea...? Since this is the first time I work withprogramming in windows I have none. Anyway I send a message asking that to the designers of the system. I hope they answer as fast as you. Thank you very much.. ---------------------------------------------------------------------------------------------------------------- Another question. In another file called arutils.h I got #ifdef WIN32 #include <sys/timeb.h> #endif #ifdef linux #include <sys/time.h> #include <unistd.h> #endif and as a result I got an error message saying that: C:\\PROGRA~1\\ACTIVM~1\\ARIA\\include\\ariaUtil.h:558: `time_t' was not declared in this scope Can someone tell me about these library details diferences in windows and linux??? Thanks a lot!!! --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software |
|
From: <or...@vp...> - 2003-08-02 19:32:40
|
Pukara Rob wrote: > Thank you for helping me. > Yes actualy the file contains the following: > > > #ifdef linux > #include <stdio.h> > #endif > > which I guess means the include is done only for linux but since I wortk > for windows... > I wonder why the designers of that system put that line. Any idea...? I dunno. What exactly is this library, that you are working with? > ---------------------------------------------------------------------------------------------------------------- > Another question. In another file called arutils.h I got > > #ifdef WIN32 > #include <sys/timeb.h> > #endif > #ifdef linux > #include <sys/time.h> > #include <unistd.h> > #endif > > and as a result I got an error message saying that: > > C:\\PROGRA~1\\ACTIVM~1\\ARIA\\include\\ariaUtil.h:558: `time_t' was not > declared in this scope > Can someone tell me about these library details diferences in windows > and linux??? Yes, as you see, it tells you, that time_t is not declared. Which means, that (assuming you have -DWIN32 on command line) sys/timeb.h is not going to be good for you. I suppose, that they used MSVC for the library's Windows port, and probably sys/timeb.h worked well for them. It is only my guess though. Anyway, if you look at <sys/time.h>, you'll notice, that it actually includes <time.h>, which has time_t. So what you need is: <sys/time.h> I guess you already noticed all the above, as you asked about the difference details. I cannot tell you that, as I have never worked with time stuff under linux. Maybe a linux guru here can tell you more. I hope this helps. -- Greetings, Balázs |
|
From: Pukara R. <puk...@ya...> - 2003-08-03 15:31:54
|
Thank you for the quick answer: >I dunno. >What exactly is this library, that you are working with? Well it says: ArLog is a utility class to log all messages from Aria to a choosen destintation. Messages can be logged to stdout, stderr, a file, and turned off completely. Logging by default is set to stdout. The level of logging can be changed as well. Allowed levels are Terse, Normal, and Verbose. By default the level is set to Normal. Aria is the system I am using. \\\\\\\\\\\\\\\\\\\\\\\\\\\ Since you have worked in windows, could you tell me: time_t or this kind of things are not used in windows? I asked because I open both files: time.h and timeb.h and while time.h seems very complete (with the definition of time_t for instance) , timeb.h seems incomplete. Is there a equivalent of time_t for windows. Is the file timeb.h correct? Or for that matter should I cheat the compiler and make it think we are in windows....hummm. I am confused. Are those files complete? Sorry for so many questions, it is that I want to start working already and I am stuck in the no compilation problem and the Aria guys dont answer me yet :( thanks a lot OROSZI_Bal#30169;s <or...@vp...> wrote: Yes, as you see, it tells you, that time_t is not declared. Which means, that (assuming you have -DWIN32 on command line) sys/timeb.h is not going to be good for you. I suppose, that they used MSVC for the library's Windows port, and probably sys/timeb.h worked well for them. It is only my guess though. Anyway, if you look at , you'll notice, that it actually includes , which has time_t. So what you need is: I guess you already noticed all the above, as you asked about the difference details. I cannot tell you that, as I have never worked with time stuff under linux. Maybe a linux guru here can tell you more. I hope this helps. -- Greetings, Bal#30169;s ------------------------------------------------------- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 _______________________________________________ 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 --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software |
|
From: Abhijit S. <mu...@gm...> - 2003-08-03 18:02:23
|
> Since you have worked in windows, could you tell me: time_t or this kind
of things are not used > in windows? I asked because I open both files:
time.h and timeb.h and while time.h seems very
> complete (with the definition of time_t for instance) , timeb.h seems
incomplete. Is there a
> equivalent of time_t for windows. Is the file timeb.h correct? Or for that
matter should I
> cheat the compiler and make it think we are in windows....hummm. I am
confused. Are those files
> complete? Sorry for so many questions, it is that I want to start working
already and I am
> stuck in the no compilation problem and the Aria guys dont answer me yet
:(
Hello, Pukara.
Try #including <time.h> before all your Aria headers. <time.h> is ANSI, and
is portable. I don't know why they've decided not to work with it on
Windows, but you can try it out anyway.
Specifically:
* time_t is legal.
* timeb.h is the header for the Unix ftime() function, and is not ANSI.
Here's a dump of what my reference says about ftime():
-- Cut here --
Syntax
#include <sys\timeb.h>
void ftime(struct timeb *buf)
Description
Stores current time in timeb structure.
On UNIX platforms ftime is available only on System V systems.
ftime determines the current time and fills in the fields in the timeb
structure pointed to by buf. The timeb structure contains four fields: time,
millitm, _timezone, and dstflag:
struct timeb {
long time ;
short millitm ;
short _timezone ;
short dstflag ;
};
time provides the time in seconds since 00:00:00 Greenwich mean time (GMT)
January 1 1970.
millitm is the fractional part of a second in milliseconds.
_timezone is the difference in minutes between GMT and the local time. This
value is computed going west from GMT. ftime gets this field from the global
variable _timezone which is set by tzset.
dstflag is set to nonzero if daylight saving time is taken into account
during time calculations.
Note: ftime calls tzset. Therefore it isn't necessary to call tzset
explicitly when you use ftime.
Return Value
None.
Borland C++ 5.0 Programmer's Guide
-- Cut here --
--
Abhijit Shylanath
Homepage: http://mudeth.tripod.com/
|
|
From: Pukara R. <puk...@ya...> - 2003-08-04 12:25:18
|
Thank you very much for all your answers.
By the way, about the stdio.h file. I think it is pretty neccessary so I am wondering why these guys chose to leave it out? Has any one of you worked with Visual C++? Is there a replacemente for the standard stdio.h there? I asked because the Aria guys provided some project files for VC but since I work with DevC++...
About the ..
#ifdef SOMETHING
.......
#endif
how do I define and undefine something from the compiling environment. I am trying to force it compile because I have lost too much time already.
By the way ARIA is the name of a control system for Pioneer robots.
Abhijit Shylanath <mu...@gm...> wrote:
> Since you have worked in windows, could you tell me: time_t or this kind
of things are not used > in windows? I asked because I open both files:
time.h and timeb.h and while time.h seems very
> complete (with the definition of time_t for instance) , timeb.h seems
incomplete. Is there a
> equivalent of time_t for windows. Is the file timeb.h correct? Or for that
matter should I
> cheat the compiler and make it think we are in windows....hummm. I am
confused. Are those files
> complete? Sorry for so many questions, it is that I want to start working
already and I am
> stuck in the no compilation problem and the Aria guys dont answer me yet
:(
Hello, Pukara.
Try #including before all your Aria headers. is ANSI, and
is portable. I don't know why they've decided not to work with it on
Windows, but you can try it out anyway.
Specifically:
* time_t is legal.
* timeb.h is the header for the Unix ftime() function, and is not ANSI.
Here's a dump of what my reference says about ftime():
-- Cut here --
Syntax
#include
void ftime(struct timeb *buf)
Description
Stores current time in timeb structure.
On UNIX platforms ftime is available only on System V systems.
ftime determines the current time and fills in the fields in the timeb
structure pointed to by buf. The timeb structure contains four fields: time,
millitm, _timezone, and dstflag:
struct timeb {
long time ;
short millitm ;
short _timezone ;
short dstflag ;
};
time provides the time in seconds since 00:00:00 Greenwich mean time (GMT)
January 1 1970.
millitm is the fractional part of a second in milliseconds.
_timezone is the difference in minutes between GMT and the local time. This
value is computed going west from GMT. ftime gets this field from the global
variable _timezone which is set by tzset.
dstflag is set to nonzero if daylight saving time is taken into account
during time calculations.
Note: ftime calls tzset. Therefore it isn't necessary to call tzset
explicitly when you use ftime.
Return Value
None.
Borland C++ 5.0 Programmer's Guide
-- Cut here --
--
Abhijit Shylanath
Homepage: http://mudeth.tripod.com/
---------------------------------
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software |
|
From: <or...@vp...> - 2003-08-04 12:54:01
|
Pukara Rob wrote: > By the way, about the stdio.h file. I think it is pretty neccessary so I > am wondering why these guys chose to leave it out? Has any one of you > worked with Visual C++? Is there a replacemente for the standard stdio.h > there? I asked because the Aria guys provided some project files for VC > but since I work with DevC++... > > About the .. > > #ifdef SOMETHING > ....... > #endif > > how do I define and undefine something from the compiling environment. I > am trying to force it compile because I have lost too much time already. > > By the way ARIA is the name of a control system for Pioneer robots. VC++ project files have nothing to do with includes, as they don't contain any. They may only contain defines, but they are imported by dev anyway (I assume, that you used the import function of dev, no?). I think, that the stdio.h file is the same in Dev-C++ (well, actually in MinGW) and both in VC++. So I really don't know what and why have they done. To define something globally, through the environment, you need to pass a flag to the compiler. It has the form: -DSOMETHING This will define SOMETHING for the currently compiled file. Add -DWHAT_YOU_WANT to the compiler flags in the Project options -> Parameters -> Compiler or C++ compiler. I hope this helps. Good luck! -- Greetings, Balázs |
|
From: Pukara R. <puk...@ya...> - 2003-08-05 10:20:21
|
Hello Thank you again for answering my question even the strangest ones :) Anyway, I am almost giving up in this compilation thing and thinking of going back to my old linux machine with the nice g++. It seems that the system (ARIA) works only for visual C++ 6.0 if in windows. So I tried to cheat the compiler into making it think we were in linux to see what happens. Then it said that several files are missing. Is Multithread supported by Dev C++?? Where are the multithread libraries?? If anyone has experience here with Visual C++ I would like to read its opijnion By the way what "import function of dev"? Thanks a lot! OROSZI_Bal#30169;s <or...@vp...> wrote: Pukara Rob wrote: > By the way, about the stdio.h file. I think it is pretty neccessary so I > am wondering why these guys chose to leave it out? Has any one of you > worked with Visual C++? Is there a replacemente for the standard stdio.h > there? I asked because the Aria guys provided some project files for VC > but since I work with DevC++... > > About the .. > > #ifdef SOMETHING > ....... > #endif > > how do I define and undefine something from the compiling environment. I > am trying to force it compile because I have lost too much time already. > > By the way ARIA is the name of a control system for Pioneer robots. VC++ project files have nothing to do with includes, as they don't contain any. They may only contain defines, but they are imported by dev anyway (I assume, that you used the import function of dev, no?). I think, that the stdio.h file is the same in Dev-C++ (well, actually in MinGW) and both in VC++. So I really don't know what and why have they done. To define something globally, through the environment, you need to pass a flag to the compiler. It has the form: -DSOMETHING This will define SOMETHING for the currently compiled file. Add -DWHAT_YOU_WANT to the compiler flags in the Project options -> Parameters -> Compiler or C++ compiler. I hope this helps. Good luck! -- Greetings, Bal#30169;s ------------------------------------------------------- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 _______________________________________________ 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 --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software |
|
From: <or...@vp...> - 2003-08-05 10:45:16
|
Pukara Rob wrote: > Anyway, I am almost giving up in this compilation thing and thinking of > going back to my old linux machine with the nice g++. It seems that the > system (ARIA) works only for visual C++ 6.0 if in windows. So I tried to > cheat the compiler into making it think we were in linux to see what > happens. Then it said that several files are missing. What exactly are the errors you get, if you use the system as intended (I mean for Windows). Why do you think it only works with VC++? What are the errors? > Is Multithread supported by Dev C++?? Where are the multithread libraries?? I don't know about this one. > By the way what "import function of dev"? It is in File->Import, which allows you to import (convert) VC++ 6 project files to Dev-C++ ones. Although, most of the time, you still need to clean up the result, but it does most of the work for you. -- Greetings, Balázs |
|
From: Abhijit S. <mu...@gm...> - 2003-08-05 17:38:44
|
> Is Multithread supported by Dev C++?? Where are the multithread > libraries?? Yes (not because of any magic by Dev - Windows natively supports multi-threading). Use CreateThread(). -- Abhijit Shylanath Homepage: http://mudeth.tripod.com/ |
|
From: <or...@vp...> - 2003-08-03 18:22:13
|
Pukara Rob wrote: > Since you have worked in windows, could you tell me: time_t or this kind > of things are not used in windows? I asked because I open both files: > time.h and timeb.h and while time.h seems very complete (with the > definition of time_t for instance) , timeb.h seems incomplete. Is there > a equivalent of time_t for windows. Is the file timeb.h correct? Or for > that matter should I cheat the compiler and make it think we are in > windows....hummm. I am confused. Are those files complete? Sorry for so > many questions, it is that I want to start working already and I am > stuck in the no compilation problem and the Aria guys dont answer me yet :( Simply include <time.h> or <sys/time.h>, it's all the same, as <sys/time.h> actually includes only <time.h> That's all you need to do. Change the Aria headers directly, or make the time.h include yourself, before the Aria includes. Anyway, what is this "Aria" system, that you use? -- Greetings, Balazs |