Issue 425 in protobuf: compiler/command_line_interface.cc doesn't compile on vs2012

72 views
Skip to first unread message

prot...@googlecode.com

unread,
Oct 10, 2012, 1:44:55 PM10/10/12
to prot...@googlegroups.com
Status: New
Owner: liuj...@google.com
Labels: Type-Defect Priority-Medium

New issue 425 by scot...@chromium.org: compiler/command_line_interface.cc
doesn't compile on vs2012
http://code.google.com/p/protobuf/issues/detail?id=425

Error is:

[1->1/2 ~0] CXX
obj\third_party\protobuf\src\google\protobuf\compiler\protoc.command_line_interface.obj
FAILED: ninja -t msvc -r . -o
obj\third_party\protobuf\src\google\protobuf\compiler\protoc.command_line_interface.obj
-e environment.x86 -- cl.exe /nologo /showIncludes /FC
@obj\third_party\protobuf\src\google\protobuf\compiler\protoc.command_line_interface.obj.rsp
/c ..\..\third_party\protobuf\src\google\protobuf\compiler\command_line_interface.cc
/Foobj\third_party\protobuf\src\google\protobuf\compiler\protoc.command_line_interface.obj
/Fdprotoc.pdb
d:\src\cr\src\third_party\protobuf\src\google\protobuf\compiler\command_line_interface.cc(913) :
error
C2664: 'std::make_pair' : cannot convert parameter 1
from 'std::string' to 'std::string &&'
You cannot bind an lvalue to an rvalue reference


Seems odd to have explicit specialization on make_pair. Trivial patch:


diff --git
a/third_party/protobuf/src/google/protobuf/compiler/command_line_interface.cc
b/third_party/protobuf/src/google/protobuf/index 060a612..c5be9b4 100644
---
a/third_party/protobuf/src/google/protobuf/compiler/command_line_interface.cc
+++
b/third_party/protobuf/src/google/protobuf/compiler/command_line_interface.cc
@@ -910,7 +910,7 @@ bool CommandLineInterface::InterpretArgument(const
string& name,
cerr << disk_path << ": warning: directory does not exist." <<
endl;
}

- proto_path_.push_back(make_pair<string, string>(virtual_path,
disk_path));
+ proto_path_.push_back(make_pair(virtual_path, disk_path));
}

} else if (name == "-o" || name == "--descriptor_set_out") {


prot...@googlecode.com

unread,
Oct 10, 2012, 1:46:38 PM10/10/12
to prot...@googlegroups.com

Comment #1 on issue 425 by scot...@chromium.org:
compiler/command_line_interface.cc doesn't compile on vs2012
http://code.google.com/p/protobuf/issues/detail?id=425

Ah, I see this was logged as issue #379 also. Would you mind applying
either this patch or switch to pair<string, string>(...)?

prot...@googlecode.com

unread,
Dec 3, 2012, 7:11:06 PM12/3/12
to prot...@googlegroups.com
Updates:
Status: Duplicate
Mergedinto: 379

Comment #2 on issue 425 by xiaof...@google.com:
compiler/command_line_interface.cc doesn't compile on vs2012
http://code.google.com/p/protobuf/issues/detail?id=425

(No comment was entered for this change.)

Reply all
Reply to author
Forward
0 new messages