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

osx clion compile error.. support? #45

Closed
heshed opened this issue Feb 4, 2015 · 2 comments
Closed

osx clion compile error.. support? #45

heshed opened this issue Feb 4, 2015 · 2 comments

Comments

@heshed
Copy link

heshed commented Feb 4, 2015

Hi. I'm new spdlog user & English :)

I met this error message.
I want use this great logging library!! (love async mod logging!!)

my OSX g++ version

g++ --version                                                                       ✚ ✱ ◼
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/c++/4.2.1
Apple LLVM version 6.0 (clang-600.0.56) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin14.1.0
Thread model: posix
"/Applications/CLion EAP.app/Contents/bin/cmake/bin/cmake" --build /Users/md/Library/Caches/clion10/cmake/generated/34156cd6/34156cd6/Debug --target timo_echoes -- -j 4
Scanning dependencies of target timo_echoes
[100%] Building CXX object CMakeFiles/timo_echoes.dir/main.cpp.o
In file included from /Users/md/Documents/workspace/timo-echoes/main.cpp:22:
In file included from /Users/md/Documents/workspace/timo-echoes/spdlog/include/spdlog/spdlog.h:34:
In file included from /Users/md/Documents/workspace/timo-echoes/spdlog/include/spdlog/logger.h:36:
In file included from /Users/md/Documents/workspace/timo-echoes/spdlog/include/spdlog/sinks/base_sink.h:35:
In file included from /Users/md/Documents/workspace/timo-echoes/spdlog/include/spdlog/sinks/./sink.h:27:
In file included from /Users/md/Documents/workspace/timo-echoes/spdlog/include/spdlog/sinks/../details/log_msg.h:28:
In file included from /Users/md/Documents/workspace/timo-echoes/spdlog/include/spdlog/sinks/../details/./format.h:2880:
/Users/md/Documents/workspace/timo-echoes/spdlog/include/spdlog/sinks/../details/format.cc:145:11: error: cannot initialize a variable of type 'char *' with an rvalue of type 'int'
    char *message = strerror_r(error_code, buffer, buffer_size);
          ^         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
make[3]: *** [CMakeFiles/timo_echoes.dir/main.cpp.o] Error 1
make[2]: *** [CMakeFiles/timo_echoes.dir/all] Error 2
make[1]: *** [CMakeFiles/timo_echoes.dir/rule] Error 2
make: *** [timo_echoes] Error 2
@gabime
Copy link
Owner

gabime commented Feb 4, 2015

Hi
I never tried spdlog on OSX. I hope it works!

Try to replace line 145 with lines 161-163 (i im just guessing):

  result = strerror_r(error_code, buffer, buffer_size); 
   if (result == -1)    
       result = errno;  // glibc versions before 2.13 return result in errno

If this doesn't help i think you can just comment out this function. Spdlog doesn't use it..

@gabime gabime closed this as completed Feb 10, 2015
@vitaut
Copy link

vitaut commented Feb 10, 2015

Newer version of C++ Format which is where format.cc (and the error =)) coming from has better detection of strerror_r here.

bachittle pushed a commit to bachittle/spdlog that referenced this issue Dec 22, 2022
* Work on Flush-Close api

* Add Flush & Close

* Add flush and close interface

* Remove return type from Flush-Close

* Fix docs
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