Share via


strings.h not found

Question

Friday, June 2, 2017 4:14 PM

I am using VS 2017 Community. I installed Desktop Component with C++ and Universal CRT SDK.  In my project I selected Windows SDK Version 10.0.10586.0 using the pull down.

For every one of the 200 C routines compiled I get

'strings.h': No such file or directory.

Clearly there is some environment variable or file assignment that I don't have right, but I don't know enough to fix it.  I am normally using FORTRAN under VS so I don't really have much C experience.  Please advise.

All replies (4)

Friday, June 2, 2017 4:22 PM

'strings.h': No such file or directory.

Thats because the header is "string.h"


Friday, June 2, 2017 4:57 PM

In the project's properties select "VC++ Directories". What is in "Include Directories"? Does it look like:

$(VC_IncludePath);$(WindowsSDK_IncludePath);

If not then tell us what is there.

I don't know what "Desktop Component with C++ and Universal CRT SDK" is. I assume the problem is related to it. I do not have a "string.h" or "strings.h" in my system. Prior to when the C++ Standard classes were standardized the "string" header was called "string.h" but I assume that is not relevant here.

What happens when you select "New" | "Project" then in the "New Project" window select "Visual C++" | "Windows" | "Win32" and then create a console project? Does it compile?

Sam Hobbs
SimpleSamples.Info


Friday, June 2, 2017 5:06 PM

From the Microsoft header that was installed in the folder for the UCRT headers.   -

//
// string.h
//
//      Copyright (c) Microsoft Corporation. All rights reserved.
//
// The C Standard Library <string.h> header.
//
#pragma once
#define _INC_STRING

#include <corecrt.h>
#include <corecrt_memory.h>
#include <corecrt_wstring.h>
#include <vcruntime_string.h>

..
snip rest of header

Monday, June 5, 2017 7:58 AM

Hi MotoMorgan,

Welcome to the MSDN forum.

>> For every one of the 200 C routines compiled I get

Did you meet the issue when you directly build the new UWP project?

It looks like there has a header file ‘string.h’ and not the ‘strings.h’, and this header file belongs to the SDK and when you installed Universal CRT SDK or windows 10 SDK, the ‘string.h’ should display under like this path: C:\Program Files (x86)\Windows Kits\10\Include\xxxx\ucrt and I checked it on my side.

Meanwhile, you can modify the VS 2017 installer to install other windows 10 SDK version, then reopen this project to change its default platform version or create a new project with other SDK version, check if this issue persists or not.

Best regards,

Sara

MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact [email protected].