is not a member of.....
Apr 29, 2013 at 5:52pm UTC
Hi forum,
I am using a api written in C++.
The api have the some class declaration under the namespace osgViewer as follows:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
namespace osgViewer
{
class OSGVIEWER_EXPORT GraphicsHandleWin32
{
public :
...............
...............
};
class OSGVIEWER_EXPORT GraphicsHandleX11
{
public :
................
................
};
in the main code i declare as follows:
1 2
osgViewer::GraphicsHandleX11 *linuxContext = NULL;
osgViewer::GraphicsHandleWin32 *windowsContext = NULL;
But i am getting the following error:
1 2
error: ‘GraphicsHandleWin32’ is not a member of ‘osgViewer’
I included the proper file in the file inclusion as follows:
1 2 3 4 5
#ifdef WIN32
#include <osgViewer/api/Win32/GraphicsHandleWin32>
#else
#include <osgViewer/api/X11/GraphicsHandleX11>
#endif
Any idea folks?
Regards
Sajjad
Apr 29, 2013 at 6:01pm UTC
1 2
osgViewer::GraphicsHandleX11 *linuxContext = NULL;
osgViewer::GraphicsHandleWin32 *windowsContext = NULL;
I think that these two declarations can not exist simultanrouly.:) These include files
#ifdef WIN32
#include
<osgViewer/api/Win32/GraphicsHandleWin32>
#else
#include
<osgViewer/api/X11/GraphicsHandleX11>
#endif
are mutually exclusive.
Apr 29, 2013 at 7:00pm UTC
sajis997 wrote:#ifdef WIN32
Windows does not define "
WIN32 "; it should should be "
_WIN32 ". Because "
WIN32 " isn't known, the preprocessor will ignore the "
#include <osgViewer/api/Win32/GraphicsHandleWin32> " directive and use the "
#include <osgViewer/api/X11/GraphicsHandleX11> " directive instead.
Wazzak
Last edited on Apr 29, 2013 at 7:01pm UTC
Topic archived. No new replies allowed.