Re: newbie problem with wrapping c++ code

Greg Ewing <[email protected]>
Newsgroups gmane.comp.python.pyrex
Organization University of Canterbury | Te Whare Wananga o Waitaha
Message-ID <[email protected]>
Hoyt Koepke wrote:
> ccode/test.h is just:
> 
> ++++++++++++++++++++++++++++
> void hello_world();
> ++++++++++++++++++++++++++++

Pyrex currently only wraps C++ functions that use C calling
conventions.

You need

   extern "C" void hello_world();

otherwise the name gets mangled and doesn't match the
plain C name "hello_world" that the Pyrex-generated code
is using.

--
Greg
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.