[GRASSLIST:2162] Vect.h: problems from external code

Christopher Fonnesbeck chris at fonnesbeck.org
Thu Jan 8 14:01:32 EST 2004


I am trying to program GRASS externally, from python, using the weave  
module for integrating C code. It essentially allows me to run compiled  
C code from within python. However, when the C code gets compiled,  
including Vect.h causes problems (see below). None of the other modules  
cause errors -- just Vect.h. I'm wondering what I might be missing or  
doing wrong.

In file included from /usr/local/grass57/include/dgl.h:4,
                  from /usr/local/grass57/include/vect/dig_structs.h:15,
                  from /usr/local/grass57/include/vect/digit.h:3,
                  from /usr/local/grass57/include/Vect.h:4,
                  from inlas.py:198:
/usr/local/grass57/include/dgl/type.h:52: error: parse error before  
string
    constant
In file included from /usr/local/grass57/include/dgl/graph.h:30,
                  from /usr/local/grass57/include/dgl.h:5,
                  from /usr/local/grass57/include/vect/dig_structs.h:15,
                  from /usr/local/grass57/include/vect/digit.h:3,
                  from /usr/local/grass57/include/Vect.h:4,
                  from inlas.py:198:
/usr/local/grass57/include/dgl/heap.h:25: error: must have at least one  
catch
    per try block
/usr/local/grass57/include/dgl/heap.h:0: warning: `...' handler must be  
the
    last handler for its try block
/usr/local/grass57/include/dgl/heap.h:25: error: parse error before  
string
    constant
/usr/local/grass57/include/dgl/heap.h: At global scope:
/usr/local/grass57/include/dgl/heap.h:35: warning: ISO C++ forbids  
declaration
    of `dglHeapData_u' with no type
/usr/local/grass57/include/dgl/heap.h:41: error: 'dglHeapData_u' is  
used as a
    type, but is not defined as a type.
/usr/local/grass57/include/dgl/heap.h:70: error: type specifier omitted  
for
    parameter `dglHeapData_u'
/usr/local/grass57/include/dgl/heap.h:70: error: parse error before `)'  
token
/usr/local/grass57/include/dgl/heap.h:82: error: type specifier omitted  
for
    parameter `dglHeapData_u'
/usr/local/grass57/include/dgl/heap.h:82: error: parse error before `)'  
token
/usr/local/grass57/include/dgl/heap.h:90: error: parse error before `}'  
token
In file included from /usr/local/grass57/include/dgl/graph.h:31,
                  from /usr/local/grass57/include/dgl.h:5,
                  from /usr/local/grass57/include/vect/dig_structs.h:15,
                  from /usr/local/grass57/include/vect/digit.h:3,
                  from /usr/local/grass57/include/Vect.h:4,
                  from inlas.py:198:
/usr/local/grass57/include/dgl/tree.h:74: error: type specifier omitted  
for
    parameter `dglInt32_t'
/usr/local/grass57/include/dgl/tree.h:74: error: parse error before `)'  
token
/usr/local/grass57/include/dgl/tree.h:90: error: type specifier omitted  
for
    parameter `dglInt32_t'
/usr/local/grass57/include/dgl/tree.h:90: error: parse error before `)'  
token
/usr/local/grass57/include/dgl/tree.h:98: error: 'dglInt32_t' is used  
as a
    type, but is not defined as a type.
/usr/local/grass57/include/dgl/tree.h:104: error: type specifier  
omitted for
    parameter `dglInt32_t'
/usr/local/grass57/include/dgl/tree.h:104: error: parse error before  
`)' token
/usr/local/grass57/include/dgl/tree.h:113: error: 'dglInt32_t' is used  
as a
    type, but is not defined as a type.
/usr/local/grass57/include/dgl/tree.h:118: error: type specifier  
omitted for
    parameter `dglInt32_t'
/usr/local/grass57/include/dgl/tree.h:118: error: parse error before  
`)' token
/usr/local/grass57/include/dgl/tree.h:126: error: 'dglInt32_t' is used  
as a
    type, but is not defined as a type.
/usr/local/grass57/include/dgl/tree.h:127: error: 'dglInt32_t' is used  
as a
    type, but is not defined as a type.
/usr/local/grass57/include/dgl/tree.h:128: error: 'dglInt32_t' is used  
as a
    type, but is not defined as a type.
/usr/local/grass57/include/dgl/tree.h:129: error: 'dglInt32_t' is used  
as a
    type, but is not defined as a type.
/usr/local/grass57/include/dgl/tree.h:130: error: syntax error before  
`*' token
/usr/local/grass57/include/dgl/tree.h:131: error: 'dglByte_t' is used  
as a
    type, but is not defined as a type.
/usr/local/grass57/include/dgl/tree.h:136: error: type specifier  
omitted for
    parameter `dglInt32_t'
/usr/local/grass57/include/dgl/tree.h:136: error: parse error before  
`)' token
/usr/local/grass57/include/dgl/tree.h:144: error: 'dglInt32_t' is used  
as a
    type, but is not defined as a type.
/usr/local/grass57/include/dgl/tree.h:145: error: 'dglInt32_t' is used  
as a
    type, but is not defined as a type.
/usr/local/grass57/include/dgl/tree.h:146: error: syntax error before  
`*' token
/usr/local/grass57/include/dgl/tree.h:151: error: type specifier  
omitted for
    parameter `dglInt32_t'
/usr/local/grass57/include/dgl/tree.h:151: error: parse error before  
`)' token
/usr/local/grass57/include/dgl/tree.h:159: error: 'dglInt32_t' is used  
as a
    type, but is not defined as a type.
/usr/local/grass57/include/dgl/tree.h:160: error: 'dglInt32_t' is used  
as a
    type, but is not defined as a type.
/usr/local/grass57/include/dgl/tree.h:161: error: syntax error before  
`*' token
/usr/local/grass57/include/dgl/tree.h:166: error: type specifier  
omitted for
    parameter `dglInt32_t'
/usr/local/grass57/include/dgl/tree.h:166: error: parse error before  
`)' token
In file included from /usr/local/grass57/include/dgl.h:5,
                  from /usr/local/grass57/include/vect/dig_structs.h:15,
                  from /usr/local/grass57/include/vect/digit.h:3,
                  from /usr/local/grass57/include/Vect.h:4,
                  from inlas.py:198:
/usr/local/grass57/include/dgl/graph.h:96: error: syntax error before  
`*' token
/usr/local/grass57/include/dgl/graph.h:97: error: syntax error before  
`*' token
/usr/local/grass57/include/dgl/graph.h:98: error: syntax error before  
`*' token
/usr/local/grass57/include/dgl/graph.h:99: error: syntax error before  
`*' token
/usr/local/grass57/include/dgl/graph.h:100: error: 'dglInt32_t' is used  
as a
    type, but is not defined as a type.
/usr/local/grass57/include/dgl/graph.h:106: error: 'dglInt32_t' is used  
as a
    type, but is not defined as a type.
/usr/local/grass57/include/dgl/graph.h:116: error: syntax error before  
`*'
    token
/usr/local/grass57/include/dgl/graph.h:117: error: syntax error before  
`*'
    token
/usr/local/grass57/include/dgl/graph.h:118: error: syntax error before  
`*'
    token
/usr/local/grass57/include/dgl/graph.h:124: error: syntax error before  
`*'
    token
/usr/local/grass57/include/dgl/graph.h:156: error: 'dglByte_t' is used  
as a
    type, but is not defined as a type.
/usr/local/grass57/include/dgl/graph.h:157: error: 'dglByte_t' is used  
as a
    type, but is not defined as a type.
/usr/local/grass57/include/dgl/graph.h:158: error: 'dglInt32_t' is used  
as a
    type, but is not defined as a type.
/usr/local/grass57/include/dgl/graph.h:159: error: 'dglInt32_t' is used  
as a
    type, but is not defined as a type.
/usr/local/grass57/include/dgl/graph.h:160: error: parse error before  
`[' token
/usr/local/grass57/include/dgl/graph.h:162: error: 'dglInt32_t' is used  
as a
    type, but is not defined as a type.
/usr/local/grass57/include/dgl/graph.h:163: error: 'dglInt32_t' is used  
as a
    type, but is not defined as a type.
/usr/local/grass57/include/dgl/graph.h:164: error: 'dglInt32_t' is used  
as a
    type, but is not defined as a type.
/usr/local/grass57/include/dgl/graph.h:165: error: 'dglInt32_t' is used  
as a
    type, but is not defined as a type.
/usr/local/grass57/include/dgl/graph.h:166: error: 'dglInt32_t' is used  
as a
    type, but is not defined as a type.
/usr/local/grass57/include/dgl/graph.h:167: error: 'dglInt64_t' is used  
as a
    type, but is not defined as a type.
/usr/local/grass57/include/dgl/graph.h:169: error: 'dglInt32_t' is used  
as a
    type, but is not defined as a type.
/usr/local/grass57/include/dgl/graph.h:170: error: 'dglInt32_t' is used  
as a
    type, but is not defined as a type.
/usr/local/grass57/include/dgl/graph.h:171: error: 'dglInt32_t' is used  
as a
    type, but is not defined as a type.
/usr/local/grass57/include/dgl/graph.h:175: error: syntax error before  
`*'
    token
/usr/local/grass57/include/dgl/graph.h:176: error: 'dglInt32_t' is used  
as a
    type, but is not defined as a type.
/usr/local/grass57/include/dgl/graph.h:177: error: syntax error before  
`*'
    token
/usr/local/grass57/include/dgl/graph.h:178: error: 'dglInt32_t' is used  
as a
    type, but is not defined as a type.
/usr/local/grass57/include/dgl/graph.h:210: error: 'dglInt32_t' is used  
as a
    type, but is not defined as a type.
/usr/local/grass57/include/dgl/graph.h:211: error: 'dglInt32_t' is used  
as a
    type, but is not defined as a type.
/usr/local/grass57/include/dgl/graph.h:212: error: syntax error before  
`*'
    token
/usr/local/grass57/include/dgl/graph.h:213: error: 'dglInt32_t' is used  
as a
    type, but is not defined as a type.
/usr/local/grass57/include/dgl/graph.h:222: error: 'dglInt32_t' is used  
as a
    type, but is not defined as a type.
/usr/local/grass57/include/dgl/graph.h:223: error: 'dglInt32_t' is used  
as a
    type, but is not defined as a type.
/usr/local/grass57/include/dgl/graph.h:224: error: 'dglInt32_t' is used  
as a
    type, but is not defined as a type.
/usr/local/grass57/include/dgl/graph.h:225: error: 'dglInt32_t' is used  
as a
    type, but is not defined as a type.
/usr/local/grass57/include/dgl/graph.h:234: error: 'dglInt32_t' is used  
as a
    type, but is not defined as a type.
/usr/local/grass57/include/dgl/graph.h:247: error: syntax error before  
`*'
    token
/usr/local/grass57/include/dgl/graph.h:255: error: syntax error before  
`*'
    token
/usr/local/grass57/include/dgl/graph.h:266: error: syntax error before  
`*'
    token
/usr/local/grass57/include/dgl/graph.h:303: error: type specifier  
omitted for
    parameter `dglByte_t'
/usr/local/grass57/include/dgl/graph.h:303: error: parse error before  
`,' token
/usr/local/grass57/include/dgl/graph.h:312: error: syntax error before  
`*'
    token
/usr/local/grass57/include/dgl/graph.h:315: error: type specifier  
omitted for
    parameter `dglInt32_t'
/usr/local/grass57/include/dgl/graph.h:315: error: parse error before  
`,' token
/usr/local/grass57/include/dgl/graph.h:321: error: type specifier  
omitted for
    parameter `dglInt32_t'
/usr/local/grass57/include/dgl/graph.h:321: error: parse error before  
`)' token
/usr/local/grass57/include/dgl/graph.h:323: error: parse error before  
`*' token
/usr/local/grass57/include/dgl/graph.h:324: error: syntax error before  
`*'
    token
/usr/local/grass57/include/dgl/graph.h:325: error: syntax error before  
`*'
    token
/usr/local/grass57/include/dgl/graph.h:326: error: parse error before  
`*' token
/usr/local/grass57/include/dgl/graph.h:327: error: syntax error before  
`*'
    token
/usr/local/grass57/include/dgl/graph.h:328: error: type specifier  
omitted for
    parameter `dglInt32_t'
/usr/local/grass57/include/dgl/graph.h:328: error: parse error before  
`*' token
/usr/local/grass57/include/dgl/graph.h:329: error: type specifier  
omitted for
    parameter `dglInt32_t'
/usr/local/grass57/include/dgl/graph.h:329: error: parse error before  
`*' token
/usr/local/grass57/include/dgl/graph.h:330: error: type specifier  
omitted for
    parameter `dglInt32_t'
/usr/local/grass57/include/dgl/graph.h:330: error: parse error before  
`*' token
/usr/local/grass57/include/dgl/graph.h:331: error: type specifier  
omitted for
    parameter `dglInt32_t'
/usr/local/grass57/include/dgl/graph.h:331: error: parse error before  
`*' token
/usr/local/grass57/include/dgl/graph.h:336: error: parse error before  
`*' token
/usr/local/grass57/include/dgl/graph.h:338: error: parse error before  
`*' token
/usr/local/grass57/include/dgl/graph.h:339: error: parse error before  
`*' token
/usr/local/grass57/include/dgl/graph.h:340: error: syntax error before  
`*'
    token
/usr/local/grass57/include/dgl/graph.h:341: error: syntax error before  
`*'
    token
/usr/local/grass57/include/dgl/graph.h:342: error: syntax error before  
`*'
    token
/usr/local/grass57/include/dgl/graph.h:343: error: type specifier  
omitted for
    parameter `dglInt32_t'
/usr/local/grass57/include/dgl/graph.h:343: error: parse error before  
`*' token
/usr/local/grass57/include/dgl/graph.h:345: error: syntax error before  
`*'
    token
/usr/local/grass57/include/dgl/graph.h:352: error: type specifier  
omitted for
    parameter `dglInt32_t'
/usr/local/grass57/include/dgl/graph.h:352: error: parse error before  
`)' token
/usr/local/grass57/include/dgl/graph.h:357: error: type specifier  
omitted for
    parameter `dglInt32_t'
/usr/local/grass57/include/dgl/graph.h:357: error: parse error before  
`,' token
/usr/local/grass57/include/dgl/graph.h:365: error: type specifier  
omitted for
    parameter `dglInt32_t'
/usr/local/grass57/include/dgl/graph.h:365: error: parse error before  
`,' token
/usr/local/grass57/include/dgl/graph.h:401: error: type specifier  
omitted for
    parameter `dglByte_t'
/usr/local/grass57/include/dgl/graph.h:401: error: parse error before  
`*' token
/usr/local/grass57/include/dgl/graph.h:411: error: type specifier  
omitted for
    parameter `dglInt32_t'
/usr/local/grass57/include/dgl/graph.h:411: error: parse error before  
`,' token
/usr/local/grass57/include/dgl/graph.h:420: error: type specifier  
omitted for
    parameter `dglInt32_t'
/usr/local/grass57/include/dgl/graph.h:420: error: parse error before  
`,' token
/usr/local/grass57/include/dgl/graph.h:428: error: type specifier  
omitted for
    parameter `dglInt32_t'
/usr/local/grass57/include/dgl/graph.h:428: error: parse error before  
`*' token
/usr/local/grass57/include/dgl/graph.h:438: error: type specifier  
omitted for
    parameter `dglInt32_t'
/usr/local/grass57/include/dgl/graph.h:438: error: parse error before  
`,' token
/usr/local/grass57/include/dgl/graph.h:452: error: type specifier  
omitted for
    parameter `dglInt32_t'
/usr/local/grass57/include/dgl/graph.h:452: error: parse error before  
`,' token
/usr/local/grass57/include/dgl/graph.h:468: error: type specifier  
omitted for
    parameter `dglInt32_t'
/usr/local/grass57/include/dgl/graph.h:468: error: parse error before  
`,' token
/usr/local/grass57/include/dgl/graph.h:493: error: syntax error before  
`*'
    token
/usr/local/grass57/include/dgl/graph.h:494: error: type specifier  
omitted for
    parameter `dglInt32_t'
/usr/local/grass57/include/dgl/graph.h:494: error: parse error before  
`*' token
/usr/local/grass57/include/dgl/graph.h:497: error: parse error before  
`*' token
/usr/local/grass57/include/dgl/graph.h:498: error: type specifier  
omitted for
    parameter `dglInt64_t'
/usr/local/grass57/include/dgl/graph.h:498: error: parse error before  
`)' token
/usr/local/grass57/include/dgl/graph.h:499: error: parse error before  
`*' token
/usr/local/grass57/include/dgl/graph.h:500: error: type specifier  
omitted for
    parameter `dglInt32_t'
/usr/local/grass57/include/dgl/graph.h:500: error: parse error before  
`)' token
/usr/local/grass57/include/dgl/graph.h:501: error: parse error before  
`*' token
/usr/local/grass57/include/dgl/graph.h:502: error: type specifier  
omitted for
    parameter `dglInt32_t'
/usr/local/grass57/include/dgl/graph.h:502: error: parse error before  
`)' token
/usr/local/grass57/include/dgl/graph.h:512: error: syntax error before  
`*'
    token
/usr/local/grass57/include/dgl/graph.h:513: error: syntax error before  
`*'
    token
/usr/local/grass57/include/dgl/graph.h:514: error: syntax error before  
`*'
    token
/usr/local/grass57/include/dgl/graph.h:515: error: syntax error before  
`*'
    token
/usr/local/grass57/include/dgl/graph.h:516: error: syntax error before  
`*'
    token
/usr/local/grass57/include/dgl/graph.h:525: error: type specifier  
omitted for
    parameter `dglInt32_t'
/usr/local/grass57/include/dgl/graph.h:525: error: parse error before  
`*' token
/usr/local/grass57/include/dgl/graph.h:528: error: syntax error before  
`*'
    token
/usr/local/grass57/include/dgl/graph.h:529: error: syntax error before  
`*'
    token
/usr/local/grass57/include/dgl/graph.h:541: error: syntax error before  
`*'
    token
/usr/local/grass57/include/dgl/graph.h:542: error: syntax error before  
`*'
    token
inlas.py:200: warning: ISO C++ forbids declaration of `return_val' with  
no type
inlas.py:200: error: `ext' was not declared in this scope
inlas.py:203: error: parse error before `}' token
inlas.py:207: warning: ISO C++ forbids declaration of  
`exception_occured' with
    no type
inlas.py:208: error: parse error before `}' token
Traceback (most recent call last):
   File "inlas.py", line 329, in ?
     simulate(until=years)
   File  
"/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ 
python2.3/site-packages/SimPy/Simulation.py", line 610, in simulate
     a=_e._nextev()
   File  
"/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ 
python2.3/site-packages/SimPy/Simulation.py", line 374, in _nextev
     tt=tempev.who._nextpoint.next()
   File "inlas.py", line 143, in run
     self.effect(loc,ext)
   File "inlas.py", line 208, in effect
     extra_compile_args=['-I/usr/local/grass57/include'])
   File  
"/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ 
python2.3/site-packages/weave/inline_tools.py", line 335, in inline
     auto_downcast = auto_downcast,
   File  
"/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ 
python2.3/site-packages/weave/inline_tools.py", line 439, in  
compile_function
     verbose=verbose, **kw)
   File  
"/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ 
python2.3/site-packages/weave/ext_tools.py", line 340, in compile
     verbose = verbose, **kw)
   File  
"/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ 
python2.3/site-packages/weave/build_tools.py", line 272, in  
build_extension
     setup(name = module_name, ext_modules = [ext],verbose=verb)
   File  
"/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ 
python2.3/site-packages/scipy_distutils/core.py", line 42, in setup
     return old_setup(**new_attr)
   File  
"/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ 
python2.3/distutils/core.py", line 166, in setup
     raise SystemExit, "error: " + str(msg)
weave.build_tools.CompileError: error: command 'gcc' failed with exit  
status 1

--
Christopher J. Fonnesbeck ( c h r i s @ f o n n e s b e c k . o r g )
Georgia Cooperative Fish & Wildlife Research Unit, University of Georgia




More information about the grass-user mailing list