xixip / google-glog

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

Can not build on Visual Studio 2003 #15

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Convert existing VS2008 solution file to VS2003. I used VS project
converter found at "http://sourceforge.net/projects/vspc/files/"
2. Open solution google-glog in VS2003
3. Build the solution or single project

What is the expected output? What do you see instead?
Its expected that it should build without any errors. But errors are thrown
as below

------ Build started: Project: libglog_static, Configuration: Debug Win32
------

Compiling...
vlog_is_on.cc
c:\Tools\glog-0.3.0\src\windows\port.h(133) : error C3861: 'localtime_s':
identifier not found, even with argument-dependent lookup
c:\Tools\glog-0.3.0\src\windows\port.h(138) : error C3861: 'strerror_s':
identifier not found, even with argument-dependent lookup
c:\Tools\glog-0.3.0\src\windows\glog\raw_logging.h(73) : error C2010: '.' :
unexpected in macro formal parameter list
c:\Tools\glog-0.3.0\src\windows\glog\raw_logging.h(73) : error C2010: '.' :
unexpected in macro formal parameter list
c:\Tools\glog-0.3.0\src\windows\glog\raw_logging.h(73) : error C2010: '.' :
unexpected in macro formal parameter list
c:\Tools\glog-0.3.0\src\windows\glog\raw_logging.h(73) : error C2010: ')' :
unexpected in macro formal parameter list
c:\Tools\glog-0.3.0\src\windows\glog\raw_logging.h(96) : error C2010: '.' :
unexpected in macro formal parameter list
c:\Tools\glog-0.3.0\src\windows\glog\raw_logging.h(96) : error C2010: '.' :
unexpected in macro formal parameter list
c:\Tools\glog-0.3.0\src\windows\glog\raw_logging.h(96) : error C2010: '.' :
unexpected in macro formal parameter list
c:\Tools\glog-0.3.0\src\windows\glog\raw_logging.h(96) : error C2010: ')' :
unexpected in macro formal parameter list
c:\Tools\glog-0.3.0\src\windows\glog\raw_logging.h(107) : error C2010: '.'
: unexpected in macro formal parameter list
c:\Tools\glog-0.3.0\src\windows\glog\raw_logging.h(107) : error C2010: '.'
: unexpected in macro formal parameter list
c:\Tools\glog-0.3.0\src\windows\glog\raw_logging.h(107) : error C2010: '.'
: unexpected in macro formal parameter list
c:\Tools\glog-0.3.0\src\windows\glog\raw_logging.h(114) : error C2010: '.'
: unexpected in macro formal parameter list
c:\Tools\glog-0.3.0\src\windows\glog\raw_logging.h(114) : error C2010: '.'
: unexpected in macro formal parameter list
c:\Tools\glog-0.3.0\src\windows\glog\raw_logging.h(114) : error C2010: '.'
: unexpected in macro formal parameter list
c:\Tools\glog-0.3.0\src\windows\glog\raw_logging.h(121) : error C2010: '.'
: unexpected in macro formal parameter list
c:\Tools\glog-0.3.0\src\windows\glog\raw_logging.h(121) : error C2010: '.'
: unexpected in macro formal parameter list
c:\Tools\glog-0.3.0\src\windows\glog\raw_logging.h(121) : error C2010: '.'
: unexpected in macro formal parameter list
c:\Tools\glog-0.3.0\src\windows\glog\raw_logging.h(128) : error C2010: '.'
: unexpected in macro formal parameter list
c:\Tools\glog-0.3.0\src\windows\glog\raw_logging.h(128) : error C2010: '.'
: unexpected in macro formal parameter list
c:\Tools\glog-0.3.0\src\windows\glog\raw_logging.h(128) : error C2010: '.'
: unexpected in macro formal parameter list
c:\Tools\glog-0.3.0\src\windows\glog\raw_logging.h(153) : error C2010: '.'
: unexpected in macro formal parameter list
c:\Tools\glog-0.3.0\src\windows\glog\raw_logging.h(153) : error C2010: '.'
: unexpected in macro formal parameter list
c:\Tools\glog-0.3.0\src\windows\glog\raw_logging.h(153) : error C2010: '.'
: unexpected in macro formal parameter list
c:\Tools\glog-0.3.0\src\windows\glog\raw_logging.h(153) : error C2010: ')'
: unexpected in macro formal parameter list
c:\Tools\glog-0.3.0\src\vlog_is_on.cc(189) : warning C4002: too many actual
parameters for macro 'RAW_VLOG'
c:\Tools\glog-0.3.0\src\vlog_is_on.cc(189) : warning C4002: too many actual
parameters for macro 'RAW_LOG_INFO'
c:\Tools\glog-0.3.0\src\vlog_is_on.cc(189) : error C2065: '__VA_ARGS__' :
undeclared identifier
utilities.cc
c:\Tools\glog-0.3.0\src\windows\port.h(133) : error C3861: 'localtime_s':
identifier not found, even with argument-dependent lookup
c:\Tools\glog-0.3.0\src\windows\port.h(138) : error C3861: 'strerror_s':
identifier not found, even with argument-dependent lookup
raw_logging.cc
c:\Tools\glog-0.3.0\src\windows\port.h(133) : error C3861: 'localtime_s':
identifier not found, even with argument-dependent lookup
c:\Tools\glog-0.3.0\src\windows\port.h(138) : error C3861: 'strerror_s':
identifier not found, even with argument-dependent lookup
c:\Tools\glog-0.3.0\src\windows\glog\raw_logging.h(73) : error C2010: '.' :
unexpected in macro formal parameter list
c:\Tools\glog-0.3.0\src\windows\glog\raw_logging.h(73) : error C2010: '.' :
unexpected in macro formal parameter list
c:\Tools\glog-0.3.0\src\windows\glog\raw_logging.h(73) : error C2010: '.' :
unexpected in macro formal parameter list
c:\Tools\glog-0.3.0\src\windows\glog\raw_logging.h(73) : error C2010: ')' :
unexpected in macro formal parameter list
c:\Tools\glog-0.3.0\src\windows\glog\raw_logging.h(96) : error C2010: '.' :
unexpected in macro formal parameter list
c:\Tools\glog-0.3.0\src\windows\glog\raw_logging.h(96) : error C2010: '.' :
unexpected in macro formal parameter list
c:\Tools\glog-0.3.0\src\windows\glog\raw_logging.h(96) : error C2010: '.' :
unexpected in macro formal parameter list
c:\Tools\glog-0.3.0\src\windows\glog\raw_logging.h(96) : error C2010: ')' :
unexpected in macro formal parameter list
c:\Tools\glog-0.3.0\src\windows\glog\raw_logging.h(107) : error C2010: '.'
: unexpected in macro formal parameter list
c:\Tools\glog-0.3.0\src\windows\glog\raw_logging.h(107) : error C2010: '.'
: unexpected in macro formal parameter list
c:\Tools\glog-0.3.0\src\windows\glog\raw_logging.h(107) : error C2010: '.'
: unexpected in macro formal parameter list
c:\Tools\glog-0.3.0\src\windows\glog\raw_logging.h(114) : error C2010: '.'
: unexpected in macro formal parameter list
c:\Tools\glog-0.3.0\src\windows\glog\raw_logging.h(114) : error C2010: '.'
: unexpected in macro formal parameter list
c:\Tools\glog-0.3.0\src\windows\glog\raw_logging.h(114) : error C2010: '.'
: unexpected in macro formal parameter list
c:\Tools\glog-0.3.0\src\windows\glog\raw_logging.h(121) : error C2010: '.'
: unexpected in macro formal parameter list
c:\Tools\glog-0.3.0\src\windows\glog\raw_logging.h(121) : error C2010: '.'
: unexpected in macro formal parameter list
c:\Tools\glog-0.3.0\src\windows\glog\raw_logging.h(121) : error C2010: '.'
: unexpected in macro formal parameter list
c:\Tools\glog-0.3.0\src\windows\glog\raw_logging.h(128) : error C2010: '.'
: unexpected in macro formal parameter list
c:\Tools\glog-0.3.0\src\windows\glog\raw_logging.h(128) : error C2010: '.'
: unexpected in macro formal parameter list
c:\Tools\glog-0.3.0\src\windows\glog\raw_logging.h(128) : error C2010: '.'
: unexpected in macro formal parameter list
c:\Tools\glog-0.3.0\src\windows\glog\raw_logging.h(153) : error C2010: '.'
: unexpected in macro formal parameter list
c:\Tools\glog-0.3.0\src\windows\glog\raw_logging.h(153) : error C2010: '.'
: unexpected in macro formal parameter list
c:\Tools\glog-0.3.0\src\windows\glog\raw_logging.h(153) : error C2010: '.'
: unexpected in macro formal parameter list
c:\Tools\glog-0.3.0\src\windows\glog\raw_logging.h(153) : error C2010: ')'
: unexpected in macro formal parameter list
port.cc
c:\Tools\glog-0.3.0\src\windows\port.h(133) : error C3861: 'localtime_s':
identifier not found, even with argument-dependent lookup
c:\Tools\glog-0.3.0\src\windows\port.h(138) : error C3861: 'strerror_s':
identifier not found, even with argument-dependent lookup
logging.cc
c:\Tools\glog-0.3.0\src\windows\port.h(133) : error C3861: 'localtime_s':
identifier not found, even with argument-dependent lookup
c:\Tools\glog-0.3.0\src\windows\port.h(138) : error C3861: 'strerror_s':
identifier not found, even with argument-dependent lookup
c:\Tools\glog-0.3.0\src\windows\glog\raw_logging.h(73) : error C2010: '.' :
unexpected in macro formal parameter list
c:\Tools\glog-0.3.0\src\windows\glog\raw_logging.h(73) : error C2010: '.' :
unexpected in macro formal parameter list
c:\Tools\glog-0.3.0\src\windows\glog\raw_logging.h(73) : error C2010: '.' :
unexpected in macro formal parameter list
c:\Tools\glog-0.3.0\src\windows\glog\raw_logging.h(73) : error C2010: ')' :
unexpected in macro formal parameter list
c:\Tools\glog-0.3.0\src\windows\glog\raw_logging.h(96) : error C2010: '.' :
unexpected in macro formal parameter list
c:\Tools\glog-0.3.0\src\windows\glog\raw_logging.h(96) : error C2010: '.' :
unexpected in macro formal parameter list
c:\Tools\glog-0.3.0\src\windows\glog\raw_logging.h(96) : error C2010: '.' :
unexpected in macro formal parameter list
c:\Tools\glog-0.3.0\src\windows\glog\raw_logging.h(96) : error C2010: ')' :
unexpected in macro formal parameter list
c:\Tools\glog-0.3.0\src\windows\glog\raw_logging.h(107) : error C2010: '.'
: unexpected in macro formal parameter list
c:\Tools\glog-0.3.0\src\windows\glog\raw_logging.h(107) : error C2010: '.'
: unexpected in macro formal parameter list
c:\Tools\glog-0.3.0\src\windows\glog\raw_logging.h(107) : error C2010: '.'
: unexpected in macro formal parameter list
c:\Tools\glog-0.3.0\src\windows\glog\raw_logging.h(114) : error C2010: '.'
: unexpected in macro formal parameter list
c:\Tools\glog-0.3.0\src\windows\glog\raw_logging.h(114) : error C2010: '.'
: unexpected in macro formal parameter list
c:\Tools\glog-0.3.0\src\windows\glog\raw_logging.h(114) : error C2010: '.'
: unexpected in macro formal parameter list
c:\Tools\glog-0.3.0\src\windows\glog\raw_logging.h(121) : error C2010: '.'
: unexpected in macro formal parameter list
c:\Tools\glog-0.3.0\src\windows\glog\raw_logging.h(121) : error C2010: '.'
: unexpected in macro formal parameter list
c:\Tools\glog-0.3.0\src\windows\glog\raw_logging.h(121) : error C2010: '.'
: unexpected in macro formal parameter list
c:\Tools\glog-0.3.0\src\windows\glog\raw_logging.h(128) : error C2010: '.'
: unexpected in macro formal parameter list
c:\Tools\glog-0.3.0\src\windows\glog\raw_logging.h(128) : error C2010: '.'
: unexpected in macro formal parameter list
c:\Tools\glog-0.3.0\src\windows\glog\raw_logging.h(128) : error C2010: '.'
: unexpected in macro formal parameter list
c:\Tools\glog-0.3.0\src\windows\glog\raw_logging.h(153) : error C2010: '.'
: unexpected in macro formal parameter list
c:\Tools\glog-0.3.0\src\windows\glog\raw_logging.h(153) : error C2010: '.'
: unexpected in macro formal parameter list
c:\Tools\glog-0.3.0\src\windows\glog\raw_logging.h(153) : error C2010: '.'
: unexpected in macro formal parameter list
c:\Tools\glog-0.3.0\src\windows\glog\raw_logging.h(153) : error C2010: ')'
: unexpected in macro formal parameter list
c:\Tools\glog-0.3.0\src\logging.cc(1137) : warning C4002: too many actual
parameters for macro 'RAW_LOG'
c:\Tools\glog-0.3.0\src\logging.cc(1137) : warning C4002: too many actual
parameters for macro 'RAW_LOG_INFO'
c:\Tools\glog-0.3.0\src\logging.cc(1137) : warning C4002: too many actual
parameters for macro 'RAW_LOG_WARNING'
c:\Tools\glog-0.3.0\src\logging.cc(1137) : warning C4002: too many actual
parameters for macro 'RAW_LOG_ERROR'
c:\Tools\glog-0.3.0\src\logging.cc(1137) : warning C4002: too many actual
parameters for macro 'RAW_LOG_FATAL'
c:\Tools\glog-0.3.0\src\logging.cc(1137) : error C2065: '__VA_ARGS__' :
undeclared identifier
c:\Tools\glog-0.3.0\src\logging.cc(1137) : error C3861: '__VA_ARGS__':
identifier not found, even with argument-dependent lookup
c:\Tools\glog-0.3.0\src\logging.cc(1137) : error C3861: '__VA_ARGS__':
identifier not found, even with argument-dependent lookup
c:\Tools\glog-0.3.0\src\logging.cc(1137) : error C3861: '__VA_ARGS__':
identifier not found, even with argument-dependent lookup
c:\Tools\glog-0.3.0\src\logging.cc(1263) : warning C4002: too many actual
parameters for macro 'RAW_LOG'
c:\Tools\glog-0.3.0\src\logging.cc(1263) : warning C4002: too many actual
parameters for macro 'RAW_LOG_INFO'
c:\Tools\glog-0.3.0\src\logging.cc(1263) : warning C4002: too many actual
parameters for macro 'RAW_LOG_WARNING'
c:\Tools\glog-0.3.0\src\logging.cc(1263) : warning C4002: too many actual
parameters for macro 'RAW_LOG_ERROR'
c:\Tools\glog-0.3.0\src\logging.cc(1263) : warning C4002: too many actual
parameters for macro 'RAW_LOG_FATAL'
c:\Tools\glog-0.3.0\src\logging.cc(1263) : error C3861: '__VA_ARGS__':
identifier not found, even with argument-dependent lookup
c:\Tools\glog-0.3.0\src\logging.cc(1263) : error C3861: '__VA_ARGS__':
identifier not found, even with argument-dependent lookup
c:\Tools\glog-0.3.0\src\logging.cc(1263) : error C3861: '__VA_ARGS__':
identifier not found, even with argument-dependent lookup
c:\Tools\glog-0.3.0\src\logging.cc(1263) : error C3861: '__VA_ARGS__':
identifier not found, even with argument-dependent lookup
c:\Tools\glog-0.3.0\src\logging.cc(1282) : warning C4002: too many actual
parameters for macro 'RAW_LOG'
c:\Tools\glog-0.3.0\src\logging.cc(1282) : warning C4002: too many actual
parameters for macro 'RAW_LOG_INFO'
c:\Tools\glog-0.3.0\src\logging.cc(1282) : warning C4002: too many actual
parameters for macro 'RAW_LOG_WARNING'
c:\Tools\glog-0.3.0\src\logging.cc(1282) : warning C4002: too many actual
parameters for macro 'RAW_LOG_ERROR'
c:\Tools\glog-0.3.0\src\logging.cc(1282) : warning C4002: too many actual
parameters for macro 'RAW_LOG_FATAL'
c:\Tools\glog-0.3.0\src\logging.cc(1282) : error C3861: '__VA_ARGS__':
identifier not found, even with argument-dependent lookup
c:\Tools\glog-0.3.0\src\logging.cc(1282) : error C3861: '__VA_ARGS__':
identifier not found, even with argument-dependent lookup
c:\Tools\glog-0.3.0\src\logging.cc(1282) : error C3861: '__VA_ARGS__':
identifier not found, even with argument-dependent lookup
c:\Tools\glog-0.3.0\src\logging.cc(1282) : error C3861: '__VA_ARGS__':
identifier not found, even with argument-dependent lookup
c:\Tools\glog-0.3.0\src\logging.cc(1295) : warning C4002: too many actual
parameters for macro 'RAW_LOG'
c:\Tools\glog-0.3.0\src\logging.cc(1295) : warning C4002: too many actual
parameters for macro 'RAW_LOG_INFO'
c:\Tools\glog-0.3.0\src\logging.cc(1295) : warning C4002: too many actual
parameters for macro 'RAW_LOG_WARNING'
c:\Tools\glog-0.3.0\src\logging.cc(1295) : warning C4002: too many actual
parameters for macro 'RAW_LOG_ERROR'
c:\Tools\glog-0.3.0\src\logging.cc(1295) : warning C4002: too many actual
parameters for macro 'RAW_LOG_FATAL'
c:\Tools\glog-0.3.0\src\logging.cc(1295) : error C3861: '__VA_ARGS__':
identifier not found, even with argument-dependent lookup
c:\Tools\glog-0.3.0\src\logging.cc(1295) : error C3861: '__VA_ARGS__':
identifier not found, even with argument-dependent lookup
c:\Tools\glog-0.3.0\src\logging.cc(1295) : error C3861: '__VA_ARGS__':
identifier not found, even with argument-dependent lookup
c:\Tools\glog-0.3.0\src\logging.cc(1295) : error C3861: '__VA_ARGS__':
identifier not found, even with argument-dependent lookup
c:\Tools\glog-0.3.0\src\logging.cc(1346) : warning C4541: 'dynamic_cast'
used on polymorphic type 'std::basic_ostream<_Elem,_Traits>' with /GR-;
unpredictable behavior may result
        with
        [
            _Elem=char,
            _Traits=std::char_traits<char>
        ]
Generating Code...

Build log was saved at
"file://c:\Tools\glog-0.3.0\vsprojects\libglog_static\Debug\BuildLog.htm"
libglog_static - 99 error(s), 23 warning(s)

---------------------- Done ----------------------

    Build: 0 succeeded, 1 failed, 0 skipped

What version of the product are you using? On what operating system?
glog 0.3.0
Visual Studio 2003
Windows Vista

Please provide any additional information below.

Original issue reported on code.google.com by pvshew...@gmail.com on 6 Oct 2009 at 10:49

GoogleCodeExporter commented 9 years ago
strerror_s() may be defined since vs2005

Original comment by fifywang on 8 Dec 2009 at 2:47

GoogleCodeExporter commented 9 years ago
Searching for localtime_s finds 
http://msdn.microsoft.com/en-us/library/a442x3ye(VS.80).aspx which seems to 
indicate that this function is declared under Windows, in file time.h.

Looking at the file windows/port.h, we see the following block of code right at 
the top:

#ifdef _WIN32

#define WIN32_LEAN_AND_MEAN  /* We always want minimal includes */
#include <windows.h>
#include <winsock.h>         /* for gethostname */
#include <io.h>              /* because we so often use open/close/etc */
#include <direct.h>          /* for _getcwd() */
#include <process.h>         /* for _getpid() */
#include <stdio.h>           /* read in vsnprintf decl. before redifining it */
#include <stdarg.h>          /* template_dictionary.cc uses va_copy */
#include <string.h>          /* for _strnicmp(), strerror_s() */
#include <time.h>            /* for localtime_s() */
/* Note: the C++ #includes are all together at the bottom.  This file is
 * used by both C and C++ code, so we put all the C++ together.
 */

This seems to indicate that the variable _WIN32 is not defined.  But this 
article 
http://stackoverflow.com/questions/662084/whats-the-difference-between-the-win32
-and-win32-defines-in-c seems to indicate that _WIN32 should automatically be 
defined by your compiler...

Original comment by tom.ritc...@gmail.com on 12 Oct 2010 at 3:50

GoogleCodeExporter commented 9 years ago
Hi, 

- @tom.ritchford .. VS.NET 2003 does not contain the localtime_s etc methods, 
the link you provided is for VS.NET 2005. still its very easy to replace those 
methods with the none-safe versions.. 
see
http://msdn.microsoft.com/en-us/library/bf12f0hc%28v=vs.71%29.aspx
http://msdn.microsoft.com/en-us/library/zc53h9bh%28v=vs.71%29.aspx

- This won't solve the varargs problem.. A way to get around this can be found 
at 
http://rclermont.blogspot.com/2008/05/macros-and-variable-arguments-in.html

But that would just be hacks just to let VS.NET 2003 compile..

Original comment by amanjit....@gmx.de on 25 Sep 2011 at 3:49