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

error C2039: 'Format' : is not a member of 'fmt::BasicWriter<Char>' #3

Closed
cybaman opened this issue Sep 9, 2013 · 8 comments
Closed

Comments

@cybaman
Copy link

cybaman commented Sep 9, 2013

I have tried this code from the examples
fmt::Writer out;
out << "The answer is " << 42 << "\n";
out.Format("({:+f}, {:+f})") << -3.14 << 3.14;

it gives the error:

m:\mmgit\mmcyb\src\mm\cmmaxes.cpp(307): error C2039: 'Format' : is not a member of 'fmt::BasicWriter'
3> with
3> [
3> Char=char
3> ]

@vitaut
Copy link
Contributor

vitaut commented Sep 9, 2013

From the error message it looks that you are using Visual C++. What compiler version?

@cybaman
Copy link
Author

cybaman commented Sep 9, 2013

Visual C++ 2010

@vitaut
Copy link
Contributor

vitaut commented Sep 9, 2013

Make sure that you are using the latest version of the library from the repository. BasicWriter::Format was only recently introduced so older versions don't have this method.

@cybaman
Copy link
Author

cybaman commented Sep 9, 2013

ok, I will check but I just update from github today.
my version has
template
BasicFormatter BasicWriter::Format(StringRef format) {
return BasicFormatter(*this, format.c_str());

@vitaut
Copy link
Contributor

vitaut commented Sep 9, 2013

Do you have any other compilation errors? Could you post the complete compiler output?

@cybaman cybaman closed this as completed Sep 9, 2013
@cybaman
Copy link
Author

cybaman commented Sep 9, 2013

Sorry close the issue by accident, the example / error is within a new clean project.
// testFormat.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include "format.h"

int _tmain(int argc, _TCHAR* argv[])
{
fmt::Writer out;
out << "The answer is " << 42 << "\n";
out.Format("({:+f}, {:+f})") << -3.14 << 3.14;

return 0;

}
1>------ Build started: Project: testFormat, Configuration: Debug Win32 ------
1>Build started 09/09/2013 20:00:58.
1>PrepareForBuild:
1> Creating directory "D:\cybadev\Test\testFormat\Debug".
1>InitializeBuildStatus:
1> Creating "Debug\testFormat.unsuccessfulbuild" because "AlwaysCreate" was specified.
1>ClCompile:
1> stdafx.cpp
1> testFormat.cpp
1>d:\cybadev\test\testformat\testformat\testformat.cpp(12): error C2039: 'Format' : is not a member of 'fmt::BasicWriter'
1> with
1> [
1> Char=char
1> ]
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:00.61
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

@cybaman cybaman reopened this Sep 9, 2013
@cybaman
Copy link
Author

cybaman commented Sep 9, 2013

Sorry , there was an old copy of the library in another location being included before the new one. Sorry to mess you about.

@cybaman cybaman closed this as completed Sep 9, 2013
@vitaut
Copy link
Contributor

vitaut commented Sep 9, 2013

No problems. Glad you've found the cause.

@cppden cppden mentioned this issue Jul 17, 2018
DanielaE added a commit to DanielaE/fmt that referenced this issue Sep 30, 2018
DanielaE added a commit to DanielaE/fmt that referenced this issue Sep 30, 2018
DanielaE added a commit to DanielaE/fmt that referenced this issue Oct 1, 2018
DanielaE added a commit to DanielaE/fmt that referenced this issue Oct 1, 2018
DanielaE added a commit to DanielaE/fmt that referenced this issue Oct 1, 2018
DanielaE added a commit to DanielaE/fmt that referenced this issue Oct 2, 2018
DanielaE added a commit to DanielaE/fmt that referenced this issue Oct 2, 2018
DanielaE added a commit to DanielaE/fmt that referenced this issue Oct 2, 2018
rimathia pushed a commit to rimathia/fmt that referenced this issue Sep 20, 2020
Reduce size of variadic-test result data
raphaelscholle added a commit to OpenHD/OpenHD-Fmt that referenced this issue May 30, 2022
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

2 participants