jigar-joshi / libjingle

Automatically exported from code.google.com/p/libjingle
0 stars 0 forks source link

Compilation failure (time.h naming conflict) using Microsoft Visual Studio 2008 #209

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Importing a project from qmake .pro file into MS VS 2008 using Qt VS Add-in

2. Trying to compile jingle with the related compiler options /I "libjingle" /I 
"libjingle\talk" /I "libjingle\talk\base" /I "..\talk\examples\call" /I 
"..\..\..\..\QtSDK\Desktop\Qt\4.7.3\msvc2008\mkspecs\default"
(these are automatically generated based on INCLUDEPATH variables from qmake 
.pro file)

3. .\src\presenceouttask.cpp(140) : error C3861: 'time': identifier not found
.\src\presenceouttask.cpp(141) : error C3861: 'gmtime': identifier not found
.\src\presenceouttask.cpp(143) : error C3861: 'strftime': identifier not found

What is the expected output? What do you see instead?
Using angle brackets to include the header name <time.h> should refer to the 
standard header instead of the talk/base/time.h file. Unfortunately, this is 
not possible in this case. MSDN documentation says that preprocessor handles 
each /I first then the INCLUDE environment variables.

http://msdn.microsoft.com/en-us/library/36k2cdd4(v=VS.90).aspx

What version of the product are you using? On what operating system?
libjingle 0.5.8
Microsoft Visual Studio 2008 SP1
Qt VS Add-in 1.1.9
Windows 7 Ultimate (64bit)

Please provide any additional information below.
According to the google c++ style guide the file name (time.h) should be unique.
http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml#File_Names

Same recommendation here:
https://www.securecoding.cert.org/confluence/display/seccode/PRE04-C.+Do+not+reu
se+a+standard+header+file+name

Original issue reported on code.google.com by Bella.Ga...@gmail.com on 8 Sep 2011 at 9:42

GoogleCodeExporter commented 9 years ago
This has been fixed. time.h -> timeutils.h

Original comment by juberti@google.com on 21 Dec 2011 at 11:09