LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 05-25-2007, 05:47 AM   #1
varun_shrivastava
Member
 
Registered: Jun 2006
Distribution: Ubuntu 7.04 Feisty
Posts: 79

Rep: Reputation: 15
SWIG wrap.c file returns error: struct_vector_wrap.c:2413: error: dereferencing point


hi
i m having problem compiling .i *wrap.c files

my struct_vector.c file contains
Code:
 struct vector{
   double x,y,z;
};
and struct_vector.i contains
Code:
%module struct_vector
struct vector{
     double x,y,z;
};
than when i try to compile it gives following error

$ swig -python struct_vector.i
$ cc -c -fpic struct_vector.c struct_vector_wrap.c -I/usr/include/python2.4
Code:
struct_vector_wrap.c: In function ‘_wrap_vector_x_set’:
struct_vector_wrap.c:2413: error: dereferencing pointer to incomplete type
struct_vector_wrap.c: In function ‘_wrap_vector_x_get’:
struct_vector_wrap.c:2436: error: dereferencing pointer to incomplete type
struct_vector_wrap.c: In function ‘_wrap_vector_y_set’:
struct_vector_wrap.c:2467: error: dereferencing pointer to incomplete type
struct_vector_wrap.c: In function ‘_wrap_vector_y_get’:
struct_vector_wrap.c:2490: error: dereferencing pointer to incomplete type
struct_vector_wrap.c: In function ‘_wrap_vector_z_set’:
struct_vector_wrap.c:2521: error: dereferencing pointer to incomplete type
struct_vector_wrap.c: In function ‘_wrap_vector_z_get’:
struct_vector_wrap.c:2544: error: dereferencing pointer to incomplete type
struct_vector_wrap.c: In function ‘_wrap_new_vector’:
struct_vector_wrap.c:2558: error: invalid application of ‘sizeof’ to incomplete type ‘struct vector’
A part of struct_vector_wrap.c is as
Code:
SWIGINTERN PyObject *_wrap_vector_x_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   struct vector *arg1 = (struct vector *) 0 ;
   double arg2 ;
   void *argp1 = 0 ;
   int res1 = 0 ;
   double val2 ;
   int ecode2 = 0 ;
   PyObject * obj0 = 0 ;
   PyObject * obj1 = 0 ;
 
   if (!PyArg_ParseTuple(args,(char *)"OO:vector_x_set",&obj0,&obj1)) SWIG_fail;
   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_vector, 0 |  0 );
   if (!SWIG_IsOK(res1)) {
     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "vector_x_set" "', argument " "1"" of type '" "struct vector *""'");
   }
   arg1 = (struct vector *)(argp1);
   ecode2 = SWIG_AsVal_double(obj1, &val2);
   if (!SWIG_IsOK(ecode2)) {
     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "vector_x_set" "', argument " "2"" of type '" "double""'");
   }
   arg2 = (double)(val2);
   if (arg1) (arg1)->x = arg2; -------->> error here line 2413
 
   resultobj = SWIG_Py_Void();
   return resultobj;
 fail:
   return NULL;
 }
kindly help
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
tai64nlocal.c:55: error: dereferencing pointer to incomplete type ExCIA Linux - General 1 03-31-2009 10:49 AM
error: dereferencing pointer to incomplete type ChullDouvre Programming 2 05-02-2007 01:16 AM
Error: dereferencing pointer to incomplete type cynthia_thomas Programming 1 05-01-2006 09:10 AM
FTP returns an error 8, corrupts file gatsby Linux - Software 2 01-18-2006 01:32 PM
g-wrap make error stevenhasty Slackware 0 07-26-2003 05:30 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:20 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration