[GRASS-dev] trying to compile wxPython NVIZ

William Kyngesburye woklist at kyngchaos.com
Wed Jul 16 10:13:42 EDT 2008


I got further now.  By ignoring render.c, libnviz compiles.

Now I'm in wxpython/nviz.  I see that there is still the nviz header  
include order problem here.  In wxpython nviz.h, the order should be:

extern "C" {
#include <grass/gis.h>
#include <grass/nviz.h>
#include <grass/gsurf.h>
#include <grass/gstypes.h>
}


And I see one in nviz.i:

%{
#include "nviz.h"
#include <grass/gsurf.h>
#include <grass/gstypes.h>
%}


Now I get an error in the swig wrapper:

c++ -I/Users/Shared/src/GRASS/svn/trunk/dist.i386-apple-darwin9.3.0/ 
include  -Os   -fno-common -I/Library/Frameworks/GDAL.framework/ 
Versions/1.5/Headers -I/System/Library/Frameworks/Python.framework/ 
Versions/2.5/include/python2.5 -I/System/Library/Frameworks/ 
Python.framework/Versions/2.5/include/python2.5 -fno-strict-aliasing - 
Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic - 
DNDEBUG -g -Os -Wall -Wstrict-prototypes -DMACOSX -I/usr/include/ffi - 
DENABLE_DTRACE -I/usr/lib/wx/include/mac-unicode-debug-2.8 -I/usr/ 
include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXDEBUG__ - 
D__WXMAC__      -DPACKAGE=\""grasslibs"\"  -I/Users/Shared/src/GRASS/ 
svn/trunk/dist.i386-apple-darwin9.3.0/include -o OBJ.i386-apple- 
darwin9.3.0/grass7_wxnviz_wrap.o -c grass7_wxnviz_wrap.cpp
cc1plus: warning: command line option "-Wstrict-prototypes" is valid  
for C/ObjC but not for C++
/usr/include/wx-2.8/wx/mac/carbon/glcanvas.h:49: warning:  
‘AGLDrawable’ is deprecated (declared at /System/Library/Frameworks/ 
AGL.framework/Headers/agl.h:61)
/usr/include/wx-2.8/wx/mac/carbon/glcanvas.h:53: warning:  
‘AGLDrawable’ is deprecated (declared at /System/Library/Frameworks/ 
AGL.framework/Headers/agl.h:61)
grass7_wxnviz_wrap.cpp:3165: error: expected unqualified-id before ‘{’  
token
grass7_wxnviz_wrap.cpp:3173: error: expected unqualified-id before ‘{’  
token
grass7_wxnviz_wrap.cpp:3180: error: expected unqualified-id before ‘{’  
token
grass7_wxnviz_wrap.cpp:3241: error: expected unqualified-id before ‘{’  
token
grass7_wxnviz_wrap.cpp:3781: error: expected unqualified-id before ‘{’  
token
grass7_wxnviz_wrap.cpp: In static member function ‘static int  
swig::traits_asptr_stdseq<Seq, T>::asptr(PyObject*, Seq**)’:
grass7_wxnviz_wrap.cpp:3889: error: expected unqualified-id before ‘?’  
token
make: *** [OBJ.i386-apple-darwin9.3.0/grass7_wxnviz_wrap.o] Error 1

The relevant lines (first case):

   template <class Type>
   struct traits_check<Type, value_category> {
     static bool check(PyObject *obj) {
       int res = obj ? asval(obj, (Type *)(0)) : SWIG_ERROR;
       return SWIG_IsOK(res) ? true : false;
     }
   };

It's the check(PyObject) line.  All the other errors are also on  
check(PyObject) lines (except that last one), which is:

	    return pyseq.check() ? SWIG_OK : SWIG_ERROR;

I'm using the SWIG included in OSX Xcode 3.1: v1.3.31.

On Jul 16, 2008, at 8:33 AM, William Kyngesburye wrote:

> On Jul 16, 2008, at 2:45 AM, Glynn Clements wrote:
>
>> According to:
>>
>> http://developer.apple.com/documentation/GraphicsImaging/Reference/AGL_OpenGL/Reference/reference.html
>>
>> it should be AGLPixelFormat (without the "ID" suffix).
>>
>> And that's exactly what togl.c uses.
>>
> That works, but now it chokes on AGLPixmap...
>
>> Also, I note that aglCreateAGLPixmap isn't mentioned on that page.
>> However, it does describe aglCreatePBuffer, which is probably the
>> appropriate function to use (similarly, the X11 implementation should
>> probably use pBuffers if they are available).
>
> ... so I wonder if "AGLPixmap windowId;" should also be changed to  
> "AGLPbuffer windowId;"?
>
> Doing that works.  But I imagine that the rest of the nviz library  
> must be changed to use AGLPbuffers.
>
> I didn't get errors elsewhere about missing AGL pixmap functions.  I  
> only see those in render.c, which I disabled to be able to compile  
> libnviz.
>

-----
William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
http://www.kyngchaos.com/

"Time is an illusion - lunchtime doubly so."

- Ford Prefect




More information about the grass-dev mailing list