472,146 Members | 1,382 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,146 software developers and data experts.

structure C, transform to Python by using Swig

Hello
I am trying to convert and manage a simple structure C ,to Python by using C. The code is the following :
/* example.c*/
double sum(Vector c)
{
return c.x+c.y+c.z;
}
/*header.h*/
struct Vector{
double x,y,z;
}
/*interface_file.i*/
%module interface
%{
#include "structure.h"
%}
#include "structure.h"

I execute the following commands:
swig -python interface.i
gcc -c example.c interface_file_wrap.c -I/usr/include/python2.5
and after that an error appears:
example.c:3: error: expected ‘)’ before ‘c’
What is the solution?
Aug 9 '07 #1
0 1077

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

5 posts views Thread by Gary | last post: by
reply views Thread by Helmut Zeisel | last post: by
13 posts views Thread by Roy Smith | last post: by
1 post views Thread by Arthur Chereau | last post: by
6 posts views Thread by matey | last post: by
reply views Thread by Basha J P M | last post: by
reply views Thread by Saiars | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.