0

I'm trying to move a code from linux to windows to use it in Visual Studios. The first problem I came across was was that unistd.h didn't exist. Should have seen that coming. So try to see if there's a windows equivalent and I stumble across this:

Is there a replacement for unistd.h for Windows (Visual C)?

Following this example, I create put the code in a unistd.h file for the code, but notice it depends on getopt.h, so I follow another link to the github page and put that code in a getopt.h file. When I try to run the code, I get an error "a value of type "const char*" cannot be used to initalize an entity of type 'char*'", for getopt.h. Why is this happening? How would I go about dealing with the issue? Thanks!

Jazael
  • 51
  • 2
  • 9
  • 3
    Maybe it could be easier to tell us what you are trying to do, so we could point you to the right header to include instead. Sometime, you need to use OS defining macros see https://stackoverflow.com/questions/142508/how-do-i-check-os-with-a-preprocessor-directive – Vuwox Mar 03 '19 at 05:06
  • I was basically just trying to find a substitute for unistd.h, and that led me to getopt. – Jazael Mar 03 '19 at 05:20
  • 2
    I understand. But some others OS (like Windows) specific header might offer what you need. What are you trying to do in the code? Can you provide the code? – Vuwox Mar 03 '19 at 05:29

0 Answers0