Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8719611
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T06:50:24+00:00 2026-06-13T06:50:24+00:00

First, by windows unistd.h, I mean the example located here: is there a replacement

  • 0

First, by “windows unistd.h”, I mean the example located here: “is there a replacement for unistd.h for windows?

I am attempting to massage knetfile.c so that it can be compiled for windows64. My first step was to remove the unistd.h include, because it is not available on windows.

fatal error C1083: Cannot open include file: ‘unistd.h’: No such file or directory

So, I figured I’d roll the dice with the drop-in replacement linked to above. However, this is clearly not working, as I now get a whole series of errors and warnings:

knetfile.c(189): error C2036: ‘void *’ : unknown size
knetfile.c(236): warning C4267: ‘function’ : conversion from ‘size_t’ to ‘int’, possible loss of data

knetfile.c(264): warning C4244: ‘=’ : conversion from ‘SOCKET’ to ‘int’, possible loss of data

knetfile.c(271): warning C4244: ‘=’ : conversion from ‘SOCKET’ to ‘int’, possible loss of data

knetfile.c(300): warning C4244: ‘=’ : conversion from ‘__int64’ to ‘int’, possible loss of data

knetfile.c(335): error C2143: syntax error : missing ‘;’ before ‘const’

knetfile.c(336): error C2065: ‘p’ : undeclared identifier

knetfile.c(336): error C2100: illegal indirection

knetfile.c(336): error C2065: ‘p’ : undeclared identifier

knetfile.c(337): error C2065: ‘p’ : undeclared identifier

knetfile.c(337): error C2100: illegal indirection

knetfile.c(337): error C2065: ‘p’ : undeclared identifier

knetfile.c(337): error C2100: illegal indirection

knetfile.c(337): error C2065: ‘p’ : undeclared identifier

knetfile.c(338): error C2065: ‘p’ : undeclared identifier

knetfile.c(338): warning C4047: ‘function’ : ‘const char *’ differs in levels of indirection from ‘int’

knetfile.c(338): warning C4024: ‘strtoint64’ : different types for formal and actual parameter 1

knetfile.c(378): warning C4244: ‘=’ : conversion from ‘__int64’ to ‘int’, possible loss of data

knetfile.c(410): warning C4244: ‘=’ : conversion from ‘SOCKET’ to ‘int’, possible loss of data

knetfile.c(430): warning C4244: ‘initializing’ : conversion from ‘int64_t’ to ‘off_t’, possible loss of data

knetfile.c(520): error C2036: ‘void *’ : unknown size

knetfile.c(537): warning C4244: ‘function’ : conversion from ‘int64_t’ to ‘long’, possible loss of data

knetfile.c(544): warning C4244: ‘return’ : conversion from ‘int64_t’ to ‘off_t’, possible loss of data

knetfile.c(553): warning C4244: ‘return’ : conversion from ‘int64_t’ to ‘off_t’, possible loss of data

knetfile.c(565): warning C4244: ‘return’ : conversion from ‘int64_t’ to ‘off_t’, possible loss of data

I imagine there is a small group of macros or typedefs missing that would clear this up. Any suggestions?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T06:50:26+00:00Added an answer on June 13, 2026 at 6:50 am

    The first error

    knetfile.c(189): error C2036: ‘void *’ : unknown size

    is simply correct, and the code is wrong. No amount of tinkering with header files is going to change the fact that you cannot do pointer arithmetic on void pointers.

    The fifth error

    knetfile.c(335): error C2143: syntax error : missing ‘;’ before ‘const’

    is also correct. In C all declarations must be at the beginning of a block before any statements. Possibly that changed with C99, but Microsoft compilers don’t support C99.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When Windows Workflow first came out there were some articles that suggested that it
I'm creating my first Windows Forms Application, and one requirement is that there is
This is my first windows application. I have published my project and here are
So here I am, first time windows developer (done java swing, iphone, flash/flex) and
First of all, I'm using Windows, just to make that clear. I am using
I'm at my first windows phone 7 app that uses databases. I've created a
I've written my first windows service in .Net. Can I communicate with this service
Im building my first Windows Service. It's a component that connects to a mailbox
I am writing my first windows ce app. I am using an xml file
I just got setup on my first Windows Server 2008 / IIS7.5 server for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.