I'm using the following c++ code
using namespace std;
#include <iostream>
#include <stdio.h>
#include <opencv/cv.h>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv/highgui.h>
#include <opencv/cv.h>
#include <R.h>
#include <Rinternals.h>
#include <Rmath.h>
extern "C" {
SEXP FiltroGaus(SEXP size1_r, SEXP size2_r, SEXP sigma_r) {
int size1 = INTEGER(size1_r)[0];
int size2 = INTEGER(size2_r)[0];
double sigma = REAL(sigma_r)[0];
}
}
This compiles without errors but when in R I type .C("FiltroGaus",3,3,2)
The message is: Errore: INTEGER() can only be applied to a 'integer', not a 'NULL'
.
If I type .C("FiltroGaus",as.integer(3),as.integer(3),as.double(2))
The message is Errore: INTEGER() can only be applied to a 'integer', not a 'closure'
.
while if I type .Call("FiltroGaus",as.integer(3),as.integer(3),as.double(2))
the message is:
NULL
*** caught segfault ***
address 0x200000be, cause 'memory not mapped'
Possible actions:
1: abort (with core dump, if enabled)
2: normal R exit
3: exit R without saving workspace
4: exit R saving workspace