<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7638.1">
<TITLE>pygccxml.declarations.matcher.declaration_not_found_t: Unable to find declaration</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->

<P><FONT SIZE=2>Hi,<BR>
<BR>
Please point me where I am doing mistake or missing something.<BR>
<BR>
I created a simple example to understand the bit and bytes of py++<BR>
<BR>
<BR>
cpp header file afile.h<BR>
=========================<BR>
class box{<BR>
        public:<BR>
                box(int , int );<BR>
                int area(box &obj);<BR>
<BR>
        private:<BR>
                int length;<BR>
                int width;<BR>
        };<BR>
=========================<BR>
<BR>
cpp source file afile.cpp<BR>
=========================<BR>
#include"afile.h"<BR>
#include<iostream><BR>
<BR>
box::box(int x, int y):length(x),width(y)<BR>
{<BR>
}<BR>
<BR>
int box::area(box &obj){<BR>
        return obj.length * obj.width;<BR>
}<BR>
<BR>
using namespace std;<BR>
<BR>
int main()<BR>
{<BR>
        box p(10, 20);<BR>
        int a;<BR>
        a=p.area(p);<BR>
<BR>
        std::cout<<"Area is "<<a<<"\n";<BR>
        return 0;<BR>
}<BR>
======================<BR>
<BR>
py++ code afile.py<BR>
========================<BR>
import os<BR>
from pyplusplus import module_builder<BR>
from pyplusplus.module_builder import call_policies<BR>
<BR>
mb=module_builder.module_builder_t([r"/home/vbayskar/exPy/afile.cpp"])<BR>
<BR>
<BR>
mb.free_function('area').call_policies = call_policies.default_call_policies()<BR>
<BR>
mb.build_code_creator( module_name = 'testModule')<BR>
<BR>
mb.write_module('./testModule')<BR>
==========================<BR>
<BR>
and when I run this python file afile.py<BR>
<BR>
it gives the following error<BR>
============================<BR>
/usr/lib/python2.4/site-packages/pygccxml/parser/scanner.py:337: UserWarning: unable to find out array size from expression ""<BR>
  warnings.warn( msg )<BR>
Traceback (most recent call last):<BR>
  File "afile.py", line 8, in ?<BR>
    mb.free_function('area').call_policies = call_policies.default_call_policies()<BR>
  File "/usr/lib/python2.4/site-packages/pyplusplus/module_builder/builder.py", line 669, in free_function<BR>
    , recursive=recursive )<BR>
  File "/usr/lib/python2.4/site-packages/pygccxml/declarations/namespace.py", line 96, in free_function<BR>
    , recursive=recursive )<BR>
  File "/usr/lib/python2.4/site-packages/pygccxml/declarations/scopedef.py", line 354, in _find_single<BR>
    found = matcher_module.matcher.get_single( matcher, decls, False )<BR>
  File "/usr/lib/python2.4/site-packages/pygccxml/declarations/matcher.py", line 79, in get_single<BR>
    raise matcher.declaration_not_found_t( decl_matcher )<BR>
pygccxml.declarations.matcher.declaration_not_found_t: Unable to find declaration.  matcher: [(decl type==free_function_t) and (name==area)]<BR>
===========================<BR>
<BR>
<BR>
Thanks<BR>
Vishal<BR>
<BR>
<BR>
</FONT>
</P>

</BODY>
</HTML>

<pre>

DISCLAIMER: 
----------------------------------------------------------------------------------------------------------------------- 
The contents of this e-mail and any attachment(s) are confidential and
intended 
for the named recipient(s) only.  
It shall not attach any liability on the originator or NECHCL or its 
affiliates. Any views or opinions presented in  
this email are solely those of the author and may not necessarily reflect the 
opinions of NECHCL or its affiliates.  
Any form of reproduction, dissemination, copying, disclosure, modification, 
distribution and / or publication of  
this message without the prior written consent of the author of this e-mail is 
strictly prohibited. If you have  
received this email in error please delete it and notify the sender 
immediately. . 
-----------------------------------------------------------------------------------------------------------------------</pre>