Link to home
Start Free TrialLog in
Avatar of tatikor_143
tatikor_143

asked on

Unistd.h header file in Visual Studio 2005

Hi,

I recently installed Visual Studio 2005 and trying to bulid an apllication and the application contains a header file called as unistd.h and when I compile the code it says..Unistd.h header file is missing...

I checked it in the standard system directories but there is no such file and when I comiple the code commenting the above header file..I am not getting the desire output..

Please let me know how to add this into the system directories and get mu code compiled..

Thanks in advance..

Avatar of Jaime Olivares
Jaime Olivares
Flag of Peru image

inside your project settings, you have to specify an additional include folder, where the mentioned file is located.
Avatar of Infinity08
unistd.h is pretty much UNIX/Linux specific ... where did you get this source, and what do you want to do with it (on a Windows system) ?
Avatar of tatikor_143
tatikor_143

ASKER

Hi Infinity,

We already worked on this once..Just to recollect ,there was an application of mine which is used to convert th binary format to ascii format.The question could be in your database and it also contains the code...

Could you please look inti it once and I am confident that U are the right person ton help me out.

thanks in advance
I participate in dozens of questions daily, so I can't find the question you're referring to ... Can you post the link ?
You can simply comment the #include <unistd.h>, compile and post the compile errors you'll get now (if at all). Then, we know what unix-specific code you were using.

Regards, Alex
Hi Infinity,

Here is the link to that question
https://www.experts-exchange.com/questions/22110125/Porting-from-unix-to-windows.html

It contains the entire source code for my application and it clearly explains why unistd.h header file is used.

Thanks
Wow, no wonder I didn't remember ... that was more than 10 months ago heh.

Which of the functions from unistd.h are you using in your code ?

        http://www.opengroup.org/onlinepubs/007908775/xsh/unistd.h.html

Part of these will have to be ported to Visual C++ on Windows.
Hi Infinity,

I think there is a problem with the time.h header file..When I comment out the unistd.h header file and compile it the it throws the following error..

Debug Assertion Failed..
File : strftime.c


Expression ((timeptr ->tm_mday>=1)&&( timeptr->tm_mday<=31)

I included time.h header file and the lines of code that use above library function is

_gmtime32_s(&theTime, &(pReport->timeStamp));
      strftime(timeString,  sizeof(timeString), "%d/%m/%Y %H:%M:%S", &theTime);

If we can resolve this error...then the application may work fine..

Thanks
ASKER CERTIFIED SOLUTION
Avatar of Infinity08
Infinity08
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Infinity,

U are genius....Its working fine now after the above changes..

Can u explain me what happens if I declare it as only time32_t timeStamp;

Thanks in Advance..
>> Can u explain me what happens if I declare it as only time32_t timeStamp;

time32_t is probably not the same as __time32_t. The latter is what _gmtime32_s expects.
Take a look here for more info on _gmtime32_s :

        http://msdn2.microsoft.com/en-us/library/3stkd9be(VS.80).aspx