Skip to content

Fail building wrapp.cpp.o #33

Closed
Closed

Description

@AlexisLeC

Dear all
I tried to build Boost.NumPy with python3.4, np 1.8.1 and boost 1.55.0 on ubuntu

First build with CMake-init.sh went right but when i tried to "make" in the created build directory I came up againt an error when building the wrap.cpp.o in the example directory?

[ 68%] Building CXX object libs/numpy/example/CMakeFiles/wrap.dir/wrap.cpp.o
../libs/numpy/example/wrap.cpp: In function ‘int main(int, char**)’:
../libs/numpy/example/wrap.cpp:114:40: error: ‘initexample’ was not declared in this scope
     PyImport_AppendInittab("example", &initexample);
                                        ^
make[2]: *** [libs/numpy/example/CMakeFiles/wrap.dir/wrap.cpp.o] Erreur 1
make[1]: *** [libs/numpy/example/CMakeFiles/wrap.dir/all] Erreur 2
make: *** [all] Erreur 2

Activity

  1. termoshtt commented on Sep 22, 2014

    @termoshtt
    Contributor

    In boost/python/module_init.hpp, the name of this initation function is generated as init + example (module name) for Python2 and PyInit_ + example (module name) for Python3.
    When I replace initexample with PyInit_example, it works.
    This function name is generated as a part of function definition,
    and there is no macro to generate function name only.
    Only way to avoid this is to switch the function name using preprocessor:

    # if PY_VERSION_HEX >= 0x03000000
        PyImport_AppendInittab("example", &PyInit_example);
    # else
        PyImport_AppendInittab("example", &initexample);
    # endif
  2. TallJimbo commented on Sep 10, 2015

    @TallJimbo
    Member

    Fixed in #39.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions