including sys/resource.h

Started by
6 comments, last by Kevn 12 years, 3 months ago
I have a programming assignment that requires me to use a timer class that was pre-made and given to me. However, I can't compile it because I get error C1083: cannot open include file: 'resource.h' : no such file or directory.

I'm using visual studio 2010 and Windows 7. The include that is in question is
#include <sys/resource.h>

From searching google, all I have been finding is talk about compiling under unix/linux. Does anyone know if I should have this header in windows or if I need to find somewhere to download it.
Advertisement
What is the OS they use in class? Are they using UNIX/Linux to teach programming? If so, do you have telnet access to your class' computer to work over the net?

Odd, I have like a 100 copies of resource.h in the directx and Windows SDK include directories. Some of them are empty but it seems few are alike.

Resource.h usually defines the symbols used to convert an action (example, menu selection) to a number usable by the application.
Thank you for the response.
It is a class on data structures and algorithms, so we are supose to already know how to program meaning details on compilers and everything weren't specified. We were never told a compiler or operation system to use, but I know the programs are going to be graded on a linux machine using shell scripts. I didn't realise sys/resource was used by so many different libraries, I guess i'll try emailing the teacher.
In the operating systems course I attended, my professor used ftime (_ftime_s in MSVC) for timing functions. Perhaps you could do the same? If the professor requires you to only submit the source file (and not the timer files), then code your own timer class using whatever means you want, as long as its interface matches that of the Timer class you were given. If that were the case, then you might just as well use timeGetTime (include windows.h, link winmm.lib) ...
Thank you, that was a good idea but I just ran into some more problems with the other files we are required to use. Nothing I was given is compiling, it turns out I am supose to be using the school computers which run on a linux environment to compile these. I'm going to give cygwin a try and if that doesn't work i'll just go in and use the school computers monday.

Thank you, that was a good idea but I just ran into some more problems with the other files we are required to use. Nothing I was given is compiling, it turns out I am supose to be using the school computers which run on a linux environment to compile these. I'm going to give cygwin a try and if that doesn't work i'll just go in and use the school computers monday.


You should talk with your teacher/professor and see if there is ssh access to to the schools computers, that way you can work from home quite easily (At my uni we had 2 servers that we could access from home, one running Debian and one running Solaris), your university might also have a license for something like winaxe for the students to allow you to get X running at home.

Another fairly easy option is to simply download a Linux distribution and install it in for example VirtualBox (Far easier than messing with cygwin imo)
[size="1"]I don't suffer from insanity, I'm enjoying every minute of it.
The voices in my head may not be real, but they have some good ideas!

[quote name='Kevn' timestamp='1327080729' post='4904626']
Thank you, that was a good idea but I just ran into some more problems with the other files we are required to use. Nothing I was given is compiling, it turns out I am supose to be using the school computers which run on a linux environment to compile these. I'm going to give cygwin a try and if that doesn't work i'll just go in and use the school computers monday.


You should talk with your teacher/professor and see if there is ssh access to to the schools computers, that way you can work from home quite easily (At my uni we had 2 servers that we could access from home, one running Debian and one running Solaris), your university might also have a license for something like winaxe for the students to allow you to get X running at home.

Another fairly easy option is to simply download a Linux distribution and install it in for example VirtualBox (Far easier than messing with cygwin imo)
[/quote]

To the OP: I'd go with the former first. If they give ssh access, you can get that up and running in less than an hour. Setting up a linux box, even if it's just a partition on your existing box, could take much longer and there is a risk that may or may not be higher than on a windows machine if you don't know how to lock down a linux box.
Thanks for the advise, turns out there is ssh access. I've been using ssh access to their computers and everything is compiling fine now. Now i just need to get used to what works on linux vs what works on windows. Its like i'm relearning how to program in c++ :(

This topic is closed to new replies.

Advertisement