Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation error on Windows 10 #49

Closed
dumganhar opened this issue Mar 23, 2017 · 13 comments
Closed

Compilation error on Windows 10 #49

dumganhar opened this issue Mar 23, 2017 · 13 comments

Comments

@dumganhar
Copy link
Contributor

FindFirstFile function is missing on Windows 10.

@cxong
Copy link
Owner

cxong commented Mar 23, 2017

Hi @dumganhar , can you please try compiling one of the examples, to see if any one fails. If so, could you please provide:

  • the full error log
  • your version of Windows
  • your compiler/IDE version

@ArashBaba
Copy link

@dumganhar @cxong
Hi when compiling windows 10 Uwp helloworld for cocos2d-x V3.15 i get this error:

1>------ Build started: Project: libcocos2d, Configuration: Debug Win32 ------
1>CCFileUtils.cpp
1>C:\Users\arash\Documents\CocosProjects\AAAAA\cocos2d\external\tinydir/tinydir.h(297): error C3861: 'FindFirstFile': identifier not found
1>Done building project "libcocos2d.vcxproj" -- FAILED.
2>------ Build started: Project: AAAAA, Configuration: Debug Win32 ------
2>LINK : fatal error LNK1181: cannot open input file 'C:\Users\arash\Documents\CocosProjects\AAAAA\proj.win10\Debug\libcocos2d\libcocos2d_v3.15_Windows_10.0.lib'
2>Done building project "AAAAA.vcxproj" -- FAILED.
========== Build: 0 succeeded, 2 failed, 4 up-to-date, 0 skipped ==========
========== Deploy: 0 succeeded, 0 failed, 0 skipped ==========
\cocos2d\external\tinydir/tinydir.h(297): error C3861: 'FindFirstFile': identifier not found

Windows 10 1607

Visual Studio 2017

@lautis0503
Copy link
Collaborator

Not tested for UWP yet.

@cxong
Copy link
Owner

cxong commented Mar 27, 2017

Looks like UWP uses a completely different API. I imagine adding to tinydir will make it 50% bigger (so that it supports dirent, FindFirstFile, StorageFolder). Also it's an asynchronous API so I'm not sure how it's going to work with tinydir's existing API.

Patches welcome 😄

@dumganhar
Copy link
Contributor Author

@cxong , I fixed this issue at #50
Please review. Thanks.
I tested it on win32 and win10, it works well.

@cxong
Copy link
Owner

cxong commented Mar 27, 2017

@dumganhar can you please provide your compiler settings and output? If your patch fixes it then it sounds like a different problem than the one @ArashBaba described. Also I've compiled tinydir under windows 10 and Visual Studio 2017 without problems, so I'm not 100% sure it's purely a windows 10 thing. I can't find a reference online saying that FindFirstFile is missing on windows 10.

@dumganhar
Copy link
Contributor Author

@cxong , in fact, I got the same compile error as @ArashBaba got.
I will check the compile flag tomorrow.

@cxong
Copy link
Owner

cxong commented Mar 27, 2017

Are you compiling against windows phone 8? The requirements for FindFirstFile and FindFirstFileEx are identical except that the latter supports Windows Phone too.

@lautis0503
Copy link
Collaborator

lautis0503 commented Mar 27, 2017

@dumganhar So you replace FindFirstFile with FindFirstFileEx? This will drop the support of Windows 95/98 and something about Windows Phone that @cxong had said.

@cxong
Copy link
Owner

cxong commented Mar 28, 2017

Sounds like this problem is similar: http://stackoverflow.com/q/32240164/2038264 Unfortunately in that question OP also did not specify their specific compiler settings.

I'm happy to accept this fix but not before understanding what exactly we're fixing; I wasn't aware that tinydir worked under Win 95/98 at all 😄 but I don't think they're important, WinXP+ should be fine. If anyone wants to support Win 95/98 I guess they can submit patches, I don't have access to those so I can't maintain it.

@lautis0503
Copy link
Collaborator

lautis0503 commented Mar 28, 2017

Example 2 just works fine in Windows 95/98(Ansi only) using MINGW now. But it's not important as you said.
I found something that may be to blame.
https://msdn.microsoft.com/en-us/library/windows/apps/mt644399.aspx
FindFirstFile is available in Windows 10.0.14393.0 while FindFirstFileEx in Windows 10.0.10240.0.
Guess this is an issue of Windows SDK version.

@cxong
Copy link
Owner

cxong commented Mar 28, 2017

14393 is Windows 10 Anniversary Update.

@cxong cxong closed this as completed in d5a460c Mar 29, 2017
lautis0503 added a commit to lautis0503/tinydir that referenced this issue Jul 13, 2017
lautis0503 added a commit to lautis0503/tinydir that referenced this issue Jul 13, 2017
lautis0503 added a commit to lautis0503/tinydir that referenced this issue Jul 13, 2017
@lautis0503
Copy link
Collaborator

lautis0503 commented Jul 13, 2017

#51 would be a better way to fix this issue. Wait for further tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants