-
Notifications
You must be signed in to change notification settings - Fork 4.5k
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
Not compiling on Win10 with Cygwin #1347
Comments
FYI. There is not defined
Another way is to specify |
@frankkopp Please provide more details what is the problem and what is the workaround |
@tt4g I think I will fix spdlog's CMakeLists.txt and add |
@gabime I can't decide if that is a good solution. I have used MinGW a little with MSYS2. Also, I think MinGW and Cygwin have an ABI compatibility problem with the MSVC library.
However, MSYS2 provides the Based on these facts, I believe that the developer decides whether to use the POSIX API or the Windows API, depending on which platform the library built with MinGW or Cygwin is used. Fortunately, CMake can specify command line option |
I'm using CLION and cygwin (newest version incl. cmake and compiler). When I use the header files from the 1.x branch (or release tag 1.4.2) I get errors saying the include files are not found. I'm not very proficient in CMAKE - but docu says "just copy header files". Here the diff for my changes so my project compiles with the spdlog headers: |
There are a few things I noticed. Some files do not exist in the current master branch, Such as And most of the differences in |
I'm not very proficient in CMAKE and platform topics. But I know the CYGWIN defines __CYGWIN__. Googletest for example uses this: So I think the issue is not CMAKE or CYGWIN but it is in the *.h files. Example Unfortunately I'm not experienced enough to know how to fix this line for Cygwin: It is an undeclared identifier in my environment. |
I was refering to the 1.x branch.
I changed the include paths so that it would compile in my environment. The former paths did not work for me (files not found). I just changed these to relative paths to see if it compiles at all. Be carefull - I'm having two different issues here:
Thanks |
Did you set the include search flag to point to the copied folder? |
In my opinion, there is no problem with the header file because |
Is
I thought it was the difference between master branch and v1.x branch (both changed #include paths). |
Fixed and verified. The solution is to add in CMakeLists.txt
As for using the header-only by copy - works fine in latets commit. Please make sure you set correctly the search path flag to the parent of the "spdlog" folder |
Wow - super fast! Thanks. Will test tomorrow and provide feedback. |
Confirmed that I can now compile spdlog and also include it in my project. |
In file included from ..../_GITHUB/spdlog/src/spdlog.cpp:12:0:
..../_GITHUB/spdlog/include/spdlog/details/os-inl.h: In function 'void spdlog::details::os::prevent_child_fd(FILE*)':
..../_GITHUB/spdlog/include/spdlog/details/os-inl.h:139:15: error: 'fileno' was not declared in this scope
auto fd = fileno(f);
fileno is unknown.
Cygwin 3.0.7
CMake 3.15.3
Also copying headers to other project only works for "master" branch. 1.x branch does not work:
#includes are not working. I found a workaround by changing the #inclide paths.
The text was updated successfully, but these errors were encountered: