[GCC-XML] Trouble Using Gccxml with Windows VC80 and STL

Christian Tonn christian.tonn at archit.uni-weimar.de
Wed Oct 8 13:33:43 EDT 2008


Hi All,

I am really a gccxml newbie ... and my English might be a little confused (I
am German) ... I hope you can help me with my gccxml questions. So far I
successfully checked out the latest version of gccxml (yesterday), compiled
it and my first test of gccxml was successful. I am using gccxml together
with the Reflex library
(http://seal-reflex.web.cern.ch/seal-reflex/index.html). This library uses
gccxml in a python script to parse c/c++ classes to enable reflexion. I use
MS VC++2005 SP1, Windows XP prof.

My first successful test was this:

File "TestClass01.h":

   //#pragma once

   namespace TESTING
   {
      class point
      {
      protected:
         double x,y,z;

      public:
         point();
         point(double new_x, double new_y, double new_z);

         void SetX(double new_x);
         void SetY(double new_y);
         void SetZ(double new_z);

         double GetX() const;
         double GetY() const;
         double GetZ() const;
      };
   }

There was also the right "TestClass01.cpp". I trust you don't need to see
it. It was all fine.  The Reflex output from the python script told me the
following gccxml parameters:

// Generated at Wed Oct 08 18:11:56 2008. Do not modify it

/*
GCC-XML version 0.9.0
Configuration settings:
  GCCXML_CONFIG="C:/Programme/gccxml/share/gccxml-0.9/gccxml_config"
  GCCXML_COMPILER="cl"
  GCCXML_CXXFLAGS=" /DWIN32 /D_WINDOWS /W3 /Zm1000 /EHsc /GR"
  GCCXML_EXECUTABLE="C:/Programme/gccxml/bin/gccxml_cc1plus.exe"
  GCCXML_CPP="C:/Programme/gccxml/bin/gccxml_cc1plus.exe"
  GCCXML_FLAGS="-U__STDC__ -U__STDC_HOSTED__
-D__stdcall=__attribute__((__stdcall__))
-D__cdecl=__attribute__((__cdecl__))
-D__fastcall=__attribute__((__fastcall__))
-D__thiscall=__attribute__((__thiscall__))
-D_stdcall=__attribute__((__stdcall__)) -D_cdecl=__attribute__((__cdecl__))
-D_fastcall=__attribute__((__fastcall__))
-D_thiscall=__attribute__((__thiscall__)) -D__declspec(x)=__attribute__((x))
-D__pragma(x)= -D__cplusplus -D_inline=inline -D__forceinline=__inline
-D_MSC_VER=1400 -D_MSC_EXTENSIONS -D_WIN32 -D_M_IX86 -D_WCHAR_T_DEFINED
-DPASCAL= -DRPC_ENTRY= -DSHSTDAPI=HRESULT -D_INTEGRAL_MAX_BITS=64
-D__uuidof(x)=IID() -DSHSTDAPI_(x)=x -D__w64= -D__int8=char -D__int16=short
-D__int32=int -D__int64="long long" -D__ptr64= -DSTRSAFE_NO_DEPRECATE
-D_CRT_FAR_MAPPINGS_NO_DEPRECATE -D_CRT_MANAGED_FP_NO_DEPRECATE
-D_CRT_MANAGED_HEAP_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE
-D_CRT_OBSOLETE_NO_DEPRECATE -D_CRT_SECURE_NO_DEPRECATE
-D_CRT_SECURE_NO_DEPRECATE_GLOBALS -D_CRT_VCCLRIT_NO_DEPRECATE
-D_SCL_SECURE_NO_DEPRECATE -D_WINDOWS_SECURE_NO_DEPRECATE
-iwrapper"C:/Programme/gccxml/share/gccxml-0.9/Vc8/Include"
-iwrapper"C:/Programme/gccxml/share/gccxml-0.9/Vc8/PlatformSDK"
-I"C:/Programme/Microsoft Visual Studio 8/VC/include"
-I"C:/Programme/Microsoft Visual Studio 8/VC/PlatformSDK/Include" "
  GCCXML_USER_FLAGS=""
  GCCXML_ROOT="C:/Programme/gccxml/share/gccxml-0.9"

Compiler info:
Der Befehl "cl" ist entweder falsch geschrieben oder konnte nicht gefunden
werden.
*/

The last line in German means: "cl" (compiler) could not be found. I thrust
this is not important because it all worked and I tested the reflexion
results. Superb!

Now I modified my test:

Changed file "TestClass01.h":

   //#pragma once
   #include <vector> //new
   
   namespace TESTING
   {
      class point
      {
          [ ... same code as above ... ]
      };
   }

   //new:

   typedef std::vector<TESTING::point *> PointVector;

   namespace TESTING
   {
      class loop
      {
      public:

         PointVector points;
      };
   }

Since I am using the STL vector template each gccxml run is crashing. This
is the first part of the error output:

In file included from
C:/Programme/gccxml/share/gccxml-0.9/Vc8/Include/iterator:6, from
C:/Programme/gccxml/share/gccxml-0.9/Vc8/Include/memory:6, from
C:/Programme/gccxml/share/gccxml-0.9/Vc8/Include/vector:6, from
TestClass01.h:2:
C:/Programme/gccxml/share/gccxml-0.9/Vc8/Include/xutility: In function
'_OutElem * std::copy(_InIt, _InIt, _OutElem (&)[_Size])':
C:/Programme/gccxml/share/gccxml-0.9/Vc8/Include/xutility:2384: error:
'::stdext' has not been declared
C:/Programme/gccxml/share/gccxml-0.9/Vc8/Include/xutility: In function
'_OutElem * std::_Move(_InIt, _InIt, _OutElem (&)[_Size])':
C:/Programme/gccxml/share/gccxml-0.9/Vc8/Include/xutility:2458: error:
'::stdext' has not been declared
C:/Programme/gccxml/share/gccxml-0.9/Vc8/Include/xutility: In function
'std::pair<_InIt1, _InElem2*> std::mismatch(_InIt1, _InIt1, _InElem2
(&)[_Size])':
C:/Programme/gccxml/share/gccxml-0.9/Vc8/Include/xutility:2682: error:
'::stdext [...]

... I think STL is not working. I successfully ran the
"gccxml_vcconfig.bat". 

1. Did I miss something in my setup? 

2. Is there a way to use gccxml and STL-containers together in windows? 

3. Has anyone tried something like this? 

4. Currently, I am using the STL delivered with MS VisualStudio 2005. Am I
supposed to use another STL implementation to make it work?

5. Is a patch of the /gccxml/share/gccxml-0.9/Vc8/Include/ files necessary?

I also hope this is the right place to ask, because of this reflex library.
Thanks in advance!

Ciao, says
               Christian




More information about the gccxml mailing list