For example, I have test.cpp:
#include<iostream>
using namespace std;
void hello(){
cout<<"Hello World!"<<endl;
}
I write test.i:
%module test
%{
#include<iostream>
%}
void hello();
When I compile test_wrap.cxx, it tell me hello() is not declare, and I change test.i to:
%module test
%{
#include<iostream>
void hello();
%}
void hello();
It pass the compiling, I'm confused because I see some demos don't write function declaration in %{ %{, and why we need to write
void hello(); twice?