Search code examples
ccmakefseekcmake-guiunistd.h

not found in CMake in Win10


I am using CMake GUI for renderdoc and I get these messages. How should I fix them?

The C compiler identification is MSVC 19.0.24215.1
Check for working C compiler: D:/VS15/VC/bin/x86_amd64/cl.exe
Check for working C compiler: D:/VS15/VC/bin/x86_amd64/cl.exe -- works
Detecting C compiler ABI info
Detecting C compiler ABI info - done
Looking for sys/types.h
Looking for sys/types.h - found
Looking for stdint.h
Looking for stdint.h - found
Looking for stddef.h
Looking for stddef.h - found
Check size of off64_t
Check size of off64_t - failed
Looking for fseeko
Looking for fseeko - not found
Looking for unistd.h
Looking for unistd.h - not found
Configuring done

Solution

  • You don't say what the CMake command was, but it looks like you are configuring for a Visual Studio build. It also seems to have worked, it's just telling you what it did and did not find on the system, which is a normal part of any configuration process (autotools or CMake).

    Visual C++ doesn't provide unistd.h, there are other headers you might need to include, but it depends what you need. As for off64_t, that's a POSIX type, and again, it's not provided by compiler.

    Does your code actually require these headers or types, or will it compile anyway? If the code doesn't use the headers or types, it doesn't matter if they're not found at configuration time.

    If that fails, you either need to provide your own implementations of what is needed, modify the source to be more portable, or switch to GCC and mingw or some other toolchain which does provide these things.