ChihYungHu / google-url

Automatically exported from code.google.com/p/google-url
Other
0 stars 0 forks source link

VS2012 build fails #35

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
When I try to build google-url under VS2012 I run into a lot of unicode 
problems.

Does it compile on VS2012?

For example 
cannot convert parameter 1 from 'TCHAR [260]' to 'const 
std::basic_string<_Elem,_Traits,_Alloc> &'

migth be solved if I switch from std:string to std::wstring

Full build log showing where it fails:

1>------ Build started: Project: googleurl, Configuration: Debug Win32 ------
2>------ Build started: Project: base, Configuration: Debug Win32 ------
1>Build started 4/10/2013 9:24:37 PM.
2>Build started 4/10/2013 9:24:37 PM.
1>InitializeBuildStatus:
1>  Touching 
"D:\dev\3rdparty\googleurl\build\Debug\obj\googleurl\googleurl.unsuccessfulbuild
".
2>InitializeBuildStatus:
2>  Touching 
"D:\dev\3rdparty\googleurl\build\Debug\obj\base\base.unsuccessfulbuild".
2>ClCompile:
2>  logging.cc
1>ClCompile:
1>  gurl.cc
2>..\base\logging.cc(115): error C2664: 
'std::basic_string<_Elem,_Traits,_Alloc>::basic_string(const 
std::basic_string<_Elem,_Traits,_Alloc> &)' : cannot convert parameter 1 from 
'TCHAR [260]' to 'const std::basic_string<_Elem,_Traits,_Alloc> &'
2>          with
2>          [
2>              _Elem=wchar_t,
2>              _Traits=std::char_traits<wchar_t>,
2>              _Alloc=std::allocator<wchar_t>
2>          ]
2>          Reason: cannot convert from 'TCHAR [260]' to 'const 
std::basic_string<_Elem,_Traits,_Alloc>'
2>          with
2>          [
2>              _Elem=wchar_t,
2>              _Traits=std::char_traits<wchar_t>,
2>              _Alloc=std::allocator<wchar_t>
2>          ]
2>          No constructor could take the source type, or constructor overload 
resolution was ambiguous
2>..\base\logging.cc(119): error C2664: 'CreateMutexA' : cannot convert 
parameter 3 from 'const wchar_t *' to 'LPCSTR'
2>          Types pointed to are unrelated; conversion requires 
reinterpret_cast, C-style cast or function-style cast
2>..\base\logging.cc(217): error C2664: 'CreateProcessW' : cannot convert 
parameter 9 from 'STARTUPINFO *' to 'LPSTARTUPINFOW'
2>          Types pointed to are unrelated; conversion requires 
reinterpret_cast, C-style cast or function-style cast
2>..\base\logging.cc(278): warning C4244: '=' : conversion from 
'std::streamsize' to 'int', possible loss of data
2>..\base\logging.cc(285): warning C4244: 'argument' : conversion from 
'std::streamsize' to 'unsigned int', possible loss of data
2>..\base\logging.cc(340): warning C4244: 'argument' : conversion from 
'std::streamsize' to 'unsigned int', possible loss of data
2>..\base\logging.cc(344): warning C4244: 'argument' : conversion from 
'std::streamsize' to 'unsigned int', possible loss of data
2>
2>Build FAILED.
2>
2>Time Elapsed 00:00:01.30
1>D:\dev\3rdparty\googleurl\base/logging.h(219): error C2220: warning treated 
as error - no 'object' file generated
1>          D:\dev\3rdparty\googleurl\base/logging.h(264) : see reference to 
function template instantiation 'std::string 
*logging::MakeCheckOpString<int,int>(const t1 &,const t2 &,const char *)' being 
compiled
1>          with
1>          [
1>              t1=int,
1>              t2=int
1>          ]
1>D:\dev\3rdparty\googleurl\base/logging.h(219): warning C4244: 'argument' : 
conversion from 'std::streamsize' to 'unsigned int', possible loss of data
1>  url_canon_etc.cc
1>D:\dev\3rdparty\googleurl\base/logging.h(219): error C2220: warning treated 
as error - no 'object' file generated
1>          D:\dev\3rdparty\googleurl\base/logging.h(264) : see reference to 
function template instantiation 'std::string 
*logging::MakeCheckOpString<int,int>(const t1 &,const t2 &,const char *)' being 
compiled
1>          with
1>          [
1>              t1=int,
1>              t2=int
1>          ]
1>D:\dev\3rdparty\googleurl\base/logging.h(219): warning C4244: 'argument' : 
conversion from 'std::streamsize' to 'unsigned int', possible loss of data
1>  url_canon_filesystemurl.cc
1>D:\dev\3rdparty\googleurl\base/logging.h(219): error C2220: warning treated 
as error - no 'object' file generated
1>          D:\dev\3rdparty\googleurl\base/logging.h(264) : see reference to 
function template instantiation 'std::string 
*logging::MakeCheckOpString<int,int>(const t1 &,const t2 &,const char *)' being 
compiled
1>          with
1>          [
1>              t1=int,
1>              t2=int
1>          ]
1>D:\dev\3rdparty\googleurl\base/logging.h(219): warning C4244: 'argument' : 
conversion from 'std::streamsize' to 'unsigned int', possible loss of data
1>  url_canon_fileurl.cc
1>D:\dev\3rdparty\googleurl\base/logging.h(219): error C2220: warning treated 
as error - no 'object' file generated
1>          D:\dev\3rdparty\googleurl\base/logging.h(264) : see reference to 
function template instantiation 'std::string 
*logging::MakeCheckOpString<int,int>(const t1 &,const t2 &,const char *)' being 
compiled
1>          with
1>          [
1>              t1=int,
1>              t2=int
1>          ]
1>D:\dev\3rdparty\googleurl\base/logging.h(219): warning C4244: 'argument' : 
conversion from 'std::streamsize' to 'unsigned int', possible loss of data
1>  url_canon_host.cc
1>D:\dev\3rdparty\googleurl\base/logging.h(219): error C2220: warning treated 
as error - no 'object' file generated
1>          D:\dev\3rdparty\googleurl\base/logging.h(264) : see reference to 
function template instantiation 'std::string 
*logging::MakeCheckOpString<int,int>(const t1 &,const t2 &,const char *)' being 
compiled
1>          with
1>          [
1>              t1=int,
1>              t2=int
1>          ]
1>D:\dev\3rdparty\googleurl\base/logging.h(219): warning C4244: 'argument' : 
conversion from 'std::streamsize' to 'unsigned int', possible loss of data
1>  url_canon_icu.cc
1>..\src\url_canon_icu.cc(34): fatal error C1083: Cannot open include file: 
'unicode/ucnv.h': No such file or directory
1>  url_canon_internal.cc
1>D:\dev\3rdparty\googleurl\base/logging.h(219): error C2220: warning treated 
as error - no 'object' file generated
1>          D:\dev\3rdparty\googleurl\base/logging.h(264) : see reference to 
function template instantiation 'std::string 
*logging::MakeCheckOpString<int,int>(const t1 &,const t2 &,const char *)' being 
compiled
1>          with
1>          [
1>              t1=int,
1>              t2=int
1>          ]
1>D:\dev\3rdparty\googleurl\base/logging.h(219): warning C4244: 'argument' : 
conversion from 'std::streamsize' to 'unsigned int', possible loss of data
1>  url_canon_ip.cc
1>D:\dev\3rdparty\googleurl\base/logging.h(219): error C2220: warning treated 
as error - no 'object' file generated
1>          D:\dev\3rdparty\googleurl\base/logging.h(264) : see reference to 
function template instantiation 'std::string 
*logging::MakeCheckOpString<int,int>(const t1 &,const t2 &,const char *)' being 
compiled
1>          with
1>          [
1>              t1=int,
1>              t2=int
1>          ]
1>D:\dev\3rdparty\googleurl\base/logging.h(219): warning C4244: 'argument' : 
conversion from 'std::streamsize' to 'unsigned int', possible loss of data
1>..\src\url_canon_ip.cc(173): error C2065: 'uint64' : undeclared identifier
1>          ..\src\url_canon_ip.cc(208) : see reference to function template 
instantiation 'url_canon::CanonHostInfo::Family 
url_canon::`anonymous-namespace'::IPv4ComponentToNumber<CHAR>(const CHAR 
*,const url_parse::Component &,uint32 *)' being compiled
1>          with
1>          [
1>              CHAR=char
1>          ]
1>          ..\src\url_canon_ip.cc(707) : see reference to function template 
instantiation 'url_canon::CanonHostInfo::Family 
url_canon::`anonymous-namespace'::DoIPv4AddressToNumber<char>(const CHAR 
*,const url_parse::Component &,unsigned char [],int *)' being compiled
1>          with
1>          [
1>              CHAR=char
1>          ]
1>..\src\url_canon_ip.cc(173): error C2146: syntax error : missing ';' before 
identifier 'num'
1>..\src\url_canon_ip.cc(173): error C2065: 'num' : undeclared identifier
1>..\src\url_canon_ip.cc(176): error C2065: 'num' : undeclared identifier
1>..\src\url_canon_ip.cc(180): error C2065: 'num' : undeclared identifier
1>  url_canon_mailtourl.cc
1>D:\dev\3rdparty\googleurl\base/logging.h(219): error C2220: warning treated 
as error - no 'object' file generated
1>          D:\dev\3rdparty\googleurl\base/logging.h(264) : see reference to 
function template instantiation 'std::string 
*logging::MakeCheckOpString<int,int>(const t1 &,const t2 &,const char *)' being 
compiled
1>          with
1>          [
1>              t1=int,
1>              t2=int
1>          ]
1>D:\dev\3rdparty\googleurl\base/logging.h(219): warning C4244: 'argument' : 
conversion from 'std::streamsize' to 'unsigned int', possible loss of data
1>  url_canon_path.cc
1>D:\dev\3rdparty\googleurl\base/logging.h(219): error C2220: warning treated 
as error - no 'object' file generated
1>          D:\dev\3rdparty\googleurl\base/logging.h(264) : see reference to 
function template instantiation 'std::string 
*logging::MakeCheckOpString<int,int>(const t1 &,const t2 &,const char *)' being 
compiled
1>          with
1>          [
1>              t1=int,
1>              t2=int
1>          ]
1>D:\dev\3rdparty\googleurl\base/logging.h(219): warning C4244: 'argument' : 
conversion from 'std::streamsize' to 'unsigned int', possible loss of data
1>  url_canon_pathurl.cc
1>D:\dev\3rdparty\googleurl\base/logging.h(219): error C2220: warning treated 
as error - no 'object' file generated
1>          D:\dev\3rdparty\googleurl\base/logging.h(264) : see reference to 
function template instantiation 'std::string 
*logging::MakeCheckOpString<int,int>(const t1 &,const t2 &,const char *)' being 
compiled
1>          with
1>          [
1>              t1=int,
1>              t2=int
1>          ]
1>D:\dev\3rdparty\googleurl\base/logging.h(219): warning C4244: 'argument' : 
conversion from 'std::streamsize' to 'unsigned int', possible loss of data
1>  url_canon_query.cc
1>D:\dev\3rdparty\googleurl\base/logging.h(219): error C2220: warning treated 
as error - no 'object' file generated
1>          D:\dev\3rdparty\googleurl\base/logging.h(264) : see reference to 
function template instantiation 'std::string 
*logging::MakeCheckOpString<int,int>(const t1 &,const t2 &,const char *)' being 
compiled
1>          with
1>          [
1>              t1=int,
1>              t2=int
1>          ]
1>D:\dev\3rdparty\googleurl\base/logging.h(219): warning C4244: 'argument' : 
conversion from 'std::streamsize' to 'unsigned int', possible loss of data
1>  url_canon_relative.cc
1>D:\dev\3rdparty\googleurl\base/logging.h(219): error C2220: warning treated 
as error - no 'object' file generated
1>          D:\dev\3rdparty\googleurl\base/logging.h(264) : see reference to 
function template instantiation 'std::string 
*logging::MakeCheckOpString<int,int>(const t1 &,const t2 &,const char *)' being 
compiled
1>          with
1>          [
1>              t1=int,
1>              t2=int
1>          ]
1>D:\dev\3rdparty\googleurl\base/logging.h(219): warning C4244: 'argument' : 
conversion from 'std::streamsize' to 'unsigned int', possible loss of data
1>  url_canon_stdurl.cc
1>D:\dev\3rdparty\googleurl\base/logging.h(219): error C2220: warning treated 
as error - no 'object' file generated
1>          D:\dev\3rdparty\googleurl\base/logging.h(264) : see reference to 
function template instantiation 'std::string 
*logging::MakeCheckOpString<int,int>(const t1 &,const t2 &,const char *)' being 
compiled
1>          with
1>          [
1>              t1=int,
1>              t2=int
1>          ]
1>D:\dev\3rdparty\googleurl\base/logging.h(219): warning C4244: 'argument' : 
conversion from 'std::streamsize' to 'unsigned int', possible loss of data
1>  url_parse.cc
1>D:\dev\3rdparty\googleurl\base/logging.h(219): error C2220: warning treated 
as error - no 'object' file generated
1>          D:\dev\3rdparty\googleurl\base/logging.h(264) : see reference to 
function template instantiation 'std::string 
*logging::MakeCheckOpString<int,int>(const t1 &,const t2 &,const char *)' being 
compiled
1>          with
1>          [
1>              t1=int,
1>              t2=int
1>          ]
1>D:\dev\3rdparty\googleurl\base/logging.h(219): warning C4244: 'argument' : 
conversion from 'std::streamsize' to 'unsigned int', possible loss of data
1>  url_parse_file.cc
1>D:\dev\3rdparty\googleurl\base/logging.h(219): error C2220: warning treated 
as error - no 'object' file generated
1>          D:\dev\3rdparty\googleurl\base/logging.h(264) : see reference to 
function template instantiation 'std::string 
*logging::MakeCheckOpString<int,int>(const t1 &,const t2 &,const char *)' being 
compiled
1>          with
1>          [
1>              t1=int,
1>              t2=int
1>          ]
1>D:\dev\3rdparty\googleurl\base/logging.h(219): warning C4244: 'argument' : 
conversion from 'std::streamsize' to 'unsigned int', possible loss of data
1>  url_util.cc
1>D:\dev\3rdparty\googleurl\base/logging.h(219): error C2220: warning treated 
as error - no 'object' file generated
1>          D:\dev\3rdparty\googleurl\base/logging.h(264) : see reference to 
function template instantiation 'std::string 
*logging::MakeCheckOpString<int,int>(const t1 &,const t2 &,const char *)' being 
compiled
1>          with
1>          [
1>              t1=int,
1>              t2=int
1>          ]
1>D:\dev\3rdparty\googleurl\base/logging.h(219): warning C4244: 'argument' : 
conversion from 'std::streamsize' to 'unsigned int', possible loss of data
1>  Generating Code...
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:11.72
========== Build: 0 succeeded, 2 failed, 0 up-to-date, 0 skipped ==========

Original issue reported on code.google.com by l...@schouw.me on 10 Apr 2013 at 8:26

GoogleCodeExporter commented 9 years ago
It looks like you're compiling in ANSI mode. You should compile in Unicode mode 
(TCHAR == wchar_t).

Original comment by bre...@gmail.com on 10 Apr 2013 at 8:33