Pages

SWIG Code will Compile on One Computer, not on another

samedi 16 juillet 2016

What are the best things to check when code produces compiler errors on one computer, but not on another? The compile error looks like:

Code:

cparamlib_wrap.c: In function 'doubleArray___getitem__':
cparamlib_wrap.c:2720:5: error: invalid use of undefined type 'struct doubleArray'
     return self[index];
     ^
cparamlib_wrap.c:2720:16: error: dereferencing pointer to incomplete type
     return self[index];
                ^
cparamlib_wrap.c: In function 'doubleArray___setitem__':
cparamlib_wrap.c:2723:5: error: invalid use of undefined type 'struct doubleArray'
     self[index] = value;
     ^
cparamlib_wrap.c:2723:9: error: dereferencing pointer to incomplete type
     self[index] = value;
the lines of code it is referring to are:

Code:

SWIGINTERN double doubleArray___getitem__(struct doubleArray *self,size_t index){
    return self[index];
  }
SWIGINTERN void doubleArray___setitem__(struct doubleArray *self,size_t index,double value){
    self[index] = value;
  }
This is under gcc-4.8, but i've also tried under gcc-4.4.7. However, I've also run it on another linux computer (redhat in this case), and it compiles without any errors, using gcc-4.4.7. Unfortunately, I need to get the code working on the Ubuntu machine -- any suggestions on what to check? It looks to me like the compile environments are pretty similar except for the choice of gcc version, which I've tried to synchronize between both machines.

The gcc command it is failing on is:

Code:

gcc -DHAVE_CONFIG_H -I. -I..  -I/home/tim/Canopy/appdata/canopy-1.4.0.1938.rh5-x86_64/include/python2.7 -I../cparamlib   -g -O2 -MT _cparamlib_la-cparamlib_wrap.lo -MD -MP -MF .deps/_cparamlib_la-cparamlib_wrap.Tpo -c -o _cparamlib_la-cparamlib_wrap.lo `test -f 'cparamlib_wrap.c' || echo './'`cparamlib_wrap.c

This entry passed through the Full-Text RSS service - if this is your content and you're reading it on someone else's site, please read the FAQ at http://ift.tt/jcXqJW.
Recommended article from FiveFilters.org: Most Labour MPs in the UK Are Revolting.



SWIG Code will Compile on One Computer, not on another

Aucun commentaire:

Enregistrer un commentaire