-2

I've inherited source code for a dll file that was originally written for linux. I'm using windows and visual studio and a change to linux is a no can-do, unfortunately. In particular, one of the classes requires unistd.h.

Since windows does not have anything like unistd.h, I tried implementing one in accordance with what was nicely written here.

I created a header file unistd.h and added it to the header files of my project (I also made a custom getopts, in accordance with this. Unfortunately, this hasn't fixed my problem by much - my code won't build, as I keep getting

Cannot open include file: 'unistd.h': No such file or directory

My custom unistd.h is among the header files of my solution, so I completely don't understand what's wrong. I've included it using

#include "unistd.h"

since it is a custom header.

Any suggestions and help will be appreciated. Thank you for the attention.

Community
  • 1
  • 1
Martin K
  • 43
  • 6

1 Answers1

0

It appears that all your header and source files should be in the same VS project folder - the original header and source files where on my computer in another folder and after creating a new project I used add existing item and found and chose them to add.

The unistd.h file I created later by adding a new item to the project - effectively both file groups where in two different places and that contributed to the fact that they didn't "see" the custom unistd.h. It wasn't a problem with the code or the way I included the header file, but with the placing of the files.

Martin K
  • 43
  • 6