azzeddine1265 / libkml

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

(Windows) - Name conflict between overlay.h and windef.h #7

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1. Put this code in a Visual C++ project:

#include <windows.h>
#include "kml/dom.h"

int main(int argc, char* argv[])
{
    return 0;
}

2. Compile

What is the expected output? What do you see instead?
That code is expected to compile, but it does dot.

What version of the product are you using? On what operating system?
libkml-0.2.2, windows XP SP2, Visual Studio 2005.

Please provide any additional information below.

Almost any Windows Visual C++ projects include <windows.h>, which in turn
includes windef.h. At some point inside windef.h there is a line that says

   #define near

The class ViewVolume in the libkml header Overlay.h defines a method
near(); because of the above #define, the symbol 'near' is resolved into an
empty string and the compilation fails.

An obvious workaround is to include "kml/dom.h" before windows.h, but that
is too much of a constraint.

A better solution should be to rename the near() method into something else.

Original issue reported on code.google.com by LupoBu...@gmail.com on 21 May 2008 at 7:34

GoogleCodeExporter commented 9 years ago
Fixed in trunk:

http://code.google.com/p/libkml/source/browse/trunk/src/kml/dom/overlay.h

Original comment by kml.mash...@gmail.com on 21 May 2008 at 7:30