Quantcast

oaDesignDB.i:7: Error: Syntax error in input(1).

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

oaDesignDB.i:7: Error: Syntax error in input(1).

varungupta
This post was updated on .
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: oaDesignDB.i:7: Error: Syntax error in input(1).

varungupta
This post was updated on .
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: oaDesignDB.i:7: Error: Syntax error in input(1).

David Froger
Hi,

OA_DESIGN_DLL_API shoud be a C macro, you should find its definition in the
Open Access C++ code, and put the macro in your oaDesign.h file.

Hope it helps,
David

Quoting varungupta (2013-11-29 15:25:14)
> Someone please reply. I am not able to proceed without that. How to include
> both the things in interface file and also what is OA_DESIGN_DLL_API in open
> access C++ API? Thanks Varun
> ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
> View this message in context: Re: oaDesignDB.i:7: Error: Syntax error in input
> (1).
> Sent from the swig-user mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT
organizations don't have a clear picture of how application performance
affects their revenue. With AppDynamics, you get 100% visibility into your
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk
_______________________________________________
Swig-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/swig-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: oaDesignDB.i:7: Error: Syntax error in input(1).

varungupta
This post was updated on .
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: oaDesignDB.i:7: Error: Syntax error in input(1).

David Froger
Quoting varungupta (2013-12-02 09:35:58)

> Thanks David! I will try this and then will get back. Can you please also help
> me with enum like how to include that? enum oaDesignAttrTypeEnum {
> oacLibNameDesignAttrType = 0, oacCellNameDesignAttrType = 1,
> oacViewNameDesignAttrType = 2, oacCellTypeDesignAttrType = 3,
> oacLastSavedTimeDesignAttrType = 4 }; I have tried with below explanation but
> it didn't work. #ifdef SWIG %rename(Myexample) oaDesignAttrTypeEnum; #endif
> struct oaDesignAttrTypeEnum { enum Value { oacLibNameDesignAttrType,
> oacCellNameDesignAttrType, oacViewNameDesignAttrType,
> oacCellTypeDesignAttrType, oacLastSavedTimeDesignAttrType}; }; typedef
> oaDesignAttrTypeEnum::Value Myexample; Regards Varun
> ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
> View this message in context: Re: oaDesignDB.i:7: Error: Syntax error in input
> (1).
> Sent from the swig-user mailing list archive at Nabble.com.

Hi Varun,

The enum definition:

enum oaDesignAttrTypeEnum { oacLibNameDesignAttrType = 0, oacCellNameDesignAttrType = 1,
oacViewNameDesignAttrType = 2, oacCellTypeDesignAttrType = 3,
oacLastSavedTimeDesignAttrType = 4 };

just need to be present in .h file that is %include d in the .i file,
see: http://swig.org/Doc2.0/Python.html#Python_nn17

Then in Python, you can access the enum:
>>> import modulename
>>> print modulename.oacLibNameDesignAttrType

Or are you trying to be able to access the enum like this?
>>> modulename.oaDesignAttrTypeEnum.oacLibNameDesignAttrType

------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT
organizations don't have a clear picture of how application performance
affects their revenue. With AppDynamics, you get 100% visibility into your
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk
_______________________________________________
Swig-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/swig-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: oaDesignDB.i:7: Error: Syntax error in input(1).

varungupta
This post was updated on .
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: oaDesignDB.i:7: Error: Syntax error in input(1).

David Froger
> I tried same thing that is mentioned in the link but it did not work. It was
> giving error and not generated the .py file.

It should be easy to fix. What are the contents of the .h and .i files, and
the error message?

------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT
organizations don't have a clear picture of how application performance
affects their revenue. With AppDynamics, you get 100% visibility into your
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk
_______________________________________________
Swig-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/swig-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: oaDesignDB.i:7: Error: Syntax error in input(1).

varungupta
This post was updated on .
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: oaDesignDB.i:7: Error: Syntax error in input(1).

David Froger
There are several informations that are missing in oaDesign.h, so the compiler
fails to compile oaDesignDB_wrap.cxx that includes it:
- definitions of the macros: BEGIN_OA_NAMESPACE END_OA_NAMESPACE OA_DESIGN_DLL_API
- base classes: oaAttrType oaDesignObject
and maybe others things.

Note that a minimalist .h and .i file for enums work:

oaDesign.h file:
#if !defined(oaDesign_P)
#define oaDesign_P

#define oavNumDesignAttrTypes       5

enum oaDesignAttrTypeEnum {
    oacLibNameDesignAttrType        = 0,
    oacCellNameDesignAttrType       = 1,
    oacViewNameDesignAttrType       = 2,
    oacCellTypeDesignAttrType       = 3,
    oacLastSavedTimeDesignAttrType  = 4
};

#endif

oaDesign.i file:
%module oaDesign
%{
#include "oaDesign.h"
%}

%include "oaDesign.h"

setup.py file:
#!/usr/bin/env python
from distutils.core import setup, Extension

oaDesign = Extension(
        '_oaDesign',
        sources = ['oaDesign.i',],
        swig_opts=["-c++",],
        )

setup (name = 'oaDesign',
       ext_modules = [oaDesign,],
       py_modules = ['oaDesign'],
       )

python setup.py build_ext --inplace

python
>> oaDesign.oavNumDesignAttrTypes
5
>>> oaDesign.oacCellNameDesignAttrType
1

So you could start from a minimalist working example and add features step by step
with testing each time.

You will need to provide C Macro definition as well as the base classes, and then link
with the oaDesignb library when wrappping oaDesign functions/classes;

------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT
organizations don't have a clear picture of how application performance
affects their revenue. With AppDynamics, you get 100% visibility into your
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk
_______________________________________________
Swig-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/swig-user
Loading...