On Ubuntu Saucy 64bit in termial using g++ Im attempting to wrap OpenCV in a language without a strong C++ ffi so im attempting to use C++ to C wrappers to aid in doing this... Here is the small peice of the files Im trying to convert just to get a feel for it(opencv_generated.hpp and opencv_generated.cpp at this link https://github.com/arjuncomar/opencv-raw)
opencv_generated.hpp:
#include <opencv2/opencv.hpp>
#include <vector>
#ifndef __OPENCV_GENERATED_HPP
#define __OPENCV_GENERATED_HPP
using namespace cv;
using namespace std;
using namespace flann;
using namespace cvflann;
extern "C" {
Mat* cv_imread(String* filename, int flags);
void cv_imshow(String* winname, Mat* mat);
bool cv_imwrite(String* filename, Mat* img, vector_int* params);}
opencv_generated.cpp:
#include "opencv_generated.hpp"
using namespace cv;
using namespace std;
using namespace flann;
using namespace cvflann;
extern "C" {
Mat* cv_imread(String* filename, int flags) {
return new Mat(cv::imread(*filename, flags));
}
void cv_imshow(String* winname, Mat* mat) {
cv::imshow(*winname, *mat);
}
bool cv_imwrite(String* filename, Mat* img, vector_int* params) {
return cv::imwrite(*filename, *img, *params);
}}
Am new to C wrappers for C++ and am trying to compile with
g++ -Wall -dynamiclib -I/home/w/test/glue.hpp -I/home/w/test/glue.cpp -o test.so
im getting error:
g++: fatal error: no input files...im in the directory my
glue.hpp and glue.cpp files are in so what am i doing wrong....
any help == greatly valued=)