question

LucaBernabei-3190 avatar image
0 Votes"
LucaBernabei-3190 asked GuidoFranzke commented

Visual C++ impossible open fnmatch.h

Hi,
I am using Visual studio community 2019 version 16.9.4.
There is an error in my visual C++ project: impossible open #include <fnmatch.h> (Error code E1696).
Do you know that issue ?

Best regards
Luca

c++
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

LucaBernabei-3190 avatar image
0 Votes"
LucaBernabei-3190 answered GuidoFranzke commented

I'd like to create a Visual C++ project based on this project: https://github.com/binance-exchange/binacpp.

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Ok. I looked at the code. It looks as if it was made for Unix/Linux.
Github provides so called master include sources: fnmatch.h: fnmatch.h
So you must somehow build a github lib. You could ask in the github community: github.community

Another way would be: delete all the #include lines that are not present in Visual C++. Then let the compiler complain, which functions and classes are unknown (they would be declared in the deleted include files). So you must search for a corresponding functionality or implement their functionality on your own.

Regards, Guido

0 Votes 0 ·
LucaBernabei-3190 avatar image
0 Votes"
LucaBernabei-3190 answered GuidoFranzke commented

Guido, thank you very much for your support.

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

You are welcome.

0 Votes 0 ·
LucaBernabei-3190 avatar image
0 Votes"
LucaBernabei-3190 answered GuidoFranzke commented

Hi,
is the best way substitute the file or there is another way ?

Best regards
Luca

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Again: why do you want to use the file? Which classes or functions are in the file that you need? There is a Linux header file fnmatch.h, but it doesn't exist in Windows. So why do you want to use the file, if it is not your own code or a known library?

I suggest, you could delete the include in your source file. Then tell us, which classes or functions are missing.

0 Votes 0 ·
LucaBernabei-3190 avatar image
0 Votes"
LucaBernabei-3190 answered GuidoFranzke commented

Hi Guido,
the file fnmatch.h is not present in the directory: C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0.
It is very strange.

Best regards
Luca

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

fnmatch.h is not a Standard include file. It is a third-party or self-developed source file.
Why do you use it in your code?

0 Votes 0 ·
JeanineZhang-MSFT avatar image
0 Votes"
JeanineZhang-MSFT answered

Hi,

As far as I'm concerned, fnmatch is not available in windows. And I suggest you could try to use PathMatchSpecA function (shlwapi.h) to instead of it.

I suggest you could refer to the thread: https://stackoverflow.com/questions/35877738/windows-fnmatch-substitute

Best Regards,

Jeanine



If the response is helpful, please click "Accept Answer" and upvote it.

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Viorel-1 avatar image
0 Votes"
Viorel-1 answered

It seems that you included to your project a non-standard or third-party header file, which sometimes can be replaced with PathMatchSpec function in Window: https://www.bing.com/search?q=fnmatch.h.


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

GuidoFranzke avatar image
0 Votes"
GuidoFranzke answered

Hello,
you must check your include directories in the project settings. In which directory is the file fnmatch.h? You must add this directory to your include directories.
Regards, Guido

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.