-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Error: snprintf is not a member of std #224
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
Comments
Drive by portability comment: for reference, I think visual studio 2005 doesn't have snprintf at all |
The code would use "_snprintf" on visual studio.
|
This reverts commit 1c58876. std::snprintf() is only available in C++11, which is not provided by all compilers. Since the C library snprintf() can easily be used as a replacement on Linux systems, this patch changes jsoncpp to use the C library snprintf() instead of C++11 std::snprintf(), fixing the build error below: src/lib_json/json_writer.cpp:33:18: error: 'snprintf' is not a member of 'std' See open-source-parsers#231, open-source-parsers#224, and open-source-parsers#218.
Your bugzilla link says the problem for that user was a spurious environment variable. Not related, I think. Yes, Looking at 1c58876 and #218, I am not happy about the increasing complexity of our snprintf handling. There are exceptions for WINCE and STDC_SECURE, and they are not clearly consistent between files. Let's try to correct this in a better way. I'll look into this more later in the week. For now, #232 should solve your problem. (I included the @baruchsiach commit from #231.) |
I'm getting the error: ‘vsnprintf’ is not a member of ‘std’; did you mean ‘vswprintf’? |
This was solved 8 years ago, wasn't it? |
I'm getting the error "snprintf is not a member of std" in jsoncpp.cpp, line 3969. I fixed this by removing the "std::". I was using the latest Android NDK.
It might be part of this bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61101
The text was updated successfully, but these errors were encountered: