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

Cmake build failed with v140_xp, v141_xp toolset flags #1790

Closed
wwriter opened this issue Jan 8, 2021 · 4 comments
Closed

Cmake build failed with v140_xp, v141_xp toolset flags #1790

wwriter opened this issue Jan 8, 2021 · 4 comments

Comments

@wwriter
Copy link

wwriter commented Jan 8, 2021

First of all, thank you for providing and maintaining this nice library.
I am posting this to ask if there's some way to build spdlog with _xp toolset flag.

When I use this script to build spdlog

cmake -T v141_xp (or v140_xp) ... (other flags) ..
cmake --build . --config Debug (or Release)

I got this error message.

stdout_sink-inl.h (18) fileapi.h : no such file or directory

So I opened the inl file and found these lines.

#ifdef _WIN32
// under windows using fwrite to non-binary stream results in \r\r\n (see issue #1675)
// so instead we use ::FileWrite
#include <spdlog/details/windows_include.h>
#include <fileapi.h> // WriteFile (..) //< ******this seemed to cause the error*******
#include <io.h>      // _get_osfhandle(..)
#include <stdio.h>   // _fileno(..)
#endif               // WIN32

After doing some tests, I figured out that one cannot include fileapi.h when the version of Windows SDK for the project is set to 7.
Then I changed the code somewhat like this and was able to get the lib file.

#ifdef _WIN32
// ... 
#ifndef _USING_V110_SDK71_
#include <fileapi.h> // WriteFile (..) //< ******this seemed to cause the error*******
#endif
// ...
#endif               // WIN32

My question is, is there any flag or option that I can set to build a lib for Windows xp?

@gabime
Copy link
Owner

gabime commented Jan 8, 2021

No, WinXP is not supported.

@wwriter
Copy link
Author

wwriter commented Jan 8, 2021

I thought it might support windows xp because earlier today, I found some questions about crashes on windows xp or whatnot.
Anyway, thanks for your quick response !

@wwriter wwriter closed this as completed Jan 8, 2021
@swex
Copy link

swex commented Mar 2, 2021

@wwriter If you just remove #include fileapi.h it would compile and work just ok.
btw @gabime why windows xp is not supported anyway?

@gabime
Copy link
Owner

gabime commented Mar 2, 2021

It didn't compile cleanly and I have no time to support it.
Prs are welcome to make it work.

LonghronShen added a commit to LonghronShen/spdlog that referenced this issue Apr 5, 2021
gabime added a commit that referenced this issue Apr 8, 2021
swex pushed a commit to swex/spdlog that referenced this issue Jul 4, 2021
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

3 participants