This repository was archived by the owner on Jan 6, 2018. It is now read-only.
This repository was archived by the owner on Jan 6, 2018. It is now read-only.
Send string as function parameter from Go to C++ #1
Open
Description
Hi,
first it is a very nice example.
Your project works fine if I send integer as parameter in my C++ function. I want to send a string from Go to C++ like:
C.Free("hello"))
then what should I define in my header
file. Currently, I tried this:
`#ifndef MY_PACKAGE_FOO_H
define MY_PACKAGE_FOO_H
include
ifdef __cplusplus
extern "C" {
endif
cv::string Free(cv::string len);
ifdef __cplusplus
}
endif
endif`
but I get the following error:
could not determine kind of name for C.Free
clang errors for preamble:
In file included from ./foo.go:5:
./foo.h:10:4: error: expected ';' after top level declarator
cv::string Free(cv::string len);
^
;
./foo.h:10:5: error: expected identifier or '('
cv::string Free(cv::string len);
^
2 errors generated.
where cv::string Free(cv::string len);
is my only C++
function in my *.cpp
file. Could you suggest anything?
Metadata
Metadata
Assignees
Labels
No labels
Activity