[C++-sig] The declaration is unexposed

Roman Yakovenko roman.yakovenko at gmail.com
Thu May 27 20:52:11 CEST 2010


On Thu, May 27, 2010 at 2:46 PM, vishal bayskar
<vishal.bayskar at nechclst.in> wrote:
>
> Hi All,
>
> I know below problem is very wired, but let me know what is going wrong.
>
> The declaration (class someClassB) is defended in file b.h in the same
> directory (same as a.h) but this declaration is not getting exposed.

Do you want to expose it?

> Please let me know why the declaration is not getting exposed though it is
> in the same directory.
>
> a.h
> --------
> include "b.h"
> class someClassA
> {
>        public:
>                someClassA( someClassB const &);
> };
>
> b.h
> --------
> class someClassB
> {
> public:
>        someClassB();
> };
>
>
> export.py
> -------------
> import os
> import pygccxml
> from pyplusplus import module_builder
> from pyplusplus.module_builder import call_policies
> from pyplusplus import decl_wrappers
>
> mb=module_builder.module_builder_t(["./a.h"],
> )

This is the reason why declaration "b" is unexposed. In this case,
declarations "b" was declared in a header file, which was not "asked"
to be exposed.

Consider use case with standard or system header files, you don't
really want to expose declaration from them, even so they were
included.

In any case, it seems that I selected the wrong defaults and I suggest
you to expose the desired declarations set manually. See
http://language-binding.net/pygccxml/query_interface.html document for
more information about queryAPI

> mb.build_code_creator(module_name = 'testModule')
> mb.write_module('testModule.cpp')
>
>
>
> Error
> --------------------
> vbayskar at machine03 decl]$ python export.py
> INFO Parsing source file "./a.h" ...
> INFO gccxml cmd: /usr/local/bin/gccxml  -I"."   "./a.h"
> -fxml="/tmp/tmpB13bTu.xml"
> INFO GCCXML version - 0.9( 1.132 )
>
> WARNING: someClassB [class]
>> execution error W1040: The declaration is unexposed, but there are other
>> declarations, which refer to it. This could
>> cause "no to_python converter found" run time error. Declarations:
>> someClassA::someClassA(someClassB const & arg0)
>> [constructor]

HTH

-- 
Roman Yakovenko
C++ Python language binding
http://www.language-binding.net/


More information about the Cplusplus-sig mailing list